Rudiments
Static Public Member Functions | List of all members
ucs2character Class Reference

Static Public Member Functions

static bool isAlphanumeric (int32_t c)
 
static bool isAlphabetical (int32_t c)
 
static bool isLowerCase (int32_t c)
 
static bool isUpperCase (int32_t c)
 
static bool isPunctuation (int32_t c)
 
static bool isPrintable (int32_t c)
 
static bool isPrintableNonSpace (int32_t c)
 
static bool isControlCharacter (int32_t c)
 
static bool isDigit (int32_t c)
 
static bool isHexDigit (int32_t c)
 
static bool isBlank (int32_t c)
 
static bool isWhitespace (int32_t c)
 
static bool isAscii (int32_t c)
 
static int32_t upper (int32_t c)
 
static int32_t lower (int32_t c)
 
static int32_t convertToAscii (int32_t c)
 
static bool isInSet (ucs2_t c, const ucs2_t *set)
 
static ucs2_t duplicate (char c)
 
static ucs2_t duplicate (char c, ucs2_t replacement)
 
static ucs2_t duplicate (char c, bool bigendian)
 
static ucs2_t duplicate (char c, ucs2_t replacement, bool bigendian)
 
static ucs2_t duplicate (wchar_t c)
 
static ucs2_t duplicate (wchar_t c, ucs2_t replacement)
 
static ucs2_t duplicate (wchar_t c, bool bigendian)
 
static ucs2_t duplicate (wchar_t c, ucs2_t replacement, bool bigendian)
 
static uint8_t getNullSize ()
 
static uint8_t getBomSize ()
 

Detailed Description

The ucs2character class provides static methods for evaluating and manipulating UCS-2 encoded characters.

Member Function Documentation

◆ convertToAscii()

static int32_t ucs2character::convertToAscii ( int32_t  c)
static

Converts "c" to a 7-bit value by clearing the higher order bits.

◆ duplicate() [1/8]

static ucs2_t ucs2character::duplicate ( char  c)
static

Returns the UCS-2 character representation of character "c" per the character set of the current locale.

Returns '?' if character "c" cannot be converted to a UCS-2 character.

The return value will be in the byte-order of the system.

◆ duplicate() [2/8]

static ucs2_t ucs2character::duplicate ( char  c,
bool  bigendian 
)
static

Returns the UCS-2 character representation of character "c" per the character set of the current locale.

Returns '?' if character "c" cannot be converted to a UCS-2 character.

If "bigendian" is true then the return value will be in big endian byte-order. If "bigendian" is false then the return value will be in little endian byte-order.

◆ duplicate() [3/8]

static ucs2_t ucs2character::duplicate ( char  c,
ucs2_t  replacement 
)
static

Returns the UCS-2 character representation of character "c" per the character set of the current locale.

Returns "replacement" if character "c" cannot be converted to a UCS-2 character.

The return value will be in the byte-order of the system.

◆ duplicate() [4/8]

static ucs2_t ucs2character::duplicate ( char  c,
ucs2_t  replacement,
bool  bigendian 
)
static

Returns the UCS-2 character representation of character "c" per the character set of the current locale.

Returns "replacement" if character "c" cannot be converted to a UCS-2 character.

If "bigendian" is true then the return value will be in big endian byte-order. If "bigendian" is false then the return value will be in little endian byte-order.

◆ duplicate() [5/8]

static ucs2_t ucs2character::duplicate ( wchar_t  c)
static

Returns the UCS-2 character representation of wide character "c" per the character set of the current locale.

Returns '?' if wide character "c" cannot be converted to a UCS-2 character.

The return value will be in the byte-order of the system.

◆ duplicate() [6/8]

static ucs2_t ucs2character::duplicate ( wchar_t  c,
bool  bigendian 
)
static

Returns the UCS-2 character representation of wide character "c" per the character set of the current locale.

Returns '?' if wide character "c" cannot be converted to a UCS-2 character.

If "bigendian" is true then the return value will be in big endian byte-order. If "bigendian" is false then the return value will be in little endian byte-order.

◆ duplicate() [7/8]

static ucs2_t ucs2character::duplicate ( wchar_t  c,
ucs2_t  replacement 
)
static

Returns the UCS-2 character representation of wide character "c" per the character set of the current locale.

Returns "replacement" if wide character "c" cannot be converted to a UCS-2 character.

The return value will be in the byte-order of the system.

◆ duplicate() [8/8]

static ucs2_t ucs2character::duplicate ( wchar_t  c,
ucs2_t  replacement,
bool  bigendian 
)
static

Returns the UCS-2 character representation of wide character "c" per the character set of the current locale.

Returns "replacement" if wide character "c" cannot be converted to a UCS-2 character.

If "bigendian" is true then the return value will be in big endian byte-order. If "bigendian" is false then the return value will be in little endian byte-order.

◆ getBomSize()

static uint8_t ucs2character::getBomSize ( )
static

Returns the number of bytes in the UCS-2 byte-order mark.

◆ getNullSize()

static uint8_t ucs2character::getNullSize ( )
static

Returns the number of bytes needed to NULL-terminate a string of UCS-2-encoded characters.

◆ isAlphabetical()

static bool ucs2character::isAlphabetical ( int32_t  c)
static

Returns true if "c" is alphabetical character and false otherwise.

◆ isAlphanumeric()

static bool ucs2character::isAlphanumeric ( int32_t  c)
static

Returns true if "c" is an alphanumeric character and false otherwise.

◆ isAscii()

static bool ucs2character::isAscii ( int32_t  c)
static

Returns true if "c" is one of the values in the ASCII character set or false otherwise.

◆ isBlank()

static bool ucs2character::isBlank ( int32_t  c)
static

Returns true if "c" is a space or tab and false otherwise.

◆ isControlCharacter()

static bool ucs2character::isControlCharacter ( int32_t  c)
static

Returns true if "c" is a control character and false otherwise.

◆ isDigit()

static bool ucs2character::isDigit ( int32_t  c)
static

Returns true if "c" is a digit and false otherwise.

◆ isHexDigit()

static bool ucs2character::isHexDigit ( int32_t  c)
static

Returns true if "c" is a hexadecimal digit and false otherwise.

◆ isInSet()

static bool ucs2character::isInSet ( ucs2_t  c,
const ucs2_t *  set 
)
static

Returns true if "c" is in the set of characters in "set" and false otherwise.

◆ isLowerCase()

static bool ucs2character::isLowerCase ( int32_t  c)
static

Returns true if "c" is lower case and false otherwise.

◆ isPrintable()

static bool ucs2character::isPrintable ( int32_t  c)
static

Returns true if "c" is a printable character and false otherwise.

◆ isPrintableNonSpace()

static bool ucs2character::isPrintableNonSpace ( int32_t  c)
static

Returns true if "c" is a printable character other than a space and false otherwise.

◆ isPunctuation()

static bool ucs2character::isPunctuation ( int32_t  c)
static

Returns true if "c" is a printable character that is not a space or alphanumeric character and false otherwise.

◆ isUpperCase()

static bool ucs2character::isUpperCase ( int32_t  c)
static

Returns true if "c" is upper case and false otherwise.

◆ isWhitespace()

static bool ucs2character::isWhitespace ( int32_t  c)
static

Returns true if "c" is any whitespace character and false otherwise.

◆ lower()

static int32_t ucs2character::lower ( int32_t  c)
static

Returns the lower case version of "c".

◆ upper()

static int32_t ucs2character::upper ( int32_t  c)
static

Returns the upper case version of "c".