�
��e�@ � �0 � d dl mZmZmZ d dlmZmZmZ d dlmZm Z d dl
mZmZ G d� de� Z
G d� de� Z G d � d
e� Z G d� de� Z G d
� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� d e� Z G d!� d"e� Z G d#� d$e� Z G d%� d&e� Z G d'� d(e� Z G d)� d*e� Z G d+� d,e� Z G d-� d.e � Z! G d/� d0e � Z"y1)2� )�Adapter�AdaptationError�Pass)�
int_to_bin�
bin_to_int�
swap_bytes)�FlagsContainer� HexString)�BytesIO�decodebytesc � � e Zd Zg Zy)�BitIntegerErrorN��__name__�
__module__�__qualname__� __slots__� � �@/usr/lib/python3.12/site-packages/elftools/construct/adapters.pyr r
� � ��Ir r c � � e Zd Zg Zy)�MappingErrorNr r r r r r r r r c � � e Zd Zg Zy)�
ConstErrorNr r r r r r r r r c � � e Zd Zg Zy)�ValidationErrorNr r r r r r r r r c � � e Zd Zg Zy)�PaddingErrorNr r r r r r r r r c �0 � e Zd ZdZg d�Z dd�Zd� Zd� Zy)�BitIntegerAdaptera�
Adapter for bit-integers (converts bitstrings to integers, and vice versa).
See BitField.
Parameters:
* subcon - the subcon to adapt
* width - the size of the subcon, in bits
* swapped - whether to swap byte order (little endian/big endian).
default is False (big endian)
* signed - whether the value is signed (two's complement). the default
is False (unsigned)
* bytesize - number of bits per byte, used for byte-swapping (if swapped).
default is 8.
)�width�swapped�signed�bytesizec �h � t j | |� || _ || _ || _ || _ y �N)r �__init__r"