Binary reader utilities. More...
#include <system/kzs_types.h>
#include <system/debug/kzs_error.h>
#include <kanzi/platform/memory.hpp>
#include <kanzi/platform/string.hpp>
#include <kanzi/platform/vector.hpp>
Namespaces | |
kanzi | |
Enumerations | |
enum | KzuPropertyContainerReferenceType { KZU_PROPERTY_CONTAINER_REFERENCE_OBJECT_NODE, KZU_PROPERTY_CONTAINER_REFERENCE_PROJECT_ITEM } |
Type of property container reference. More... | |
Functions | |
KANZI_API kzsException | kzuBinaryReadString (struct KzcInputStream *inputStream, kzMutableString *out_string) |
Reads a kzb string from the given input stream. More... | |
KANZI_API kzsException | kzuBinaryReadString (struct KzcInputStream *inputStream, kanzi::string &out_string) |
Reads a string from the given input stream. More... | |
KANZI_API kanzi::string | kzuBinaryReadString (KzcInputStream *inputStream) |
KANZI_API kzsException | kzuBinaryReadBoolean (struct KzcInputStream *inputStream, kzBool *out_value) |
Reads a boolean from kzb format including the padding. More... | |
KANZI_API kzsError | kzuBinaryGetResourceURL (const struct KzuBinaryDirectory *directory, kzString resourcePath, kzMutableString *out_resourceURL) |
Gets a resource URL from the given binary directory and a resource path in it. More... | |
KANZI_API kzsException | kzuBinaryReadResourceReference (struct KzcInputStream *inputStream, const struct KzuBinaryFileInfo *fileInfo, kzString *out_resourceURL) |
Reads a resource reference from the given input stream opened from the given file info. More... | |
KANZI_API kzsError | kzuBinaryGetResourceURLFromFile (const struct KzuBinaryFileInfo *fileInfo, kzMutableString *out_resourceURL) |
Gets a resource URL corresponding the given binary file info. More... | |
KANZI_API kzsError | kzuBinaryReadProperty (struct KzcInputStream *inputStream, const struct KzuBinaryFileInfo *file, const void *object, struct KzuPropertyManager *propertyManager, kanzi::ResourceManager *resourceManager, struct KzuPropertyType **out_propertyType) |
Loads property from binary. More... | |
KANZI_API kzsError | kzuBinaryReadProperty (struct KzcInputStream *inputStream, const struct KzuBinaryFileInfo *file, const void *object, struct KzuPropertyManager *propertyManager, kanzi::ResourceManager *resourceManager, struct KzuPropertyType **out_propertyType, kanzi::vector< kanzi::BindingSharedPtr > &bindings) |
Loads property from binary with converting content properties to bindings. More... | |
KANZI_API kzsError | kzuBinaryReadPropertySafe (struct KzcInputStream *inputStream, const struct KzuBinaryFileInfo *file, const void *object, struct KzuPropertyManager *propertyManager, kanzi::ResourceManager *resourceManager, struct KzuPropertyType **out_propertyType) |
Loads property from binary in a thread-safe manner. More... | |
KANZI_API kzsError | kzuBinaryReadVariant (struct KzcInputStream *inputStream, const struct KzuBinaryFileInfo *file, struct kanzi::Variant *variant, const struct KzuPropertyManager *propertyManager, kanzi::ResourceManager *resourceManager, KzuPropertyType **out_propertyType) |
Read a variant value. More... | |
KANZI_API kzsError | kzuBinaryReadProperties (struct KzcInputStream *inputStream, const struct KzuBinaryFileInfo *file, const void *object, struct KzuPropertyManager *propertyManager, kanzi::ResourceManager *resourceManager) |
Loads a list of properties from binary. More... | |
KANZI_API kzsError | kzuBinaryReadProperties (struct KzcInputStream *inputStream, const struct KzuBinaryFileInfo *file, const void *object, struct KzuPropertyManager *propertyManager, kanzi::ResourceManager *resourceManager, kanzi::vector< kanzi::BindingSharedPtr > &bindings) |
Loads a list of properties from binary with converting content properties to bindings. More... | |
KANZI_API kzsError | kzuBinaryReadPropertiesSafe (struct KzcInputStream *inputStream, const struct KzuBinaryFileInfo *file, const void *object, struct KzuPropertyManager *propertyManager, kanzi::ResourceManager *resourceManager) |
Loads a list of properties from binary without acquiring the resources of pointer properties. More... | |
KANZI_API kzsException | kzuBinaryReadTextFile (const struct KzcMemoryManager *memoryManager, const struct KzuBinaryFileInfo *file, kzMutableString *out_text) |
Reads the given file as a text file and returns the content. More... | |
KANZI_API kzsError | kzuBinaryLoadMetaData (struct KzuBinaryDirectory *directory) |
Loads binary directory metadata (property types, message types. More... | |
KANZI_API kzsException | kzuBinaryLoadMessageType (const struct KzuBinaryDirectory *directory, kzString path) |
Loads message type from binary. More... | |
KANZI_API kzsException | kzuBinaryCreatePropertyType (struct KzuBinaryDirectory *directory, kzString path) |
Loads property type from binary. More... | |
Binary reader utilities.
Copyright 2008-2020 by Rightware. All rights reserved.
KANZI_API kzsException kzuBinaryReadString | ( | struct KzcInputStream * | inputStream, |
kzMutableString * | out_string | ||
) |
Reads a kzb string from the given input stream.
A new string object is allocated and must be freed by the caller.
KANZI_API kzsException kzuBinaryReadString | ( | struct KzcInputStream * | inputStream, |
kanzi::string & | out_string | ||
) |
Reads a string from the given input stream.
KANZI_API kanzi::string kzuBinaryReadString | ( | KzcInputStream * | inputStream | ) |
KANZI_API kzsException kzuBinaryReadBoolean | ( | struct KzcInputStream * | inputStream, |
kzBool * | out_value | ||
) |
Reads a boolean from kzb format including the padding.
KANZI_API kzsError kzuBinaryGetResourceURL | ( | const struct KzuBinaryDirectory * | directory, |
kzString | resourcePath, | ||
kzMutableString * | out_resourceURL | ||
) |
Gets a resource URL from the given binary directory and a resource path in it.
The returned resource URL must be freed with kzcStringDelete().
KANZI_API kzsException kzuBinaryReadResourceReference | ( | struct KzcInputStream * | inputStream, |
const struct KzuBinaryFileInfo * | fileInfo, | ||
kzString * | out_resourceURL | ||
) |
Reads a resource reference from the given input stream opened from the given file info.
Returns the URL corresponding the reference.
KANZI_API kzsError kzuBinaryGetResourceURLFromFile | ( | const struct KzuBinaryFileInfo * | fileInfo, |
kzMutableString * | out_resourceURL | ||
) |
Gets a resource URL corresponding the given binary file info.
The returned resource URL must be freed with kzcStringDelete().
KANZI_API kzsError kzuBinaryReadProperty | ( | struct KzcInputStream * | inputStream, |
const struct KzuBinaryFileInfo * | file, | ||
const void * | object, | ||
struct KzuPropertyManager * | propertyManager, | ||
kanzi::ResourceManager * | resourceManager, | ||
struct KzuPropertyType ** | out_propertyType | ||
) |
Loads property from binary.
KANZI_API kzsError kzuBinaryReadProperty | ( | struct KzcInputStream * | inputStream, |
const struct KzuBinaryFileInfo * | file, | ||
const void * | object, | ||
struct KzuPropertyManager * | propertyManager, | ||
kanzi::ResourceManager * | resourceManager, | ||
struct KzuPropertyType ** | out_propertyType, | ||
kanzi::vector< kanzi::BindingSharedPtr > & | bindings | ||
) |
Loads property from binary with converting content properties to bindings.
KANZI_API kzsError kzuBinaryReadPropertySafe | ( | struct KzcInputStream * | inputStream, |
const struct KzuBinaryFileInfo * | file, | ||
const void * | object, | ||
struct KzuPropertyManager * | propertyManager, | ||
kanzi::ResourceManager * | resourceManager, | ||
struct KzuPropertyType ** | out_propertyType | ||
) |
Loads property from binary in a thread-safe manner.
If the property references resources, this function will only store the URL instead of acquiring the resource.
KANZI_API kzsError kzuBinaryReadVariant | ( | struct KzcInputStream * | inputStream, |
const struct KzuBinaryFileInfo * | file, | ||
struct kanzi::Variant * | variant, | ||
const struct KzuPropertyManager * | propertyManager, | ||
kanzi::ResourceManager * | resourceManager, | ||
KzuPropertyType ** | out_propertyType | ||
) |
Read a variant value.
KANZI_API kzsError kzuBinaryReadProperties | ( | struct KzcInputStream * | inputStream, |
const struct KzuBinaryFileInfo * | file, | ||
const void * | object, | ||
struct KzuPropertyManager * | propertyManager, | ||
kanzi::ResourceManager * | resourceManager | ||
) |
Loads a list of properties from binary.
KANZI_API kzsError kzuBinaryReadProperties | ( | struct KzcInputStream * | inputStream, |
const struct KzuBinaryFileInfo * | file, | ||
const void * | object, | ||
struct KzuPropertyManager * | propertyManager, | ||
kanzi::ResourceManager * | resourceManager, | ||
kanzi::vector< kanzi::BindingSharedPtr > & | bindings | ||
) |
Loads a list of properties from binary with converting content properties to bindings.
KANZI_API kzsError kzuBinaryReadPropertiesSafe | ( | struct KzcInputStream * | inputStream, |
const struct KzuBinaryFileInfo * | file, | ||
const void * | object, | ||
struct KzuPropertyManager * | propertyManager, | ||
kanzi::ResourceManager * | resourceManager | ||
) |
Loads a list of properties from binary without acquiring the resources of pointer properties.
A KZ_NULL or a list of property group URLs (kzMutableString) are stored in out_propertyGroupURLs.
KANZI_API kzsException kzuBinaryReadTextFile | ( | const struct KzcMemoryManager * | memoryManager, |
const struct KzuBinaryFileInfo * | file, | ||
kzMutableString * | out_text | ||
) |
Reads the given file as a text file and returns the content.
KANZI_API kzsError kzuBinaryLoadMetaData | ( | struct KzuBinaryDirectory * | directory | ) |
Loads binary directory metadata (property types, message types.
KANZI_API kzsException kzuBinaryLoadMessageType | ( | const struct KzuBinaryDirectory * | directory, |
kzString | path | ||
) |
Loads message type from binary.
KANZI_API kzsException kzuBinaryCreatePropertyType | ( | struct KzuBinaryDirectory * | directory, |
kzString | path | ||
) |
Loads property type from binary.