ezEngine  Milestone 7
ezChunkStreamReader Class Reference

Reader for the chunk format that ezChunkStreamWriter writes. More...

#include <ChunkStream.h>

Inheritance diagram for ezChunkStreamReader:

Classes

struct  ChunkInfo
 Describes the state of the current chunk. More...
 

Public Types

enum  EndChunkFileMode { SkipToEnd, JustClose }
 

Public Member Functions

 ezChunkStreamReader (ezStreamReaderBase &stream)
 Pass the underlying stream writer to the constructor.
 
virtual ezUInt64 ReadBytes (void *pReadBuffer, ezUInt64 uiBytesToRead) override
 Reads bytes directly from the stream. Only allowed while a valid chunk is available. Returns 0 bytes when the end of a chunk is reached, even if there are more chunks to come.
 
void SetEndChunkFileMode (EndChunkFileMode mode)
 
virtual void BeginStream ()
 Starts reading from the chunk file.
 
virtual void EndStream ()
 Stops reading from the chunk file. Optionally skips the remaining bytes, so that the underlying streams read position is after the chunk file content.
 
const ChunkInfoGetCurrentChunk () const
 Returns information about the current chunk.
 
void NextChunk ()
 Skips the rest of the current chunk and starts reading the next chunk.
 
- Public Member Functions inherited from ezStreamReaderBase
 ezStreamReaderBase ()
 Constructor.
 
virtual ~ezStreamReaderBase ()
 Virtual destructor to ensure correct cleanup.
 
template<typename T >
ezResult ReadWordValue (T *pWordValue)
 Helper method to read a word value correctly (copes with potentially different endianess)
 
template<typename T >
ezResult ReadDWordValue (T *pDWordValue)
 Helper method to read a dword value correctly (copes with potentially different endianess)
 
template<typename T >
ezResult ReadQWordValue (T *pQWordValue)
 Helper method to read a qword value correctly (copes with potentially different endianess)
 
virtual ezUInt64 SkipBytes (ezUInt64 uiBytesToSkip)
 Helper method to skip a number of bytes (implementations of the stream reader may implement this more efficiently for example)
 

Private Member Functions

void TryReadChunkHeader ()
 

Private Attributes

EndChunkFileMode m_EndChunkFileMode
 
ChunkInfo m_ChunkInfo
 
ezStreamReaderBasem_Stream
 

Detailed Description

Reader for the chunk format that ezChunkStreamWriter writes.

Member Enumeration Documentation

Enumerator
SkipToEnd 

Makes sure all data is properly read, so that the stream read position is after the chunk file data. Useful if the chunk file is embedded in another file stream.

JustClose 

Just stops, leaving the stream at the last read position. This should be used if definitely nothing more needs to be read from all underlying streams.


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