hbutils.binary.base¶
CIOType¶
-
class
hbutils.binary.base.
CIOType
[source]¶ - Overview:
Basic IO type. Used as base class of all the IO types.
-
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.
-
write
(file: BinaryIO, val)[source]¶ Write object to binary IO object.
- Parameters:
file – Binary file,
io.BytesIO
is supported as well.val – Object to write.
Warning
Need to be implemented.
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.
-
write
(file: BinaryIO, val)[source]¶ Write object to binary IO object.
- Parameters:
file – Binary file,
io.BytesIO
is supported as well.val – Object to write.
Warning
Need to be implemented.
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.
-
write
(file: BinaryIO, val)[source]¶ Write object to binary IO object.
- Parameters:
file – Binary file,
io.BytesIO
is supported as well.val – Object to write.
Warning
Need to be implemented.
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.
Other Versions v: v0.10.0- Tags
- v0.0.1
- v0.1.0
- v0.1.1
- v0.10.0
- v0.10.1
- v0.2.0
- v0.3.0
- v0.3.1
- v0.3.2
- v0.3.3
- v0.4.0
- v0.4.1
- v0.4.2
- v0.4.3
- v0.4.4
- v0.4.5
- v0.4.6
- v0.4.7
- v0.5.0
- v0.5.1
- v0.5.2
- v0.6.0
- v0.6.1
- v0.6.10
- v0.6.11
- v0.6.12
- v0.6.13
- v0.6.14
- v0.6.2
- v0.6.3
- v0.6.4
- v0.6.5
- v0.6.6
- v0.6.7
- v0.6.8
- v0.6.9
- v0.7.0
- v0.7.1
- v0.7.2
- v0.7.3
- v0.7.4
- v0.7.5
- v0.7.6
- v0.8.0
- v0.8.1
- v0.8.2
- v0.8.3
- v0.8.4
- v0.8.5
- v0.8.6
- v0.9.0
- v0.9.1
- v0.9.2
- v0.9.3