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

#include <BaseType.h>

Public Types

typedef base_type data_type
 

Public Member Functions

 UTF32TextChar ()
 
 UTF32TextChar (uint32 c32)
 
 UTF32TextChar (UTF16TextChar hi, UTF16TextChar low)
 
 UTF32TextChar (const UTF32TextChar &c)
 
uint32 GetValue () const
 
UTF16TextChar CalcHighSurrogate () const
 
UTF16TextChar CalcLowSurrogate () const
 
void ToUTF16 (UTF16TextChar *buf, int32 *len) const
 
bool16 operator== (UTF32TextChar c32) const
 
bool16 operator!= (UTF32TextChar c32) const
 
bool16 operator>= (UTF32TextChar i) const
 
bool16 operator<= (UTF32TextChar i) const
 
bool16 operator> (UTF32TextChar i) const
 
bool16 operator< (UTF32TextChar i) const
 
UTF32TextCharoperator= (const UTF32TextChar &c)
 
bool16 isExtraWide () const
 
void ReadWriteUTF16 (IPMStream *s)
 

Protected Attributes

uint32 fCharacterValue
 

Detailed Description

UTF32TextChar holds a 32-bit unicode character. The advantage of the 32-bit character

over the 16-bit character is that you don't have 2-character sequences for surrogate characters as in 16-bit Unicode strings.

Member Typedef Documentation

This is a base_type, meaning that it can be copied with a block-move

Constructor & Destructor Documentation

UTF32TextChar::UTF32TextChar ()
inline

Default constructor

UTF32TextChar::UTF32TextChar (uint32 c32)
inline

Constructor 32-bit char

Parameters
uint3232 bit character value
UTF32TextChar::UTF32TextChar (UTF16TextChar hi,
UTF16TextChar low 
)
inline

Constructor from 16-bit character representation

Parameters
hihi-order 16 bits of the 32-bit char
lowlow-order 16 bits of the 32-bit char
UTF32TextChar::UTF32TextChar (const UTF32TextCharc)
inline

Constructor 32-bit const char

Parameters
uint32const character value

Member Function Documentation

UTF16TextChar UTF32TextChar::CalcHighSurrogate () const
inline

Return the high order 16 bit value

Returns
UTF16TextChar high order 16-bits
UTF16TextChar UTF32TextChar::CalcLowSurrogate () const
inline

Return the low order 16 bit value

Returns
UTF16TextChar low order 16-bits
uint32 UTF32TextChar::GetValue () const
inline

Returns the 32 bit value of the character

Returns
uint32 character value
bool16 UTF32TextChar::isExtraWide () const
inline

Returns kTrue if the value of this character can NOT be represented in 16 bits. In such a case, CalcHighSurrogate and CalcLowSurrogate can be used to get two consecutive 16-bit values that represent the codepoint

Returns
kTrue if the value of this character requires more than 16 bits
bool16 UTF32TextChar::operator!= (UTF32TextChar c32) const
inline

Inequality comparison of two 32-bit characters

Parameters
c32character to compare to
Returns
true if the two characters are not equal
bool16 UTF32TextChar::operator< (UTF32TextChar i) const
inline

Value comparison of two 32-bit characters

Parameters
icharacter to compare to
Returns
true if this is less than i
bool16 UTF32TextChar::operator<= (UTF32TextChar i) const
inline

Value comparison of two 32-bit characters

Parameters
icharacter to compare to
Returns
true if this is less than or equal to than i
UTF32TextChar& UTF32TextChar::operator= (const UTF32TextCharc)
inline

Assignment operator.

Parameters
valueto assign to this
bool16 UTF32TextChar::operator== (UTF32TextChar c32) const
inline

Equality comparison of two 32-bit characters

Parameters
c32character to compare to
Returns
true if the two characters are equal
bool16 UTF32TextChar::operator> (UTF32TextChar i) const
inline

Value comparison of two 32-bit characters

Parameters
icharacter to compare to
Returns
true if this is greater than i
bool16 UTF32TextChar::operator>= (UTF32TextChar i) const
inline

Value comparison of two 32-bit characters

Parameters
icharacter to compare to
Returns
true if this is greater than or equal to than i
void UTF32TextChar::ReadWriteUTF16 (IPMStreams)

Read or write out the value as a stream of 16-bit characters.

Parameters
sinput or output stream
void UTF32TextChar::ToUTF16 (UTF16TextChar * buf,
int32 * len 
) const
inline

Convert the 32-bit character into an array of 16-bit values

Parameters
bufpointer to array
lengthint32* OUT contains length of array after conversion.