Home | Trees | Indices | Help |
|
---|
|
object --+ | utils.graph.DetailNode --+ | xml.basic.BasicBase --+ | object --+ | | | editable.EditableBase --+ | | | editable.EditableSpinBox --+ | Int
Basic implementation of a 32-bit signed integer type. Also serves as a base class for all other integer types. Follows specified byte order.
>>> from tempfile import TemporaryFile >>> tmp = TemporaryFile() >>> from pyffi.object_models import FileFormat >>> data = FileFormat.Data() >>> i = Int() >>> i.set_value(-1) >>> i.get_value() -1 >>> i.set_value(0x11223344) >>> i.write(tmp, data) >>> j = Int() >>> if tmp.seek(0): pass # ignore result for py3k >>> j.read(tmp, data) >>> hex(j.get_value()) '0x11223344' >>> i.set_value(2**40) # doctest: +ELLIPSIS Traceback (most recent call last): ... ValueError: ... >>> i.set_value('hello world') Traceback (most recent call last): ... ValueError: cannot convert value 'hello world' to integer >>> if tmp.seek(0): pass # ignore result for py3k >>> if tmp.write('"3D'.encode("ascii")): pass # b'"3D' >>> if tmp.seek(0): pass # ignore result for py3k >>> i.read(tmp, data) >>> hex(i.get_value()) '0x44332211'
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
|
|
|||
_min = -2147483648 Minimum value. |
|||
_max = 2147483647 Maximum value. |
|||
_struct =
Character used to represent type in struct. |
|||
_size = 4 Number of bytes. |
|||
Inherited from Inherited from |
|
|||
Inherited from |
|
|
|
|
|
|
|
|
|
|
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Oct 10 19:03:56 2011 | http://epydoc.sourceforge.net |