Kanzi  3.9.7
Kanzi Engine API
kanzi::KzbFile Class Reference

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...
 
DomaingetDomain () const
 
ResourceManager::LoadTaskSharedPtr getLoadTask (string_view path)
 Gets load task for given path. More...
 
const MetaclassgetMetaclass (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...
 
 ~KzbFile ()
 

Static Public Attributes

static const uint16_t KzbFormatVersionMajor
 The version number for the current kzb format. More...
 
static const uint16_t KzbFormatVersionMinor
 

Detailed Description

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.

Member Typedef Documentation

Container type for property values.

typedef uint32_t kanzi::KzbFile::SizeType

Type specifying maximum size of files. Currently at 4Gb.

Constructor & Destructor Documentation

kanzi::KzbFile::KzbFile ( Domain domain,
unique_ptr< File file 
)
explicit

Constructor.

Parameters
domainThe UI domain.
fileFile to read from.
kanzi::KzbFile::~KzbFile ( )

Member Function Documentation

ReadOnlyMemoryFilePtr kanzi::KzbFile::open ( string_view  path)

Open a file by path.

Throws an error if file is not found.

Parameters
pathto open.
Returns
File opened.
ReadOnlyMemoryFilePtr kanzi::KzbFile::tryOpen ( string_view  path)

Tries to open file by path.

Silently returns an empty unique pointer if file is not found.

Parameters
pathPath to open.
Returns
File opened.
ResourceSharedPtr kanzi::KzbFile::loadResource ( string_view  path)

Load a resource identified by path.

Parameters
pathPath to resource.
Returns
Resource loaded.
ResourceManager::LoadTaskSharedPtr kanzi::KzbFile::getLoadTask ( string_view  path)

Gets load task for given path.

Parameters
pathPath to load.
Returns
Load task created.
Domain* kanzi::KzbFile::getDomain ( ) const
const Metaclass* kanzi::KzbFile::getMetaclass ( size_t  index) const

Gets metaclass by index.

Parameters
indexIndex of metaclass.
Returns
Metaclass.
AbstractPropertyType kanzi::KzbFile::getPropertyType ( size_t  index) const

Gets property type by index.

Parameters
indexIndex of property type.
Returns
Property type.
string_view kanzi::KzbFile::getString ( size_t  index) const

Gets string from string dictionary by index.

Parameters
indexIndex of string.
Returns
View into 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.

Parameters
urlsList to store URLs to.
vector<string> kanzi::KzbFile::collectFileNames ( ) const

Collects all file names in a kzb file.

Returns
Vector of file names.

Member Data Documentation

const uint16_t kanzi::KzbFile::KzbFormatVersionMajor
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:

  • 0.0. The initial version. Used in Kanzi 3.6.1.
  • 1.0. Introduced new versioning format that removes the Kanzi tool version from the kzb. Used in Kanzi 3.6.2.
  • 2.0. Added multisample samples to render target textures. Cubemap images are flipped already in Kanzi Studio.
  • 3.0. Added simple render target mode toggle to render target textures. Used in Kanzi 3.6.4.
  • 4.0. Quaternion field order and Euler to quaternion algorithm changed.
  • 5.0. Added enum to bindings specifying whether they are value sources or property modifiers.
  • 6.0. Added To Source bindings. Changed order of fields in binding data to support To Source bindings.
  • 7.0. Added render pass prefabs and render pass templates.
  • 8.0. Reordered the MessageRouting enum, removed everything related to MessageRoutingDirect from Kanzi Engine.
  • 9.0. Storing resource dictionary text resource strings locally.
  • 10.0 Support for deferred loading of state node component templates.
  • 11.0. Font file converted to FontFile. Font Family resource introduced.
  • 12.0. Added bindings and changed uniform representation in material types. Changed precedence to target type in bindings, added render value binding target.
  • 13.0. Added range binding processors.
  • 14.0. Added color workflow.
  • 15.0. Added Data Triggers.
  • 16.0. Added data type field for shader uniforms.
  • 17.0. Added binding texture access functions.
  • 18.0. Consolidated Face To Camera properties.
  • 19.0. Added parametric primitives.
  • 20.0. Added stride to exported vertex data with necessary padding.
  • 21.0. Remove LightEnabled property.
  • 22.0. Added arguments to Write Log Action.
  • 23.0. Added geometry, tessellation control, and tessellation evaluation shaders.
  • 24.0. Added optional data texture to Morph.
  • 25.0. Moved setting of Screen::HostNameProperty to Kanzi Studio.
const uint16_t kanzi::KzbFile::KzbFormatVersionMinor
static

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