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. More... | |
typedef uint32_t | SizeType |
Type specifying maximum size of files. Currently at 4Gb. More... | |
Public Member Functions | |
vector< string > | collectFileNames () const |
Collects all file names in a kzb file. More... | |
void | collectResourceUrls (ResourceManager::UrlContainer &urls) const |
Collects resource URLs in for a kzb file. More... | |
ColorWorkflow | getColorWorkflow () const |
Gets the color workflow The Color workflow that is used to generate a kzb file. More... | |
Domain * | getDomain () const |
ResourceManager::LoadTaskSharedPtr | getLoadTask (string_view path) |
Gets load task for given path. More... | |
const Metaclass * | getMetaclass (size_t index) const |
Gets metaclass by index. More... | |
string | getProjectName () const |
Gets project name. More... | |
AbstractPropertyType | getPropertyType (size_t index) const |
Gets property type by index. More... | |
string_view | getString (size_t index) const |
Gets string from string dictionary by index. More... | |
KzbFile (Domain *domain, unique_ptr< File > file) | |
Constructor. More... | |
ResourceSharedPtr | loadResource (string_view path) |
Load a resource identified by path. More... | |
ReadOnlyMemoryFilePtr | open (string_view path) |
Open a file by path. More... | |
ReadOnlyMemoryFilePtr | tryOpen (string_view path) |
Tries to open file by path. More... | |
Static Public Attributes | |
static const uint16_t | KzbFormatVersionMajor |
The version number for the current kzb format. More... | |
static const uint16_t | KzbFormatVersionMinor |
Friends | |
class | KzbMemoryParser |
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.
typedef uint32_t kanzi::KzbFile::SizeType |
Type specifying maximum size of files. Currently at 4Gb.
Constructor.
domain | The UI domain. |
file | File to read from. |
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 |
const Metaclass* kanzi::KzbFile::getMetaclass | ( | size_t | index | ) | 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.
|
friend |
|
static |
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:
|
static |