ezEngine Release 25.08
Loading...
Searching...
No Matches
ezStreamReaderWithStats Class Reference

A stream reader that wraps another stream to track how many bytes are read from it. More...

#include <StreamWithStats.h>

Inheritance diagram for ezStreamReaderWithStats:

Public Member Functions

 ezStreamReaderWithStats (ezStreamReader *pStream)
 
virtual ezUInt64 ReadBytes (void *pReadBuffer, ezUInt64 uiBytesToRead) override
 Reads a raw number of bytes into the read buffer, this is the only method which has to be implemented to fully implement the interface.
 
ezUInt64 SkipBytes (ezUInt64 uiBytesToSkip) override
 Helper method to skip a number of bytes (implementations of the stream reader may implement this more efficiently for example)
 
- Public Member Functions inherited from ezStreamReader
 ezStreamReader ()
 Constructor.
 
virtual ~ezStreamReader ()
 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)
 
template<typename ArrayType , typename ValueType >
ezResult ReadArray (ezArrayBase< ValueType, ArrayType > &inout_array)
 Reads an array of elements from the stream.
 
template<typename ValueType , ezUInt16 uiSize, typename AllocatorWrapper >
ezResult ReadArray (ezSmallArray< ValueType, uiSize, AllocatorWrapper > &ref_array)
 Reads a small array of elements from the stream.
 
template<typename ValueType , ezUInt32 uiSize>
ezResult ReadArray (ValueType(&array)[uiSize])
 Writes a C style fixed array.
 
template<typename KeyType , typename Comparer >
ezResult ReadSet (ezSetBase< KeyType, Comparer > &inout_set)
 Reads a set.
 
template<typename KeyType , typename ValueType , typename Comparer >
ezResult ReadMap (ezMapBase< KeyType, ValueType, Comparer > &inout_map)
 Reads a map.
 
template<typename KeyType , typename ValueType , typename Hasher >
ezResult ReadHashTable (ezHashTableBase< KeyType, ValueType, Hasher > &inout_hashTable)
 Read a hash table (note that the entry order is not stable)
 
ezResult ReadString (ezStringBuilder &ref_sBuilder)
 Reads a string into an ezStringBuilder.
 
ezResult ReadString (ezString &ref_sString)
 Reads a string into an ezString.
 
EZ_ALWAYS_INLINE ezTypeVersion ReadVersion (ezTypeVersion expectedMaxVersion)
 

Public Attributes

ezStreamReaderm_pStream = nullptr
 the stream to forward all requests to
 
ezUInt64 m_uiBytesRead = 0
 
ezUInt64 m_uiBytesSkipped = 0
 the number of bytes that were skipped from the wrapped stream
 

Detailed Description

A stream reader that wraps another stream to track how many bytes are read from it.

Member Function Documentation

◆ ReadBytes()

virtual ezUInt64 ezStreamReaderWithStats::ReadBytes ( void *  pReadBuffer,
ezUInt64  uiBytesToRead 
)
inlineoverridevirtual

Reads a raw number of bytes into the read buffer, this is the only method which has to be implemented to fully implement the interface.

Implements ezStreamReader.

◆ SkipBytes()

ezUInt64 ezStreamReaderWithStats::SkipBytes ( ezUInt64  uiBytesToSkip)
inlineoverridevirtual

Helper method to skip a number of bytes (implementations of the stream reader may implement this more efficiently for example)

Reimplemented from ezStreamReader.

Member Data Documentation

◆ m_uiBytesRead

ezUInt64 ezStreamReaderWithStats::m_uiBytesRead = 0

the number of bytes that were read from the wrapped stream public access so that users can read and modify this in case they want to reset the value at any time


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