ezEngine  Milestone 7
ezChunkStreamWriter Class Reference

A stream writer that separates data into 'chunks', which act like sub-streams. More...

#include <ChunkStream.h>

Inheritance diagram for ezChunkStreamWriter:

Public Member Functions

 ezChunkStreamWriter (ezStreamWriterBase &stream)
 Pass the underlying stream writer to the constructor.
 
virtual ezResult WriteBytes (const void *pWriteBuffer, ezUInt64 uiBytesToWrite) override
 Writes bytes directly to the stream. Only allowed when a chunk is open (between BeginChunk / EndChunk).
 
virtual void BeginStream ()
 Starts writing to the chunk file. Has to be the first thing that is called.
 
virtual void EndStream ()
 Stops writing to the chunk file. Has to be the last thing that is called.
 
virtual void BeginChunk (const char *szName, ezUInt32 uiVersion)
 Opens the next chunk for writing. Chunks cannot be nested (except by using multiple chunk format writers).
 
virtual void EndChunk ()
 Closes the current chunk. More...
 
- Public Member Functions inherited from ezStreamWriterBase
 ezStreamWriterBase ()
 Constructor.
 
virtual ~ezStreamWriterBase ()
 Virtual destructor to ensure correct cleanup.
 
virtual ezResult Flush ()
 Flushes the stream, may be implemented (not necessary to implement the interface correctly) so that user code can ensure that content is written.
 
template<typename T >
ezResult WriteWordValue (const T *pWordValue)
 Helper method to write a word value correctly (copes with potentially different endianess)
 
template<typename T >
ezResult WriteDWordValue (const T *pDWordValue)
 Helper method to write a dword value correctly (copes with potentially different endianess)
 
template<typename T >
ezResult WriteQWordValue (const T *pQWordValue)
 Helper method to write a qword value correctly (copes with potentially different endianess)
 

Private Attributes

bool m_bWritingFile
 
bool m_bWritingChunk
 
ezString m_sChunkName
 
ezDeque< ezUInt8 > m_Storage
 
ezStreamWriterBasem_Stream
 

Detailed Description

A stream writer that separates data into 'chunks', which act like sub-streams.

This stream writer allows to subdivide a stream into chunks, where each chunk stores a chunk name, version and size in bytes.

Member Function Documentation

void ezChunkStreamWriter::EndChunk ( )
virtual

Closes the current chunk.

Todo:
Write Chunk CRC

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