class documentation

class BigEndian(Integer):

View In Hierarchy

An integer type that wraps an inner integer type and forces its endianness to big-endian.

Method __init__ Undocumented
Method __str__ Returns the nicely printable string representation of this instance.
Method is_context_sensitive Whether the context argument needed by some methods actually has an effect.
Method size_bytes The minimal number of bytes necessary to hold an instance of this integer type.
Property endianness Property: The endianness of this integer type. Will always be big-endian.
Property inner Property: The inner integer type.
Property signedness Property: The signedness of this integer type.
Method _possible_sizes Undocumented
Instance Variable _integer_type Undocumented

Inherited from Integer:

Method __eq__ Compares the instance for equality with an object.
Method __hash__ Returns the hash for this value.
Method __ne__ Compares the instance for equality with an object.
Method _construct_type Return the underlying construct instance

Inherited from Type (via Integer):

Method description The short description of this type.
Method parse Parses the value of an instance of this type from a raw buffer, possibly depending on the context.
Method to_bytes Build a byte buffer from a value of this type.
Method _resolve Uses the resolver to return a resolved version of the type, if possible.
def __init__(self, integer_type):

Undocumented

Parameters
integer_type:IntegerUndocumented
def __str__(self):

Returns the nicely printable string representation of this instance.

Returns
strUndocumented
def is_context_sensitive(self):

Whether the context argument needed by some methods actually has an effect.

Types that return False to this method are context-insensitive types. You can safely pass any object as context parameter (including None) to the methods of such type.

Note that the context-sensitivity of a type may change in the future.

Examples

Getting the size of a type without needing a context for context-insensitive types: >>> types.U32.is_context_sensitive() False >>> types.U32.size_bytes(context=None) 4 >>> array32_12 = types.Array(types.U32, 12) >>> array32_12.is_context_sensitive() False >>> array32_12.size_bytes() # context=None by default 48

Context-sensitive types may raise errors when attempting to get the size without a context: >>> types.USize.is_context_sensitive() True >>> types.USize.size_bytes(context=None) ValueError: Please provide a context when using a context-sensitive type

Returns
boolUndocumented
def size_bytes(self, context=None):

The minimal number of bytes necessary to hold an instance of this integer type.

Information

Parameters
context:_Optional[Context]The context object. See package documentation.
Returns
intAn integer.
@property
endianness: Endianness =

Property: The endianness of this integer type. Will always be big-endian.

Information

Returns
An Endianness.Big instance.
@property
inner: Integer =

Property: The inner integer type.

Information

Returns
A type from reven2.types.
@property
signedness: Signedness =

Property: The signedness of this integer type.

Information

Returns
A Signedness instance.
def _possible_sizes(self):

Undocumented

Returns
_Iterator[int]Undocumented
_integer_type =

Undocumented