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

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

◆ PropertyContainer

Container type for property values.

◆ SizeType

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

Constructor & Destructor Documentation

◆ KzbFile()

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

Constructor.

Parameters
domainThe UI domain.
fileFile to read from.

◆ ~KzbFile()

kanzi::KzbFile::~KzbFile ( )

Member Function Documentation

◆ open()

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.

◆ tryOpen()

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.

◆ loadResource()

ResourceSharedPtr kanzi::KzbFile::loadResource ( string_view path)

Load a resource identified by path.

Parameters
pathPath to resource.
Returns
Resource loaded.

◆ getLoadTask()

ResourceManager::LoadTaskSharedPtr kanzi::KzbFile::getLoadTask ( string_view path)

Gets load task for given path.

Parameters
pathPath to load.
Returns
Load task created.

◆ getDomain()

Domain * kanzi::KzbFile::getDomain ( ) const

◆ getMetaclass()

const Metaclass * kanzi::KzbFile::getMetaclass ( size_t index) const

Gets metaclass by index.

Parameters
indexIndex of metaclass.
Returns
Metaclass.

◆ getPropertyType()

AbstractPropertyType kanzi::KzbFile::getPropertyType ( size_t index) const

Gets property type by index.

Parameters
indexIndex of property type.
Returns
Property type.

◆ getString()

string_view kanzi::KzbFile::getString ( size_t index) const

Gets string from string dictionary by index.

Parameters
indexIndex of string.
Returns
View into string.

◆ getProjectName()

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.

◆ getColorWorkflow()

ColorWorkflow kanzi::KzbFile::getColorWorkflow ( ) const

Gets the color workflow The Color workflow that is used to generate a kzb file.

◆ collectResourceUrls()

void kanzi::KzbFile::collectResourceUrls ( ResourceManager::UrlContainer & urls) const

Collects resource URLs in for a kzb file.

Parameters
urlsList to store URLs to.

◆ collectFileNames()

vector< string > kanzi::KzbFile::collectFileNames ( ) const

Collects all file names in a kzb file.

Returns
Vector of file names.

Member Data Documentation

◆ KzbFormatVersionMajor

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.
  • 26.0. Added bindings and child effects to Node Effect 2D prefabs.
  • 27.0. Added Cubemap Render Target Texture.
  • 27.1. Added inside out parameters for box and sphere primitives.

◆ KzbFormatVersionMinor

const uint16_t kanzi::KzbFile::KzbFormatVersionMinor
static

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