InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TextCharBuffer Class Reference

#include <TextCharBuffer.h>

Public Member Functions

 TextCharBuffer (WideString::const_iterator b, WideString::const_iterator e)
 
 TextCharBuffer (const TextCharBuffer &o)
 
 TextCharBuffer (const WideString &s)
 
 TextCharBuffer (const UTF16TextChar *begin, const UTF16TextChar *end, int32 charCount)
 
UTF32TextChar First () const
 
const UTF16TextChar * begin_raw () const
 
const UTF16TextChar * end_raw () const
 
int32 CharCount () const
 
void RemoveFirst ()
 
void RemoveLast ()
 

Detailed Description

TextCharBuffer is a container for two WideString::const_iterator objects that iterate over the same WideString. By moving the iterators, you can pretend you are truncating the buffer, but the buffer itself is protected. This is an efficient way of supporting correct trucation of buffers containing Unicode surrogate characters (mixed byte-length characters)

See Also
WideString

Member Function Documentation

const UTF16TextChar* TextCharBuffer::begin_raw () const
inline
 This function directly accesses the buffer in the WideString, so it is not Unicode savvy.

You cannot assume it points to a whole character, or that you can increment it and find whole characters.

Returns
raw ptr to the beginning of the buffer in the WideString (UTF16TextChar *).
int32 TextCharBuffer::CharCount () const
inline
Returns
character count (not same as buffer byte length) of buffer
const UTF16TextChar* TextCharBuffer::end_raw () const
inline
 This function directly accesses the buffer in the WideString, so it is not Unicode savvy.

You cannot assume it points to a whole character, or that you can decrement it and find whole characters.

Returns
raw ptr to the end of the buffer in the WideString (UTF16TextChar *).
UTF32TextChar TextCharBuffer::First () const
inline
Returns
the first character in the buffer
void TextCharBuffer::RemoveFirst ()
inline

truncate first whole character of buffer

void TextCharBuffer::RemoveLast ()
inline

truncate last whole character of buffer