Module pychrysalide.plugins.kaitai.records
Class RecordEmpty
Class RecordGroup
Class RecordItem
Class RecordList
Class RecordValue
Module pychrysalide.plugins.kaitai.records
Documentation
This module is providing objects used to link structure definitions with their data.
Classes
Class RecordEmpty
The RecordEmpty object reflects absolutely no match and should only get in some rare cases.
Instances can be created using following constructor:
RecordEmpty(parser, content, pos)
Where parser is the creator of the record, as a KaitaiParser instance, content is a BinContent instance providing the processed data and pos defines the current reading location, as a vmpa value.
Hierarchy
builtins.object ╰── gi._gi.GObject ╰── pychrysalide.plugins.kaitai.MatchRecord ╰── pychrysalide.plugins.kaitai.records.RecordEmpty
Attributes
value
Always None.
This attribute is only provided to mimic other record types.
Class RecordGroup
The RecordGroup class stores a map of parsed attributes with their relative values. Each of theses Kaitai attributes can be accessed as usual Python attribute.
Instances can be created using the following constructor:
RecordGroup(kstruct, content)
Where the kstruct refers to a KaitaiStructure instance as the creator of the newly created object, and content points to a BinContent instance.
Hierarchy
builtins.object ╰── gi._gi.GObject ╰── pychrysalide.plugins.kaitai.MatchRecord ╰── pychrysalide.plugins.kaitai.records.RecordGroup
Class RecordItem
The RecordItem class remembers a match between a described attribute and its concret value read from parsed binary data.
Instances can be created using the following constructor:
RecordItem(content, range, endian, attrib)
Where the attrib arguments refers to a KaitaiAttribute instance as the creator of the newly created object, content points to a BinContent instance, range is a mrange object, endian states with a SourceEndian hint the endianness used to read integer values.
Hierarchy
builtins.object ╰── gi._gi.GObject ╰── pychrysalide.plugins.kaitai.MatchRecord ╰── pychrysalide.plugins.kaitai.records.RecordItem
Attributes
truncated_bytes
Raw bytes carried by the item (truncated if a separator is defined in the linked attribute), or None if irrelevant regarding to the type of the attribute.
value
Carried value (as integer, bytes), or None in case of error.
Class RecordList
The RecordList class collects a list of parsed attributes with their relative values. Each of theses Kaitai attributes can be accessed as subscriptable Python attribute.
Instances can be created using the following constructor:
RecordList(content, attrib)
Where the attrib argument refers to the KaitaiAttribute instance used to create each record contained by the list and content points to a BinContent instance.
The object can provide some sequence methods (such as len() or [n]).
Hierarchy
builtins.object ╰── gi._gi.GObject ╰── pychrysalide.plugins.kaitai.MatchRecord ╰── pychrysalide.plugins.kaitai.records.RecordList
Class RecordValue
The RecordValue class stores a link to an instance used to compute a given value.
Instances can be created using the following constructor:
RecordValue(inst, locals)
Where the inst arguments refers to a KaitaiInstance instance as the creator of the newly created object, locals points to a KaitaiScope structure used as current scope.
Hierarchy
builtins.object ╰── gi._gi.GObject ╰── pychrysalide.plugins.kaitai.MatchRecord ╰── pychrysalide.plugins.kaitai.records.RecordValue
Attributes
value
Carried value (as integer, bytes), or None in case of error.