Home | Trees | Indices | Help |
|
---|
|
object --+ | utils.graph.DetailNode --+ | xml.basic.BasicBase --+ | object --+ | | | editable.EditableBase --+ | | | editable.EditableLineEdit --+ | SizedString
Basic type for strings. The type starts with an unsigned int which describes the length of the string.
>>> from tempfile import TemporaryFile >>> f = TemporaryFile() >>> from pyffi.object_models import FileFormat >>> data = FileFormat.Data() >>> s = SizedString() >>> if f.write('\x07\x00\x00\x00abcdefg'.encode("ascii")): pass # ignore result for py3k >>> if f.seek(0): pass # ignore result for py3k >>> s.read(f, data) >>> str(s) 'abcdefg' >>> if f.seek(0): pass # ignore result for py3k >>> s.set_value('Hi There') >>> s.write(f, data) >>> if f.seek(0): pass # ignore result for py3k >>> m = SizedString() >>> m.read(f, data) >>> str(m) 'Hi There'
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
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 |