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

Maps a raw chunk of memory to the xiiStreamReader interface. More...

#include <MemoryStream.h>

Inheritance diagram for xiiRawMemoryStreamWriter:
[legend]

Public Member Functions

 xiiRawMemoryStreamWriter (void *pData, xiiUInt64 uiDataSize)
 Initialize the raw memory reader with the chunk of memory that is the data storage.
 
template<typename CONTAINER>
 xiiRawMemoryStreamWriter (CONTAINER &ref_container)
 Initialize the raw memory reader with the chunk of memory from a standard XII container.
 
void Reset (void *pData, xiiUInt64 uiDataSize)
 
template<typename CONTAINER>
void Reset (CONTAINER &ref_container)
 
xiiUInt64 GetStorageSize () const
 Returns the total available bytes in the memory stream.
 
xiiUInt64 GetNumWrittenBytes () const
 Returns the number of bytes written to the storage.
 
void SetDebugSourceInformation (xiiStringView sDebugSourceInformation)
 Allows to set a string as the source of information in the memory stream for debug purposes.
 
virtual xiiResult WriteBytes (const void *pWriteBuffer, xiiUInt64 uiBytesToWrite) override
 Copies uiBytesToWrite from pWriteBuffer into the memory stream.
 
- Public Member Functions inherited from xiiStreamWriter
 xiiStreamWriter ()
 Constructor.
 
virtual ~xiiStreamWriter ()
 Virtual destructor to ensure correct cleanup.
 
virtual xiiResult Flush ()
 Flushes the stream, may be implemented (not necessary to implement the interface correctly) so that user code can ensure that content is written.
 
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.
 

Detailed Description

Maps a raw chunk of memory to the xiiStreamReader interface.

Constructor & Destructor Documentation

◆ xiiRawMemoryStreamWriter()

template<typename CONTAINER>
xiiRawMemoryStreamWriter::xiiRawMemoryStreamWriter ( CONTAINER & ref_container)
inline

Initialize the raw memory reader with the chunk of memory from a standard XII container.

Note
The container must store the data in a contiguous array.

Member Function Documentation

◆ WriteBytes()

xiiResult xiiRawMemoryStreamWriter::WriteBytes ( const void * pWriteBuffer,
xiiUInt64 uiBytesToWrite )
overridevirtual

Copies uiBytesToWrite from pWriteBuffer into the memory stream.

pWriteBuffer must be a valid buffer and must hold that much data.

Implements xiiStreamWriter.


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