![]() |
XII Release 0.1.0
|
A stream reader that wraps another stream to track how many bytes are read from it. More...
#include <StreamWithStats.h>
Public Member Functions | |
xiiStreamReaderWithStats (xiiStreamReader *pStream) | |
virtual xiiUInt64 | ReadBytes (void *pReadBuffer, xiiUInt64 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. | |
xiiUInt64 | SkipBytes (xiiUInt64 uiBytesToSkip) override |
Helper method to skip a number of bytes (implementations of the stream reader may implement this more efficiently for example). | |
![]() | |
xiiStreamReader () | |
Constructor. | |
virtual | ~xiiStreamReader () |
Virtual destructor to ensure correct cleanup. | |
template<typename T> | |
xiiResult | ReadWordValue (T *pWordValue) |
Helper method to read a word value correctly (copes with potentially different endianess). | |
template<typename T> | |
xiiResult | ReadDWordValue (T *pDWordValue) |
Helper method to read a dword value correctly (copes with potentially different endianess). | |
template<typename T> | |
xiiResult | ReadQWordValue (T *pQWordValue) |
Helper method to read a qword value correctly (copes with potentially different endianess). | |
template<typename ArrayType, typename ValueType> | |
xiiResult | ReadArray (xiiArrayBase< ValueType, ArrayType > &ref_array) |
Reads an array of elements from the stream. | |
template<typename ValueType, xiiUInt16 uiSize, typename AllocatorWrapper> | |
xiiResult | ReadArray (xiiSmallArray< ValueType, uiSize, AllocatorWrapper > &ref_array) |
Reads a small array of elements from the stream. | |
template<typename ValueType, xiiUInt32 uiSize> | |
xiiResult | ReadArray (ValueType(&array)[uiSize]) |
Writes a C style fixed array. | |
template<typename KeyType, typename Comparer> | |
xiiResult | ReadSet (xiiSetBase< KeyType, Comparer > &ref_set) |
Reads a set. | |
template<typename KeyType, typename ValueType, typename Comparer> | |
xiiResult | ReadMap (xiiMapBase< KeyType, ValueType, Comparer > &ref_map) |
Reads a map. | |
template<typename KeyType, typename ValueType, typename Hasher> | |
xiiResult | ReadHashTable (xiiHashTableBase< KeyType, ValueType, Hasher > &ref_hashTable) |
Read a hash table (note that the entry order is not stable). | |
xiiResult | ReadString (xiiStringBuilder &ref_sBuilder) |
Reads a string into a xiiStringBuilder. | |
xiiResult | ReadString (xiiString &ref_sString) |
Reads a string into a xiiString. | |
XII_ALWAYS_INLINE xiiTypeVersion | ReadVersion (xiiTypeVersion expectedMaxVersion) |
Public Attributes | |
xiiStreamReader * | m_pStream = nullptr |
the stream to forward all requests to | |
xiiUInt64 | m_uiBytesRead = 0 |
xiiUInt64 | m_uiBytesSkipped = 0 |
the number of bytes that were skipped from the wrapped stream | |
A stream reader that wraps another stream to track how many bytes are read from it.
|
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 xiiStreamReader.
|
inlineoverridevirtual |
Helper method to skip a number of bytes (implementations of the stream reader may implement this more efficiently for example).
Reimplemented from xiiStreamReader.
xiiUInt64 xiiStreamReaderWithStats::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