C

QSafeStateResourceReader Class

class SafeRenderer::QSafeStateResourceReader

The QSafeStateResourceReader class loads the state definition from the resource data. More...

Header: #include <QSafeStateResourceReader>
Since: QtSafeRenderer 1.2
Inherits: SafeRenderer::QSafeStateLoader

This class was introduced in QtSafeRenderer 1.2.

Public Functions

QSafeStateResourceReader(SafeRenderer::QSafeBitmapReader &bitmapReader)

Reimplemented Public Functions

virtual void loadFile(const SafeRenderer::QSafeFileInfo &fileInfo, const SafeRenderer::quint32 crc, SafeRenderer::QSafeStateTransition &statesArg) override

Detailed Description

The QSafeStateResourceReader class loads the state definition from the resource data. The QSafeStateResourceReader is derived from the QSafeStateLoader class.

Member Function Documentation

QSafeStateResourceReader::QSafeStateResourceReader(SafeRenderer::QSafeBitmapReader &bitmapReader)

Constructs a QSafeStateResourceReader object. Reference to the QSafeBitmapResourceReader instance is given by bitmapReader

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

Reimplements: QSafeStateLoader::loadFile(const SafeRenderer::QSafeFileInfo &fileInfo, const SafeRenderer::quint32 crc, SafeRenderer::QSafeStateTransition &statesArg).

Loades states definitions from the resource data fileInfo to the statesArg. The value of the crc must match with the CRC of the file.

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

ConstantDescription
SafeRenderer::QSafeStateLoader::StateFileReaderException::OutOfCacheThe file exceeds the maximum size of the state file. The maximum file size is calculated based on the values defined in the qsafeconstraints.h. The maximum size of the file can be increased by changing the variables SafeRenderer::Constraints::MAX_NUM_OF_STATES and SafeRenderer::Constraints::MAX_NUM_OF_ANIMATIONS_PER_ITEM.
SafeRenderer::QSafeStateLoader::StateFileReaderException::DataCorruptedCRC value of the file does not match with crc or fileInfo is not defined in the resource.
SafeRenderer::QSafeStateLoader::StateFileReaderException::InvalidDataThe size of the data in the file is inconsistent.
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.