C

QSafeStateFileReader Class

class SafeRenderer::QSafeStateFileReader

The QSafeStateFileReader class loads the state definition from the file. More...

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

Public Functions

Reimplemented Public Functions

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

Detailed Description

The QSafeStateFileReader class loads the state definition from the file system. The QSafeStateFileReader is derived from the QSafeStateLoader class.

Member Function Documentation

QSafeStateFileReader::QSafeStateFileReader()

Constructs a QSafeStateFileReader object.

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

Reimplements: 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 the crcArg must match with the CRC of the file.

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

ExceptionIdDescription
SafeRenderer::QSafeStateExceptionSafeRenderer::QSafeStateException::SafeStateException::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::QSafeStateExceptionSafeRenderer::QSafeStateException::SafeStateException::DataCorruptedCRC value of the file does not match with \a crcArg.
SafeRenderer::QSafeStateExceptionSafeRenderer::QSafeStateException::SafeStateException::InvalidDataThe size of the data in the file is inconsistent.
SafeRenderer::QSafeStateExceptionSafeRenderer::QSafeStateException::SafeStateException::UnsupportedAnimationTypeThe type of the animation is not supported.
SafeRenderer::QSafeStateExceptionSafeRenderer::QSafeStateException::SafeStateException::IndexOutOfBoundsAmount of states is greater than Constraints::MAX_NUM_OF_STATES.
SafeRenderer::QSafeAnimationExceptionSafeRenderer::QSafeAnimationException::AnimationsException::IndexOutOfBoundsAmount of transitions is greater than Constraints::MAX_NUM_OF_ANIMATIONS_PER_ITEM.

Available under certain Qt licenses.
Find out more.