hbutils.binary.base¶
CIOType¶
CFixedType¶
-
class
hbutils.binary.base.
CFixedType
(size: int)[source]¶ - Overview:
Type with fixed size (such as
int
,uint
andfloat
).
-
__init__
(size: int)[source]¶ Constructor of
CFixedType
.- Parameters:
size – Size of the type.
-
read
(file: BinaryIO)[source]¶ Read from binary IO object.
- Parameters:
file – Binary file,
io.BytesIO
is supported as well.- Returns:
Reading result.
Warning
Need to be implemented.
-
property
size
¶ Size of the given type.
CRangedIntType¶
-
class
hbutils.binary.base.
CRangedIntType
(size: int, minimum: int, maximum: int)[source]¶ - Overview:
Type with fixed size and range (such as
int
anduint
).
-
__init__
(size: int, minimum: int, maximum: int)[source]¶ Constructor of
CRangedIntType
.- Parameters:
size – Size of the type.
minimum – Min value of the type.
maximum – Max value of the type.
-
property
maximum
¶ Max value of the type.
-
property
minimum
¶ Min value of the type.
-
read
(file: BinaryIO)[source]¶ Read from binary IO object.
- Parameters:
file – Binary file,
io.BytesIO
is supported as well.- Returns:
Reading result.
Warning
Need to be implemented.
-
property
size
¶ Size of the given type.
CMarkedType¶
-
class
hbutils.binary.base.
CMarkedType
(mark: str, size: int)[source]¶ - Overview:
Type with struct mark, which can be directly read by
struct
module.
-
__init__
(mark: str, size: int)[source]¶ Constructor of
CMarkedType
.- Parameters:
mark – Mark of the type.
size – Size of the type.
-
property
mark
¶ Mark of the type, will be used to read from binary data with
struct
module.
-
read
(file: BinaryIO)[source]¶ Read from binary with
struct
module.- Parameters:
file – Binary file,
io.BytesIO
is supported as well.- Returns:
Result value.
-
property
size
¶ Size of the given type.