XII Release 0.1.0
Loading...
Searching...
No Matches
xiiStreamWriterWithStats Class Reference

A stream writer that wraps another stream to track how many bytes are written to it. More...

#include <StreamWithStats.h>

Inheritance diagram for xiiStreamWriterWithStats:
[legend]

Public Member Functions

 xiiStreamWriterWithStats (xiiStreamWriter *pStream)
 
virtual xiiResult WriteBytes (const void *pWriteBuffer, xiiUInt64 uiBytesToWrite) override
 Writes a raw number of bytes from the buffer, this is the only method which has to be implemented to fully implement the interface.
 
xiiResult Flush () override
 Flushes the stream, may be implemented (not necessary to implement the interface correctly) so that user code can ensure that content is written.
 
- Public Member Functions inherited from xiiStreamWriter
 xiiStreamWriter ()
 Constructor.
 
virtual ~xiiStreamWriter ()
 Virtual destructor to ensure correct cleanup.
 
template<typename T>
xiiResult WriteWordValue (const T *pWordValue)
 Helper method to write a word value correctly (copes with potentially different endianess).
 
template<typename T>
xiiResult WriteDWordValue (const T *pDWordValue)
 Helper method to write a dword value correctly (copes with potentially different endianess).
 
template<typename T>
xiiResult WriteQWordValue (const T *pQWordValue)
 Helper method to write a qword value correctly (copes with potentially different endianess).
 
XII_ALWAYS_INLINE void WriteVersion (xiiTypeVersion version)
 Writes a type version to the stream.
 
template<typename ArrayType, typename ValueType>
xiiResult WriteArray (const xiiArrayBase< ValueType, ArrayType > &array)
 Writes an array of elements to the stream.
 
template<typename ValueType, xiiUInt16 uiSize>
xiiResult WriteArray (const xiiSmallArrayBase< ValueType, uiSize > &array)
 Writes a small array of elements to the stream.
 
template<typename ValueType, xiiUInt32 uiSize>
xiiResult WriteArray (const ValueType(&array)[uiSize])
 Writes a C style fixed array.
 
template<typename KeyType, typename Comparer>
xiiResult WriteSet (const xiiSetBase< KeyType, Comparer > &set)
 Writes a set.
 
template<typename KeyType, typename ValueType, typename Comparer>
xiiResult WriteMap (const xiiMapBase< KeyType, ValueType, Comparer > &map)
 Writes a map.
 
template<typename KeyType, typename ValueType, typename Hasher>
xiiResult WriteHashTable (const xiiHashTableBase< KeyType, ValueType, Hasher > &hashTable)
 Writes a hash table (note that the entry order might change on read)
 
xiiResult WriteString (const xiiStringView sStringView)
 Writes a string.
 

Public Attributes

xiiStreamWriterm_pStream = nullptr
 the stream to forward all requests to
 
xiiUInt64 m_uiBytesWritten = 0
 

Detailed Description

A stream writer that wraps another stream to track how many bytes are written to it.

Member Function Documentation

◆ Flush()

xiiResult xiiStreamWriterWithStats::Flush ( )
inlineoverridevirtual

Flushes the stream, may be implemented (not necessary to implement the interface correctly) so that user code can ensure that content is written.

Reimplemented from xiiStreamWriter.

◆ WriteBytes()

virtual xiiResult xiiStreamWriterWithStats::WriteBytes ( const void * pWriteBuffer,
xiiUInt64 uiBytesToWrite )
inlineoverridevirtual

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

Implements xiiStreamWriter.

Member Data Documentation

◆ m_uiBytesWritten

xiiUInt64 xiiStreamWriterWithStats::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


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