Castor3D  ..
Public Member Functions | List of all members
Castor3D::BinaryChunk Class Reference

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...
 

Detailed Description

Binary data chunk base class.

Author
Sylvain DOREMUS
Version
0.7.0.0
Date
15/04/2013

Constructor & Destructor Documentation

◆ BinaryChunk() [1/2]

C3D_API Castor3D::BinaryChunk::BinaryChunk ( )

Constructor.

◆ BinaryChunk() [2/2]

C3D_API Castor3D::BinaryChunk::BinaryChunk ( eCHUNK_TYPE  p_type)

Constructor.

Parameters
[in]p_typeThe chunk type

Member Function Documentation

◆ Add()

C3D_API void Castor3D::BinaryChunk::Add ( uint8_t *  p_data,
uint32_t  p_size 
)

Adds data to the chunk.

Parameters
[in]p_dataThe data buffer
[in]p_sizeThe buffer size

◆ AddSubChunk()

C3D_API bool Castor3D::BinaryChunk::AddSubChunk ( BinaryChunk const &  p_subchunk)

Writes a subchunk into a chunk.

Parameters
[in]p_subchunkThe subchunk
Returns
false if any error occured

Referenced by Castor3D::ChunkFillerBase::operator()().

+ Here is the caller graph for this function:

◆ CheckAvailable()

C3D_API bool Castor3D::BinaryChunk::CheckAvailable ( uint32_t  p_size = 0) const

Checks that the remaining place can hold the given size.

Parameters
[in]p_sizeThe size

Referenced by Castor3D::ChunkParserBase::operator()(), Castor3D::ChunkParser< Castor::String >::operator()(), and Castor3D::ChunkParser< Castor::Path >::operator()().

+ Here is the caller graph for this function:

◆ EndParse()

void Castor3D::BinaryChunk::EndParse ( )
inline

Retrieves the chunk data size.

◆ Finalise()

C3D_API void Castor3D::BinaryChunk::Finalise ( )

Computes the final data buffer from each one added until this call.

◆ Get()

C3D_API void Castor3D::BinaryChunk::Get ( uint8_t *  p_data,
uint32_t  p_size 
)

Retrieves data from the chunk.

Parameters
[in]p_dataThe data buffer to fill
[in]p_sizeThe buffer size

Referenced by Castor3D::ChunkParserBase::operator()().

+ Here is the caller graph for this function:

◆ GetChunkType()

eCHUNK_TYPE Castor3D::BinaryChunk::GetChunkType ( ) const
inline

Retrieves the chunk type.

Returns
The value

◆ GetData()

uint8_t const* Castor3D::BinaryChunk::GetData ( ) const
inline

Retrieves the chunk data.

Returns
The value

◆ GetDataSize()

uint32_t Castor3D::BinaryChunk::GetDataSize ( ) const
inline

Retrieves the chunk data size.

Returns
The value

◆ GetRemaining()

C3D_API uint32_t Castor3D::BinaryChunk::GetRemaining ( ) const

Retrieves the remaining place.

Returns
The value

Referenced by Castor3D::ChunkParser< Castor::String >::operator()(), and Castor3D::ChunkParser< Castor::Path >::operator()().

+ Here is the caller graph for this function:

◆ GetRemainingData()

uint8_t const* Castor3D::BinaryChunk::GetRemainingData ( ) const
inline

Retrieves the remaining data.

Returns
The value

◆ GetSubChunk()

C3D_API bool Castor3D::BinaryChunk::GetSubChunk ( BinaryChunk p_subchunk)

Retrieves a subchunk.

Parameters
[out]p_subchunkReceives the subchunk
Returns
false if any error occured

◆ Read()

C3D_API bool Castor3D::BinaryChunk::Read ( Castor::BinaryFile &  p_file)

From file reader function.

Parameters
[in]p_fileThe file containing the chunk
Returns
false if any error occured

Referenced by Castor3D::BinaryParser< RenderTarget >::Parse().

+ Here is the caller graph for this function:

◆ SetData()

void Castor3D::BinaryChunk::SetData ( uint8_t const *  p_data,
uint32_t  p_size 
)
inline

Sets the chunk's data.

Parameters
[in]p_dataThe data buffer
[in]p_sizeThe buffer size

Referenced by Castor3D::ChunkFillerBase::operator()().

+ Here is the caller graph for this function:

◆ Write()

C3D_API bool Castor3D::BinaryChunk::Write ( Castor::BinaryFile &  p_file)

To chunk writer function.

Parameters
[in]p_fileThe file
Returns
false if any error occured

Referenced by Castor3D::BinaryParser< RenderTarget >::Fill().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: