Parser for kzb files. More...
#include <kanzi/core.ui/kzb/kzb_memory_parser.hpp>
Public Types | |
enum class | ArgumentType { Value , MessageArgument , ObjectProperty , ValueReference } |
Enum used in kzb file to mark the type of the arguments of ForwardingAction and ExpressionCondition instances. More... | |
typedef vector< BindingLoadInfo > | BindingContainer |
typedef vector< PropertyPair > | PropertyContainer |
typedef pair< AbstractPropertyType, Variant > | PropertyPair |
Public Member Functions | |
void | alignToOffset (ptrdiff_t alignBytes) |
Skip to next alignment of given bytes, relative to the beginning of the parsed data. | |
KzbMemoryParser (KzbFile *kzbFile, const byte *data, uint64_t dataSize) | |
Constructor. | |
KzbMemoryParser (KzbFile *kzbFile, ConstByteSpan data) | |
Constructor. | |
const Metaclass * | loadMetaclass () |
Load metaclass from current location in the file. | |
ObjectSharedPtr | loadObject () |
Load object from current location in the file. | |
void | loadProperties (Object &object) |
Load properties from current location in the file and store them in an object. | |
void | loadProperties (PropertyContainer &properties, BindingContainer &referenceBindings, bool resolveResources) |
Load properties from current location in the file and store them in a property container. | |
void | loadProperties (PropertyContainer &properties, bool resolveResources) |
Load properties from current location in the file and store them in a property container. | |
AbstractPropertyType | loadPropertyType () |
Load property type from current location in the file. | |
void | loadPropertyValue (Object &object) |
Load single property value from current location in the file and store it in an object. | |
Variant | loadVariant (bool resolveResources) |
Load variant from current location in the file. | |
Variant | loadVariantValue (PropertyDataType dataType, bool resolveResources) |
Load variant value from current location in the file. | |
ArgumentType | parseArgumentType () |
Parse a value of Argument Type from current position in the file. | |
bool | parseBool () |
Parse value from current position in the file. | |
ColorRGBA | parseColorRGBA () |
Parse value from current position in the file. | |
ConstByteSpan | parseData (size_t size) |
Parse value from current position in the file. | |
float | parseFloat () |
Parse value from current position in the file. | |
int32_t | parseInt32 () |
Parse value from current position in the file. | |
Matrix3x3 | parseMatrix3x3 () |
Parse value from current position in the file. | |
Matrix4x4 | parseMatrix4x4 () |
Parse value from current position in the file. | |
string_view | parseNullTerminatedString () |
Parse value from current position in the file. | |
AbstractRangeSharedPtr | parseRange () |
Parse a range value from current position in the file. | |
ConstByteSpan | parseSizedData () |
Parse value from current position in the file. | |
string_view | parseSizedString () |
Parse value from current position in the file. | |
KzbMemoryParser | parseSlice () |
Parse a slice from current position in the file. | |
SRTValue2D | parseSRT2D () |
Parse value from current position in the file. | |
SRTValue3D | parseSRT3D () |
Parse value from current position in the file. | |
string_view | parseStringReference () |
Load string index from the current location in the file, and look it up in the dictionary. | |
uint16_t | parseUint16 () |
Parse value from current position in the file. | |
uint32_t | parseUint32 () |
Parse value from current position in the file. | |
uint64_t | parseUint64 () |
Parse value from current position in the file. | |
uint8_t | parseUint8 () |
Parse value from current position in the file. | |
Vector2 | parseVector2 () |
Parse value from current position in the file. | |
Vector3 | parseVector3 () |
Parse value from current position in the file. | |
Vector4 | parseVector4 () |
Parse value from current position in the file. | |
void | skip (size_t sizeBytes) |
Skip bytes from current location in the file. | |
Parser for kzb files.
Used for parsing the binary data from a kzb file into raw values and Kanzi Engine constructs. As opposed to KzbFile, KzbMemoryParser only reads and parses values.
Enum used in kzb file to mark the type of the arguments of ForwardingAction and ExpressionCondition instances.
Enumerator | |
---|---|
Value | |
MessageArgument | |
ObjectProperty | |
ValueReference |
|
inlineexplicit |
Constructor.
kzbFile | The kzb file construct holding file information. |
data | The data block. |
dataSize | The data size. |
|
inlineexplicit |
Constructor.
kzbFile | The kzb file construct holding file information. |
data | The span representing the data. |
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
|
inline |
Parse value from current position in the file.
AbstractRangeSharedPtr kanzi::KzbMemoryParser::parseRange | ( | ) |
Parse a range value from current position in the file.
|
inline |
Parse a value of Argument Type from current position in the file.
|
inline |
Parse a slice from current position in the file.
Load single property value from current location in the file and store it in an object.
object | Object to store the property value to. |
Load properties from current location in the file and store them in an object.
object | Object to store property collection to. |
void kanzi::KzbMemoryParser::loadProperties | ( | PropertyContainer & | properties, |
bool | resolveResources ) |
Load properties from current location in the file and store them in a property container.
properties | Property container to store properties to. |
resolveResources | True to resolve resource immediately. |
void kanzi::KzbMemoryParser::loadProperties | ( | PropertyContainer & | properties, |
BindingContainer & | referenceBindings, | ||
bool | resolveResources ) |
Load properties from current location in the file and store them in a property container.
properties | Property container to store properties to. |
referenceBindings | Binding container to store reference bindings in. |
resolveResources | True to resolve resource immediately. |
Variant kanzi::KzbMemoryParser::loadVariantValue | ( | PropertyDataType | dataType, |
bool | resolveResources ) |
Load variant value from current location in the file.
dataType | Data type of the variant. |
resolveResources | True to resolve resource immediately. |
Load variant from current location in the file.
resolveResources | True to resolve resource immediately. |
Load metaclass from current location in the file.
AbstractPropertyType kanzi::KzbMemoryParser::loadPropertyType | ( | ) |
Load property type from current location in the file.
string_view kanzi::KzbMemoryParser::parseStringReference | ( | ) |
Load string index from the current location in the file, and look it up in the dictionary.
ObjectSharedPtr kanzi::KzbMemoryParser::loadObject | ( | ) |
Load object from current location in the file.
|
inline |
Skip bytes from current location in the file.
sizeBytes | Bytes to skip. |
Skip to next alignment of given bytes, relative to the beginning of the parsed data.
If alignment is already correct, the position is not moved.
alignBytes | Alignment to skip to. |