Castor3D 0.16.0
Multiplatform 3D engine
|
Binary data chunk reader base class. More...
#include <BinaryParser.hpp>
Public Member Functions | |
BinaryParserBase ()=default | |
BinaryParserBase (BinaryParserBase const &)=default | |
BinaryParserBase (BinaryParserBase &&) noexcept=default | |
BinaryParserBase & | operator= (BinaryParserBase const &)=default |
BinaryParserBase & | operator= (BinaryParserBase &&) noexcept=default |
virtual | ~BinaryParserBase () noexcept=default |
template<typename T > | |
BinaryParser< T > | createBinaryParser () |
Creates a binary parser. | |
bool | parse (TParsed &obj, castor::BinaryFile &file) |
From file reader function. | |
bool | parse (TParsed &obj, BinaryChunk &chunk) |
From chunk reader function. | |
Protected Member Functions | |
bool | doIsLittleEndian () const noexcept |
bool | doParseHeader (BinaryChunk &chunk) const |
Parses the header chunk. | |
template<typename T > | |
bool | doParseChunk (T *values, size_t count, BinaryChunk &chunk) const |
Retrieves a value array from a chunk. | |
template<typename T , size_t Count> | |
bool | doParseChunk (T(&values)[Count], BinaryChunk &chunk) const |
Retrieves a value array from a chunk. | |
template<typename T , size_t Count> | |
bool | doParseChunk (castor::Array< T, Count > &values, BinaryChunk &chunk) const |
Retrieves a value array from a chunk. | |
template<typename T > | |
bool | doParseChunk (castor::Vector< T > &values, BinaryChunk &chunk) const |
Retrieves a value array from a chunk. | |
template<typename T > | |
bool | doParseChunk (T &value, BinaryChunk &chunk) const |
Retrieves a value from a chunk. | |
bool | doGetSubChunk (BinaryChunk &chunk) |
Retrieves a subchunk. | |
void | checkError (bool result, castor::String const &text) const |
Protected Attributes | |
BinaryChunk * | m_chunk { nullptr } |
Version | m_fileVersion |
Static Protected Attributes | |
static C3D_API castor::String | Name |
Friends | |
template<typename T > | |
class | BinaryParserBase |
Binary data chunk reader base class.
|
default |
|
default |
|
defaultnoexcept |
|
virtualdefaultnoexcept |
|
inlineprotected |
References castor3d::log::error, and castor3d::BinaryParserBase< TParsed >::Name.
Referenced by castor3d::BinaryParserBase< TParsed >::doParseHeader(), castor3d::BinaryParserBase< TParsed >::parse(), and castor3d::BinaryParserBase< TParsed >::parse().
|
inline |
Creates a binary parser.
References castor3d::BinaryParserBase< TParsed >::m_fileVersion.
|
inlineprotected |
Retrieves a subchunk.
[out] | chunk | Receives the subchunk. |
false
if any error occured. References castor3d::BinaryChunk::checkAvailable(), CU_Require, castor3d::BinaryChunk::getSubChunk(), and castor3d::BinaryParserBase< TParsed >::m_chunk.
|
inlineprotectednoexcept |
References castor::isLittleEndian(), castor3d::isLittleEndian(), and castor3d::BinaryParserBase< TParsed >::m_chunk.
|
inlineprotected |
Retrieves a value array from a chunk.
[out] | values | Receives the parsed values |
[in] | chunk | The chunk containing the values |
false
if any error occured References castor3d::ChunkParser< T >::parse().
|
inlineprotected |
Retrieves a value array from a chunk.
[out] | values | Receives the parsed values |
[in] | chunk | The chunk containing the values |
false
if any error occured References castor3d::ChunkParser< T >::parse().
|
inlineprotected |
Retrieves a value from a chunk.
[out] | value | Receives the parsed value |
[in] | chunk | The chunk containing the value |
false
if any error occured References castor3d::ChunkParser< T >::parse().
|
inlineprotected |
Retrieves a value array from a chunk.
[out] | values | Receives the parsed values |
[out] | count | The values count |
[in] | chunk | The chunk containing the values |
false
if any error occured References castor3d::ChunkParser< T >::parse().
Referenced by castor3d::BinaryParserBase< TParsed >::doParseHeader().
|
inlineprotected |
Retrieves a value array from a chunk.
[out] | values | Receives the parsed values |
[in] | chunk | The chunk containing the values |
false
if any error occured References castor3d::ChunkParser< T >::parse().
|
inlineprotected |
Parses the header chunk.
[in,out] | chunk | The parent chunk. |
false
if any error occured. References castor3d::BinaryParserBase< TParsed >::checkError(), castor3d::CurrentCmshVersion, cuT, castor3d::BinaryParserBase< TParsed >::doParseChunk(), castor3d::eCmshHeader, castor3d::eCmshVersion, castor3d::eName, castor3d::BinaryChunk::endParse(), castor3d::getCmshMajor(), castor3d::getCmshMinor(), castor3d::getCmshRevision(), castor3d::BinaryChunk::getSubChunk(), castor3d::isLittleEndian(), castor3d::BinaryParserBase< TParsed >::m_fileVersion, and castor3d::log::warn.
Referenced by castor3d::BinaryParserBase< TParsed >::parse().
|
defaultnoexcept |
|
default |
|
inline |
From chunk reader function.
[out] | obj | The object to read |
[in] | chunk | The chunk |
false
if any error occured References castor3d::BinaryParserBase< TParsed >::checkError(), cuT, castor3d::BinaryChunk::endParse(), castor3d::BinaryChunk::getChunkType(), castor3d::BinaryParserBase< TParsed >::m_chunk, and castor3d::BinaryChunk::resetParse().
|
inline |
From file reader function.
[out] | obj | The object to read |
[in] | file | The file containing the chunk |
false
if any error occured References castor3d::BinaryParserBase< TParsed >::checkError(), cuT, castor3d::BinaryParserBase< TParsed >::doParseHeader(), castor3d::eCmshFile, castor3d::isLittleEndian(), castor3d::BinaryParserBase< TParsed >::parse(), and castor3d::BinaryChunk::read().
Referenced by castor3d::BinaryParserBase< TParsed >::parse().
|
protected |
The writer's chunk.
Referenced by castor3d::BinaryParserBase< TParsed >::doGetSubChunk(), castor3d::BinaryParserBase< TParsed >::doIsLittleEndian(), and castor3d::BinaryParserBase< TParsed >::parse().
|
mutableprotected |
The chunk version from the file.
Referenced by castor3d::BinaryParserBase< TParsed >::createBinaryParser(), and castor3d::BinaryParserBase< TParsed >::doParseHeader().
|
staticprotected |
Referenced by castor3d::BinaryParserBase< TParsed >::checkError().