Kzb file loader. More...
#include <kanzi/core.ui/kzb/kzb_file.hpp>
Public Types | |
typedef vector< pair< AbstractPropertyType, Variant > > | PropertyContainer |
Container type for property values. | |
typedef uint32_t | SizeType |
Type specifying maximum size of files. Currently at 4Gb. | |
Public Member Functions | |
vector< string > | collectFileNames () const |
Collects all file names in a kzb file. | |
void | collectResourceUrls (ResourceManager::UrlContainer &urls) const |
Collects resource URLs in for a kzb file. | |
ColorWorkflow | getColorWorkflow () const |
Gets the color workflow The Color workflow that is used to generate a kzb file. | |
Domain * | getDomain () const |
ResourceManager::LoadTaskSharedPtr | getLoadTask (string_view path) |
Gets load task for given path. | |
const Metaclass * | getMetaclass (size_t index) const |
Gets metaclass by index. | |
string | getProjectName () const |
Gets project name. | |
AbstractPropertyType | getPropertyType (size_t index) const |
Gets property type by index. | |
string_view | getString (size_t index) const |
Gets string from string dictionary by index. | |
KzbFile (Domain *domain, unique_ptr< File > file) | |
Constructor. | |
ResourceSharedPtr | loadResource (string_view path) |
Load a resource identified by path. | |
ReadOnlyMemoryFilePtr | open (string_view path) |
Open a file by path. | |
ReadOnlyMemoryFilePtr | tryOpen (string_view path) |
Tries to open file by path. | |
~KzbFile () | |
Static Public Attributes | |
static const uint16_t | KzbFormatVersionMajor |
The version number for the current kzb format. | |
static const uint16_t | KzbFormatVersionMinor |
Kzb file loader.
Stores all kzb information. This includes dictionaries for strings, files, property types, metaclasses. Resource manager refers to the KzbFile dictionaries when loading resources. Internally uses KzbMemoryParser to parse the values from files.
typedef vector<pair<AbstractPropertyType, Variant> > kanzi::KzbFile::PropertyContainer |
Container type for property values.
Type specifying maximum size of files. Currently at 4Gb.
Constructor.
domain | The UI domain. |
file | File to read from. |
kanzi::KzbFile::~KzbFile | ( | ) |
ReadOnlyMemoryFilePtr kanzi::KzbFile::open | ( | string_view | path | ) |
Open a file by path.
Throws an error if file is not found.
path | to open. |
ReadOnlyMemoryFilePtr kanzi::KzbFile::tryOpen | ( | string_view | path | ) |
Tries to open file by path.
Silently returns an empty unique pointer if file is not found.
path | Path to open. |
ResourceSharedPtr kanzi::KzbFile::loadResource | ( | string_view | path | ) |
ResourceManager::LoadTaskSharedPtr kanzi::KzbFile::getLoadTask | ( | string_view | path | ) |
Gets load task for given path.
path | Path to load. |
Domain * kanzi::KzbFile::getDomain | ( | ) | const |
AbstractPropertyType kanzi::KzbFile::getPropertyType | ( | size_t | index | ) | const |
Gets property type by index.
index | Index of property type. |
string_view kanzi::KzbFile::getString | ( | size_t | index | ) | const |
Gets string from string dictionary by index.
index | Index of string. |
string kanzi::KzbFile::getProjectName | ( | ) | const |
Gets project name.
Project name is the base filename part of the URL identifying a kzb file. This corresponds to what is called a 'hostname' in URLs. Kzb files loaded are identified by this name. Multiple kzb files can correspond to the same project name in the ResourceManager.
ColorWorkflow kanzi::KzbFile::getColorWorkflow | ( | ) | const |
Gets the color workflow The Color workflow that is used to generate a kzb file.
void kanzi::KzbFile::collectResourceUrls | ( | ResourceManager::UrlContainer & | urls | ) | const |
Collects resource URLs in for a kzb file.
urls | List to store URLs to. |
vector< string > kanzi::KzbFile::collectFileNames | ( | ) | const |
Collects all file names in a kzb file.
The version number for the current kzb format.
Increased when the format changes. Major versions represent mainline (master branch) changes. Minor versions represent changes done on a specific branch. Version history: