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

Public Types

enum  ConversionError { kNoError = 0, kNotNumber }
 

Public Member Functions

 PlatformChar (char inChar, int8 script=-1)
 
 PlatformChar (uchar16 inChar, int8 script=-1)
 
 PlatformChar (uchar highByte, uchar lowByte, int8 script=-1)
 
void Set (uchar highByte, uchar lowByte, int8 script=-1)
 
void Set (uchar16 inChar, int8 script=-1)
 
void Set (char inChar, int8 script=-1)
 
void Set (uchar inChar, int8 script=-1)
 
void SetFromUnicode (textchar uniChar)
 
bool16 IsTwoByte () const
 
bool16 IsLowASCII () const
 
bool16 IsNumber () const
 
bool16 IsHexNumber () const
 
bool16 IsAlpha () const
 
bool16 IsUpper () const
 
bool16 IsLower () const
 
PlatformChar ToUpper () const
 
PlatformChar ToLower () const
 
bool16 IsSpace () const
 
bool16 IsComma () const
 
bool16 IsDash () const
 
bool16 IsPeriod () const
 
bool16 IsColon () const
 
bool16 IsSemiColon () const
 
bool16 IsBackSlash () const
 
bool16 IsSlash () const
 
bool16 IsTilde () const
 
bool16 IsLineBreakChar () const
 
bool16 IsChar (char compareChar) const
 
uchar HighByte () const
 
uchar LowByte () const
 
uchar GetAsOneByteChar () const
 
uchar16 GetValue () const
 
int32 GetScript () const
 
PMStringGetAsHexString () const
 
int16 GetAsNumber (ConversionError *pError=nil) const
 
void SetFromNumber (int16 number)
 
bool16 IsValid () const
 
bool16 IsValidCharForScript (int32 script=-1) const
 
bool16 IsValidInUnicode (int32 script=-1) const
 
bool16 operator== (const PlatformChar &value) const
 
bool16 operator!= (const PlatformChar &value) const
 
bool16 operator< (const PlatformChar &value) const
 
bool16 operator> (const PlatformChar &value) const
 
bool16 operator<= (const PlatformChar &value) const
 
bool16 operator>= (const PlatformChar &value) const
 
PlatformCharoperator++ ()
 
PlatformChar operator++ (int)
 
PlatformChar operator+= (const PlatformChar &value)
 
PlatformChar operator+ (const PlatformChar &value) const
 
PlatformCharoperator-- ()
 
PlatformChar operator-- (int)
 
PlatformChar operator-= (const PlatformChar &value)
 
PlatformChar operator- (const PlatformChar &value) const
 

Member Function Documentation

PMString* PlatformChar::GetAsHexString () const

Get value as hex string

Returns
PMString hex representation of PlatformChar
int16 PlatformChar::GetAsNumber (ConversionError * pError = nil) const

Get as number. Sets pError to a ConversionError if the character cannot be converted.

Parameters
pErrorerror
Returns
int16 Number
uchar PlatformChar::GetAsOneByteChar () const

Get a uchar from PlatformChar this is only for special cases where you know you have a one byte string and you want to get its uchar value.

Returns
uchar - value
uchar16 PlatformChar::GetValue () const
inline

Return the platform-encoded value

Returns
uchar16 value
bool16 PlatformChar::IsAlpha () const
inline

Character is alphabetic

Returns
bool16 kTrue if is alphabetic
bool16 PlatformChar::IsHexNumber () const
inline

Character is a valid representation of hex.

Returns
bool16 kTrue if character can be hex number
bool16 PlatformChar::IsLowASCII () const
inline

Is lower ASCII

Returns
bool16 kTrue is char is < 128
bool16 PlatformChar::IsLower () const

Character is lower case

Returns
bool16 kTrue if lower case
bool16 PlatformChar::IsNumber () const
inline

Is character between '0' and '9'

Returns
bool16 kTrue if number
bool16 PlatformChar::IsTwoByte () const
inline

Is PlatformChar 2-byte.

Returns
bool16 kTrue if 2-byte
bool16 PlatformChar::IsUpper () const
Character is upper case

Returns
bool16 kTrue if upper case
bool16 PlatformChar::IsValidCharForScript (int32 script = -1) const

Check if character high and low bytes are valid if 2-byte script

Parameters
scriptscript to check. If -1 internal script value is used.
Returns
bool16 kTrue if character is valid.
bool16 PlatformChar::IsValidInUnicode (int32 script = -1) const

Check if character can be represented in unicode with script

Parameters
scriptscript to check. If -1 internal script value is used.
Returns
bool16 kTrue if character can be represented in unicode with script.
void PlatformChar::Set (uchar highByte,
uchar lowByte,
int8 script = -1 
)
inline

Set value of PlatformChar

Parameters
highBytehigh byte of 2-byte character. 0 if not 2-byte.
lowBytelow byte of 2-byte character.
scriptencoding of character. -1 if you don't care.
void PlatformChar::Set (uchar16 inChar,
int8 script = -1 
)
inline

Set value of PlatformChar

Parameters
inCharcharacter value.
scriptencoding of character. -1 if you don't care.
void PlatformChar::Set (char inChar,
int8 script = -1 
)
inline

Set value of PlatformChar

Parameters
inCharcharacter value.
scriptencoding of character. -1 if you don't care.
void PlatformChar::Set (uchar inChar,
int8 script = -1 
)
inline

Set value of PlatformChar

Parameters
inCharcharacter value.
scriptencoding of character. -1 if you don't care.
void PlatformChar::SetFromUnicode (textchar uniChar)

Set value of PlatformChar from Unicode.

Parameters
uniCharunicode value
PlatformChar PlatformChar::ToLower () const

Return lower case version of character

Returns
PlatformChar lower case character
PlatformChar PlatformChar::ToUpper () const

Return upper case version of character

Returns
PlatformChar Upper case character