kanzi::ObjectLoader Class Reference

ObjectLoader loads objects from KZB. More...

#include <kanzi/core.ui/kzb/object_loader.hpp>

Public Types

typedef function< ObjectSharedPtr(Domain *, string_view, KzcInputStream *, const KzuBinaryFileInfo *)> LoadFunctionOld
 
typedef function< ObjectSharedPtr(Domain *, string_view, KzbFile &, KzbMemoryParser &)> LoadFunction
 

Public Member Functions

 ObjectLoader ()
 Constructor. More...
 
void registerObjectLoadFunctions (const Metaclass *metaclass, const LoadFunctionOld &loadFunctionOld, const LoadFunction &loadFunction)
 Registers object load functions by metaclass. More...
 
ObjectSharedPtr loadObject (Domain *domain, const Metaclass *metaclass, string_view name, KzcInputStream *inputStream, const KzuBinaryFileInfo *file)
 Loads object by metaclass from old-style KZB. More...
 
ObjectSharedPtr loadObject (Domain *domain, const Metaclass *metaclass, string_view name, KzbFile &kzbFile, KzbMemoryParser &parser)
 Loads object by metaclass from KZB. More...
 
bool isLoadingEnabled (const Metaclass *metaclass) const
 Indicates whether loading for objects with specified metaclass is possible via this object loader. More...
 

Detailed Description

ObjectLoader loads objects from KZB.

Member Typedef Documentation

Constructor & Destructor Documentation

kanzi::ObjectLoader::ObjectLoader ( )
explicit

Constructor.

Member Function Documentation

void kanzi::ObjectLoader::registerObjectLoadFunctions ( const Metaclass metaclass,
const LoadFunctionOld loadFunctionOld,
const LoadFunction loadFunction 
)

Registers object load functions by metaclass.

Functions might return objects whose type is different from the type specified by metaclass.

Parameters
metaclassMetaclass of object to load.
loadFunctionOldFunction to load object from old-format KZB.
loadFunctionFunction to load object from KZB.
ObjectSharedPtr kanzi::ObjectLoader::loadObject ( Domain domain,
const Metaclass metaclass,
string_view  name,
KzcInputStream inputStream,
const KzuBinaryFileInfo file 
)

Loads object by metaclass from old-style KZB.

Returned object might have different type than type specified by metaclass.

Parameters
domainDomain to use when loading object.
metaclassMetaclass of object to load.
nameName of object to load.
inputStreamStream to load object from.
fileFile to load object from.
Returns
Loaded object.
ObjectSharedPtr kanzi::ObjectLoader::loadObject ( Domain domain,
const Metaclass metaclass,
string_view  name,
KzbFile kzbFile,
KzbMemoryParser parser 
)

Loads object by metaclass from KZB.

Returned object might have different type than type specified by metaclass.

Parameters
domainDomain to use when loading object.
metaclassMetaclass of object to load.
nameName of object to load.
kzbFileKZB to load object from.
parserParser to parse object data from.
Returns
Loaded object.
bool kanzi::ObjectLoader::isLoadingEnabled ( const Metaclass metaclass) const

Indicates whether loading for objects with specified metaclass is possible via this object loader.

Parameters
metaclassObject metaclass.
Returns
true if loading is possible, false otherwise.

The documentation for this class was generated from the following file: