Parser over KZB file structure. More...
#include <kanzi/core.ui/kzb/kzb_memory_parser.hpp>
Public Types | |
typedef vector< pair< AbstractPropertyType, Variant > > | PropertyContainer |
typedef vector< BindingSharedPtr > | BindingContainer |
Public Member Functions | |
KzbMemoryParser (KzbFile *kzbFile, const byte *data, uint64_t dataSize) | |
Constructor. More... | |
uint32_t | parseUint32 () |
Parse value from current position in the file. More... | |
uint64_t | parseUint64 () |
Parse value from current position in the file. More... | |
int32_t | parseInt32 () |
Parse value from current position in the file. More... | |
uint16_t | parseUint16 () |
Parse value from current position in the file. More... | |
uint8_t | parseUint8 () |
Parse value from current position in the file. More... | |
float | parseFloat () |
Parse value from current position in the file. More... | |
bool | parseBool () |
Parse value from current position in the file. More... | |
ColorRGBA | parseColorRGBA () |
Parse value from current position in the file. More... | |
Vector2 | parseVector2 () |
Parse value from current position in the file. More... | |
Vector3 | parseVector3 () |
Parse value from current position in the file. More... | |
Vector4 | parseVector4 () |
Parse value from current position in the file. More... | |
Matrix3x3 | parseMatrix3x3 () |
Parse value from current position in the file. More... | |
Matrix4x4 | parseMatrix4x4 () |
Parse value from current position in the file. More... | |
string_view | parseNullTerminatedString () |
Parse value from current position in the file. More... | |
string_view | parseSizedString () |
Parse value from current position in the file. More... | |
ConstByteSpan | parseData (size_t size) |
Parse value from current position in the file. More... | |
ConstByteSpan | parseSizedData () |
Parse value from current position in the file. More... | |
SRTValue2D | parseSRT2D () |
Parse value from current position in the file. More... | |
kanzi::SRTValue3D | parseSRT3D () |
Parse value from current position in the file. More... | |
void | loadProperties (Object &object) |
Load properties from current location in the file and store them in an object. More... | |
void | loadProperties (PropertyContainer &properties, bool resolveResources) |
Load properties from current location in the file and store them in a property container. More... | |
void | loadProperties (PropertyContainer &properties, BindingContainer &referenceBindings, bool resolveResources) |
Load properties from current location in the file and store them in a property container. More... | |
Variant | loadVariantValue (PropertyDataType dataType, bool resolveResources) |
Load variant value from current location in the file. More... | |
Variant | loadVariant (bool resolveResources) |
Load variant from current location in the file. More... | |
const Metaclass * | loadMetaclass () |
Load metaclass from current location in the file. More... | |
AbstractPropertyType | loadPropertyType () |
Load property type from current location in the file. More... | |
string_view | loadString () |
Load string from current location in the file. More... | |
ObjectSharedPtr | loadObject () |
Load object from current location in the file. More... | |
void | skip (size_t sizeBytes) |
Skip bytes from current location in the file. More... | |
void | alignToOffset (ptrdiff_t alignBytes) |
Skip to next alignment of given bytes, relative to the beginning of the parsed data. More... | |
const byte * | getData () const |
Returns memory data. More... | |
const byte * | getCurrentData () const |
Returns memory data. More... | |
uint64_t | getSize () const |
Returns size of the file. More... | |
Parser over KZB file structure.
Used to parse binary data from file into raw values and engine constructs. As opposed to #KzbFile, KzbMemoryParser simply reads and parses values.
typedef vector<pair<AbstractPropertyType, Variant> > kanzi::KzbMemoryParser::PropertyContainer |
typedef vector<BindingSharedPtr> kanzi::KzbMemoryParser::BindingContainer |
|
inlineexplicit |
Constructor.
kzbFile | KZB file construct holding file information. |
data | Data block. |
data | Data size. |
|
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.
void kanzi::KzbMemoryParser::loadProperties | ( | Object & | object | ) |
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. |
Variant kanzi::KzbMemoryParser::loadVariant | ( | bool | resolveResources | ) |
Load variant from current location in the file.
resolveResources | True to resolve resource immediately. |
const Metaclass* kanzi::KzbMemoryParser::loadMetaclass | ( | ) |
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::loadString | ( | ) |
Load string from current location in the file.
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. |
|
inline |
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. |
|
inline |
Returns memory data.
|
inline |
Returns memory data.
|
inline |
Returns size of the file.