ot
class UnicodeCharacterType
#include "ot/base/UnicodeCharacterType.h"
Class module for determining the characteristics of a given Unicode character.
This class mirrors some of the facilities provided by the standard C++ library. However, care must be taken to ensure that a Unicode locale is being used before relying on these. The motivations for the existence of this class are:
-
to handle non-standard C++ implementations
-
to cater for C++ implementations where there is no Unicode support
IsAlphaNumeric
static bool IsAlphaNumeric(UCharType ch)
-
Tests if the Unicode character represented by the single CharType ch is an alpha-numeric character[a-z], [A-Z], [0-9].
- Returns:
-
true if this Character is an alpha-numeric character; false otherwise.
IsAscii
static bool IsAscii(UCharType ch)
-
Tests if the Unicode character represented by the single CharType ch is an ASCII character (0-0x7F).
- Returns:
-
true if this Character is an ASCII character; false otherwise.
IsDigit
static bool IsDigit(UCharType ch)
-
Tests if the Unicode character represented by the single CharType ch is an ASCII decimal digit 0-9.
- Returns:
-
true if this Character is a decimal digit [0-9]; false otherwise.
IsHexDigit
static bool IsHexDigit(UCharType ch)
-
Tests if the Unicode character represented by the single CharType ch is an ASCII hexadecimal digit [0-9], [A-F], [a-f].
- Returns:
-
true if this Character is a hexadecimal digit; false otherwise.
IsSpace
static bool IsSpace(UCharType ch)
-
Tests if the Unicode character represented by the single CharType ch is white-space according to common Windows and Unix conventions.
Space characters are:-
-
'\t' U+0009 HORIZONTAL TABULATION
-
'\n' U+000A NEW LINE
-
'\f' U+000C FORM FEED
-
'\r' U+000D CARRIAGE RETURN
-
' ' U+0020 SPACE
- Returns:
-
true if ch is a space character; false otherwise.
Found a bug or missing feature? Please email us at support@elcel.com