![]() |
ezEngine Release 26.3
|
A stream writer that wraps another stream to track how many bytes are written to it. More...
#include <StreamWithStats.h>

Public Member Functions | |
| ezStreamWriterWithStats (ezStreamWriter *pStream) | |
| virtual ezResult | WriteBytes (const void *pWriteBuffer, ezUInt64 uiBytesToWrite) override |
| Writes a raw number of bytes from the buffer. This is the only method that must be implemented by derived classes. | |
| ezResult | Flush () override |
| Flushes buffered data to the underlying storage, ensuring data persistence. | |
Public Member Functions inherited from ezStreamWriter | |
| ezStreamWriter () | |
| Constructor. | |
| virtual | ~ezStreamWriter () |
| Virtual destructor to ensure correct cleanup. | |
| 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) | |
| EZ_ALWAYS_INLINE void | WriteVersion (ezTypeVersion version) |
| Writes a type version to the stream. | |
| template<typename ArrayType , typename ValueType > | |
| ezResult | WriteArray (const ezArrayBase< ValueType, ArrayType > &array) |
| Writes an array of elements to the stream. | |
| template<typename ValueType , ezUInt16 uiSize> | |
| ezResult | WriteArray (const ezSmallArrayBase< ValueType, uiSize > &array) |
| Writes a small array of elements to the stream. | |
| template<typename ValueType , ezUInt32 uiSize> | |
| ezResult | WriteArray (const ValueType(&array)[uiSize]) |
| Writes a C style fixed array. | |
| template<typename KeyType , typename Comparer > | |
| ezResult | WriteSet (const ezSetBase< KeyType, Comparer > &set) |
| Writes a set. | |
| template<typename KeyType , typename ValueType , typename Comparer > | |
| ezResult | WriteMap (const ezMapBase< KeyType, ValueType, Comparer > &map) |
| Writes a map. | |
| template<typename KeyType , typename ValueType , typename Hasher > | |
| ezResult | WriteHashTable (const ezHashTableBase< KeyType, ValueType, Hasher > &hashTable) |
| Writes a hash table (note that the entry order might change on read) | |
| ezResult | WriteString (const ezStringView sStringView) |
| Writes a string. | |
Public Attributes | |
| ezStreamWriter * | m_pStream = nullptr |
| the stream to forward all requests to | |
| ezUInt64 | m_uiBytesWritten = 0 |
A stream writer that wraps another stream to track how many bytes are written to it.
|
inlineoverridevirtual |
Flushes buffered data to the underlying storage, ensuring data persistence.
Default implementation is a no-op. Derived classes with internal buffering should override this method to force writing of buffered data to the actual destination.
Reimplemented from ezStreamWriter.
|
inlineoverridevirtual |
Writes a raw number of bytes from the buffer. This is the only method that must be implemented by derived classes.
| pWriteBuffer | Source buffer containing data to write |
| uiBytesToWrite | Number of bytes to write from the buffer |
Implements ezStreamWriter.
| ezUInt64 ezStreamWriterWithStats::m_uiBytesWritten = 0 |
the number of bytes that were written to the wrapped stream public access so that users can read and modify this in case they want to reset the value at any time