class documentation
class FixedWidthInteger(Integer):
An integer type of a fixed size.
Method | __init__ |
Build a new integer type of a fixed size. |
Method | __str__ |
Returns the nicely printable string representation of this instance. |
Method | size |
The minimal number of bytes necessary to hold an instance of this integer type. |
Property | endianness |
Property: The endianness of this integer type. |
Property | signedness |
Property: The signedness of this integer type. |
Method | _possible |
Undocumented |
Instance Variable | _endianness |
Undocumented |
Instance Variable | _signedness |
Undocumented |
Instance Variable | _size |
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 |
Return the underlying construct instance |
Inherited from Type
(via Integer
):
Method | description |
The short description of this type. |
Method | is |
Whether the context argument needed by some methods actually has an effect. |
Method | parse |
Parses the value of an instance of this type from a raw buffer, possibly depending on the context. |
Method | to |
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, size, signedness, endianness):
Build a new integer type of a fixed size.
Information
Parameters | |
size | the size, in bytes, of instance of this integer type |
signedness | an element of the Signedness enum indicating whether instances of this type are signed |
endianness | an element of the Endianness enum indicating the endianness of instances of this type |
Raises | |
ValueError | if the passed size is negative or null |
def __str__(self):
Returns the nicely printable string representation of this instance.
Returns | |
str | Undocumented |
def size_bytes(self, context=None):
overrides
reven2.types._integer.Integer.size_bytes
The minimal number of bytes necessary to hold an instance of this integer type.
Information
Parameters | |
context | The context object. See package documentation. |
Returns | |
An integer. |