![]() |
XII Release 0.1.0
|
#include <StringDeduplicationContext.h>
Public Member Functions | |
| xiiStringDeduplicationWriteContext (xiiStreamWriter &ref_originalStream) | |
| Setup the write context to perform string deduplication. | |
| xiiStreamWriter & | Begin () |
| 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. | |
| xiiStreamWriter & | GetOriginalStream () |
| Returns the original stream that was passed to the constructor. | |
| Public Member Functions inherited from xiiSerializationContext< xiiStringDeduplicationWriteContext > | |
| void | SetActive (bool bActive) |
Protected Attributes | |
| xiiStreamWriter & | m_OriginalStream |
| xiiDefaultMemoryStreamStorage | m_TempStreamStorage |
| xiiMemoryStreamWriter | m_TempStreamWriter |
| xiiMap< xiiHybridString< 64 >, xiiUInt32 > | m_DeduplicatedStrings |
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
| xiiStreamWriter & xiiStringDeduplicationWriteContext::Begin | ( | ) |
Call this method to begin string deduplicaton. You need to use the returned stream writer for subsequent serialization operations until End() is called.