- Added
OptionW
data types. They also work withStackedAttrArrayW
- Added
StackedAttrArrayW
data types. - Added
ret
,ref
, andcom
as type casting functions. Recommended use is only inside the classbody, as they cause overhead inon_xxx
functions - Changed
Manager
to only allow usingRetrieverRef
s - Added
DebugByteStream
which logs the bytes it reads for each specified retriever tobfp.log
- Changed
DefaultValueError
toDefaultAttributeError
, used when trying to instantiate aBaseStruct
from default without having default values - Added a
_dbg_repr
to base struct which can print partially initialisedBaseStruct
objects
RetrieverRef
can now accept an arbitrary number of retrievers to be able to reference data from sub structs.RetrieverRef
can now accept anint
as part of its arguments to index lists where requiredRetrieverRef
needs to be given at least one argumentRetrieverRef
can now acceptRetriever
orCombiner
or otherRef
s as argumentsRetrieverCombiner
must be given at least one argumentRetrieverCombiner
can now acceptRetriever
orRef
s or otherCombiner
s as argumentsVersionError
now also subclassesAttributeError
DefaultValueError
now also subclassesValueError
- Diffing structs now returns a dict of name-value pairs instead of just a list of retrievers.
- Note: This is an expensive operation and should only be used for debug purposes. diff's behaviour is subject to change!
- Added
StrArray8s
,StrArray16s
,StrArray32s
andStrArray64s
datatypes - Added
Manager
superclass for creating grouped retriever references and functions on them. Use this to provide a more coherent API for struct modification when the internal struct is messy - Added docstrings to datatypes, explaining their expected layouts
- For performance reasons, a
parent
reference is no longer available. To synchronise duplicate data in different parts of a file, the data source higher in the struct hierarchy is to be made responsible for performing the synchronisation. RefList
has been removed since parent references are no longer available.struct_ver
is now a read-only property and the functionality for changing a struct's version is no longer available and will be re-added in a future update.- A
Retriever
's repeat value is interpreted as follows:- repeat = 1 (default) means its data type is read once.
- repeat = 0 or > 1 means it is a list of its data type.
- repeat = -1 means the value does not exist and is skipped. (set to
None
) - repeat set via
set_repeat
will read a list of its data type, even for repeat = 1.- Note: If a single value is only conditionally present, then its repeat should default to 1, and should be set to -1 dynamically when it is intended to be absent for the desired behaviour. Setting a repeat to 1 dynamically will make it a singleton list!