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

This class allows for automatic deduplication of strings written to a stream. To use, create an object of this type on the stack, call Begin() and use the returned xiiStreamWriter for subsequent serialization operations. Call End() once you want to finish writing deduplicated strings. For a sample see StreamOperationsTest.cpp. More...

#include <StringDeduplicationContext.h>

Inheritance diagram for xiiStringDeduplicationWriteContext:
[legend]

Public Member Functions

 xiiStringDeduplicationWriteContext (xiiStreamWriter &ref_originalStream)
 Setup the write context to perform string deduplication.
 
xiiStreamWriterBegin ()
 Call this method to begin string deduplicaton. You need to use the returned stream writer for subsequent serialization operations until End() is called.
 
xiiResult End ()
 Ends the string deduplication and writes the string table to the original stream.
 
void SerializeString (const xiiStringView &sString, xiiStreamWriter &ref_writer)
 Internal method to serialize a string.
 
xiiUInt32 GetUniqueStringCount () const
 Returns the number of unique strings which were serialized with this instance.
 
xiiStreamWriterGetOriginalStream ()
 Returns the original stream that was passed to the constructor.
 
- Public Member Functions inherited from xiiSerializationContext< xiiStringDeduplicationWriteContext >
void SetActive (bool bActive)
 Set the context as active which means it can be accessed via GetContext in serialization methods.
 

Protected Attributes

xiiStreamWriterm_OriginalStream
 
xiiDefaultMemoryStreamStorage m_TempStreamStorage
 
xiiMemoryStreamWriter m_TempStreamWriter
 
xiiMap< xiiHybridString< 64 >, xiiUInt32 > m_DeduplicatedStrings
 

Detailed Description

This class allows for automatic deduplication of strings written to a stream. To use, create an object of this type on the stack, call Begin() and use the returned xiiStreamWriter for subsequent serialization operations. Call End() once you want to finish writing deduplicated strings. For a sample see StreamOperationsTest.cpp.


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