struct_parse package¶
Module contents¶
Parse the format defined in the struct
standard library module.
Single-file parser for the string format specified by the struct
standard library module. This enables the use of strings describing the layout
of packed binary data for other things besides just packing and unpacking, like
generating C struct definitions.
-
class
struct_parse.
ByteOrder
[source]¶ Bases:
enum.Enum
An enumeration.
-
BIG
= 2¶
-
LITTLE
= 1¶
-
NATIVE
= 0¶
-
NETWORK
= 3¶
-
-
class
struct_parse.
FieldList
(fields: List[struct_parse.FieldType] = [], byte_order: struct_parse.ByteOrder = <ByteOrder.NATIVE: 0>)[source]¶ Bases:
object
Simply a list of fields, along with a byte_order.
-
class
struct_parse.
FieldType
[source]¶ Bases:
enum.Enum
Type of a field in the struct. Represented by a single character in the format string.
-
BOOL
= 4¶
-
CHAR
= 1¶
-
CHAR_ARRAY
= 18¶
-
DOUBLE
= 17¶
-
FLOAT
= 16¶
-
HALF_PRECISION_FLOAT
= 15¶
-
INT
= 7¶
-
LONG
= 9¶
-
LONG_LONG
= 11¶
-
PAD
= 0¶
-
SHORT
= 5¶
-
SIGNED_CHAR
= 2¶
-
SIZE_T
= 14¶
-
SSIZE_T
= 13¶
-
UNSIGNED_CHAR
= 3¶
-
UNSIGNED_INT
= 8¶
-
UNSIGNED_LONG
= 10¶
-
UNSIGNED_LONG_LONG
= 12¶
-
UNSIGNED_SHORT
= 6¶
-
VOID_POINTER
= 19¶
-