C

QSafeStateLoader Class

class SafeRenderer::QSafeStateLoader

The QSafeStateLoader class loads the state definition file. More...

Header: #include <QSafeStateLoader>
Since: QtSafeRenderer 1.2
Inherited By:

SafeRenderer::QSafeStateFileReader and SafeRenderer::QSafeStateResourceReader

This class was introduced in QtSafeRenderer 1.2.

Public Types

enum StateFileReaderException { OutOfCache, DataCorrupted, InvalidData, UnsupportedAnimationType }

Public Functions

QSafeStateLoader()
virtual ~QSafeStateLoader()
virtual void loadFile(const SafeRenderer::QSafeFileInfo &fileInfo, const SafeRenderer::quint32 crc, SafeRenderer::QSafeStateTransition &statesArg) const = 0

Static Public Members

void loadStates(const SafeRenderer::QSafeByteArray &stateAsset, SafeRenderer::QSafeStateTransition &stateContainer)

Detailed Description

The QSafeStateLoader class loads the state definition file. QSafeStateLoader is an abstract class. Derived classes must implement the QSafeStateLoader::loadFile method.

Member Type Documentation

enum QSafeStateLoader::StateFileReaderException

This enum describes the safe state loader exceptions.

ConstantValueDescription
SafeRenderer::QSafeStateLoader::OutOfCache0The index is out of cache.
SafeRenderer::QSafeStateLoader::DataCorrupted1Data is corrupted.
SafeRenderer::QSafeStateLoader::InvalidData2Data is invalid.
SafeRenderer::QSafeStateLoader::UnsupportedAnimationType3The animation type is not supported.

Member Function Documentation

QSafeStateLoader::QSafeStateLoader()

Constructs a QSafeStateLoader object.

[virtual] QSafeStateLoader::~QSafeStateLoader()

Destructs a QSafeStateLoader object.

[pure virtual] void QSafeStateLoader::loadFile(const SafeRenderer::QSafeFileInfo &fileInfo, const SafeRenderer::quint32 crc, SafeRenderer::QSafeStateTransition &statesArg) const

Loads states definitions from the fileInfo to the statesArg. The value of crc must match with the CRC of the file. This function must be implemented in the derived class.

[static] void QSafeStateLoader::loadStates(const SafeRenderer::QSafeByteArray &stateAsset, SafeRenderer::QSafeStateTransition &stateContainer)

Loads states definitions from stateAsset to the stateContainer.

In case of a failure, one of the following exceptions will be thrown:

ConstantDescription
SafeRenderer::QSafeByteArray::ByteArrayReaderExceptionThe size of the data in the file is inconsistent.
SafeRenderer::QSafeStateLoader::StateFileReaderException::InvalidDataThe animation data contains unknown data types.
SafeRenderer::QSafeStateLoader::StateFileReaderException::UnsupportedAnimationTypeThe type of the animation is not supported.
SafeRenderer::QSafeStates::IndexOutOfBoundsAmount of states is greater than Constraints::MAX_NUM_OF_STATES.
SafeRenderer::QSafeAnimations::IndexOutOfBoundsAmount of transitions is greater than Constraints::MAX_NUM_OF_ANIMATIONS_PER_ITEM.

Available under certain Qt licenses.
Find out more.