Castor3D
..
|
Binary data chunk base class. More...
Public Member Functions | |
C3D_API | BinaryChunk () |
Constructor. More... | |
C3D_API | BinaryChunk (eCHUNK_TYPE p_type) |
Constructor. More... | |
C3D_API void | Finalise () |
Computes the final data buffer from each one added until this call. More... | |
C3D_API void | Add (uint8_t *p_data, uint32_t p_size) |
Adds data to the chunk. More... | |
C3D_API void | Get (uint8_t *p_data, uint32_t p_size) |
Retrieves data from the chunk. More... | |
C3D_API bool | CheckAvailable (uint32_t p_size=0) const |
Checks that the remaining place can hold the given size. More... | |
C3D_API uint32_t | GetRemaining () const |
Retrieves the remaining place. More... | |
C3D_API bool | GetSubChunk (BinaryChunk &p_subchunk) |
Retrieves a subchunk. More... | |
C3D_API bool | AddSubChunk (BinaryChunk const &p_subchunk) |
Writes a subchunk into a chunk. More... | |
C3D_API bool | Write (Castor::BinaryFile &p_file) |
To chunk writer function. More... | |
C3D_API bool | Read (Castor::BinaryFile &p_file) |
From file reader function. More... | |
uint8_t const * | GetRemainingData () const |
Retrieves the remaining data. More... | |
eCHUNK_TYPE | GetChunkType () const |
Retrieves the chunk type. More... | |
uint32_t | GetDataSize () const |
Retrieves the chunk data size. More... | |
uint8_t const * | GetData () const |
Retrieves the chunk data. More... | |
void | SetData (uint8_t const *p_data, uint32_t p_size) |
Sets the chunk's data. More... | |
void | EndParse () |
Retrieves the chunk data size. More... | |
Binary data chunk base class.
C3D_API Castor3D::BinaryChunk::BinaryChunk | ( | ) |
Constructor.
C3D_API Castor3D::BinaryChunk::BinaryChunk | ( | eCHUNK_TYPE | p_type | ) |
Constructor.
[in] | p_type | The chunk type |
C3D_API void Castor3D::BinaryChunk::Add | ( | uint8_t * | p_data, |
uint32_t | p_size | ||
) |
Adds data to the chunk.
[in] | p_data | The data buffer |
[in] | p_size | The buffer size |
C3D_API bool Castor3D::BinaryChunk::AddSubChunk | ( | BinaryChunk const & | p_subchunk | ) |
Writes a subchunk into a chunk.
[in] | p_subchunk | The subchunk |
false
if any error occured Referenced by Castor3D::ChunkFillerBase::operator()().
C3D_API bool Castor3D::BinaryChunk::CheckAvailable | ( | uint32_t | p_size = 0 | ) | const |
Checks that the remaining place can hold the given size.
[in] | p_size | The size |
Referenced by Castor3D::ChunkParserBase::operator()(), Castor3D::ChunkParser< Castor::String >::operator()(), and Castor3D::ChunkParser< Castor::Path >::operator()().
|
inline |
Retrieves the chunk data size.
C3D_API void Castor3D::BinaryChunk::Finalise | ( | ) |
Computes the final data buffer from each one added until this call.
C3D_API void Castor3D::BinaryChunk::Get | ( | uint8_t * | p_data, |
uint32_t | p_size | ||
) |
Retrieves data from the chunk.
[in] | p_data | The data buffer to fill |
[in] | p_size | The buffer size |
Referenced by Castor3D::ChunkParserBase::operator()().
|
inline |
Retrieves the chunk type.
|
inline |
Retrieves the chunk data.
|
inline |
Retrieves the chunk data size.
C3D_API uint32_t Castor3D::BinaryChunk::GetRemaining | ( | ) | const |
Retrieves the remaining place.
Referenced by Castor3D::ChunkParser< Castor::String >::operator()(), and Castor3D::ChunkParser< Castor::Path >::operator()().
|
inline |
Retrieves the remaining data.
C3D_API bool Castor3D::BinaryChunk::GetSubChunk | ( | BinaryChunk & | p_subchunk | ) |
Retrieves a subchunk.
[out] | p_subchunk | Receives the subchunk |
false
if any error occured C3D_API bool Castor3D::BinaryChunk::Read | ( | Castor::BinaryFile & | p_file | ) |
From file reader function.
[in] | p_file | The file containing the chunk |
false
if any error occured Referenced by Castor3D::BinaryParser< RenderTarget >::Parse().
|
inline |
Sets the chunk's data.
[in] | p_data | The data buffer |
[in] | p_size | The buffer size |
Referenced by Castor3D::ChunkFillerBase::operator()().
C3D_API bool Castor3D::BinaryChunk::Write | ( | Castor::BinaryFile & | p_file | ) |
To chunk writer function.
[in] | p_file | The file |
false
if any error occured Referenced by Castor3D::BinaryParser< RenderTarget >::Fill().