InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DataWrapper< textchar > Class Template Reference

#include <DataWrapper.h>

Public Member Functions

 DataWrapper (VOS_Object *block, const WideString *str, int32 charOffset)
 
 DataWrapper (const DataWrapper< textchar > &copy)
 
DataWrapper< textchar > & operator= (const DataWrapper< textchar > &copy)
 
 operator const textchar * ()
 
WideString::const_iterator GetIteratorAt (int32 charOffset) const
 
void ClearOffset ()
 
int32 CharOffsetToUTF16Offset (int32 charOffset) const
 
bool16 HasSurrogates () const
 
const WideStringGetData () const
 

Detailed Description

template<>
class DataWrapper< textchar >

The specialized DataWrapper<textchar> object is used to hold text contained in the text system without making a copy. It has the pointer to the text, and also the ref-counted object that owns the data.

See Also
VOS_Object
VOSDiskPage

Member Function Documentation

int32 DataWrapper< textchar >::CharOffsetToUTF16Offset (int32 charOffset) const

convert the character offset into a UTF16 buffer offset. Will return the offset when there are no surrogates.

Parameters
charOffsetis the character offset.
Returns
the number of UTF16 chars that the offset is equivalent to.
void DataWrapper< textchar >::ClearOffset ()
inline

Clear the offset contained in this object. The offset isn't really used, so this function is pretty much useless. Will be removed.

const WideString* DataWrapper< textchar >::GetData () const
inline

Accessor for the underlying string data.

WideString::const_iterator DataWrapper< textchar >::GetIteratorAt (int32 charOffset) const

convert this DataWrapper<textchar> into a WideStringIterator for walking over the text using iterator semantics.

See Also
ITextIterator
Parameters
charOffsetis the offset within this data to start iterating from.
Returns
the iterator.
bool16 DataWrapper< textchar >::HasSurrogates () const
inline

Does the current data contain surrogate characters (32bit unicode values encoded using UTF16).

Returns
kTrue if the buffer has multi-word unicode values.
DataWrapper< textchar >::operator const textchar * ()
inline

cast operator for this textchar version of DataWrapper – get a pointer to the data. fCharOffset is actually unused at this time, and is only set by the constructor.

Returns
a pointer to the text data.