![]() |
VR-Forces 4.0.4 Class Documentation
|
A single unicode character. More...
Public Types | |
| typedef unsigned int | CodePoint |
| typedef unsigned short | Surrogate |
| typedef unsigned char | Octet |
| A Unicode Octet is 8bit byte used in UTF-8 encoding. | |
Public Member Functions | |
| DtUnicodeChar () | |
| DtUnicodeChar (const char c) | |
| Construct a unicode character for a character c. | |
| DtUnicodeChar (const wchar_t c) | |
| Construct a unicode character for a character c. | |
| DtUnicodeChar (const unsigned short s, const unsigned short c) | |
| Construct a pair of UTF-16 code units, where the first character must be a surrogate pair. | |
| DtUnicodeChar (const DtUnicodeChar &other) | |
| DtUnicodeChar & | operator= (const DtUnicodeChar &other) |
| bool | operator== (const DtUnicodeChar &other) const |
| bool | operator!= (const DtUnicodeChar &other) const |
| unsigned int | utf8Length () const |
| Calculate the utf-8 length of a code point. | |
| template<int sizeofWChar_t> | |
| unsigned int | wchartLength () const |
| unsigned int | wideStringLength () const |
| unsigned int | utf16Length () const |
| unsigned int | utf32Length () const |
| unsigned int | utf16CodeUnits () const |
| unsigned int | readUtf16 (const Surrogate *memory) |
| Read from UTF-16 encoded memory, Returns number of code units read, NOT number of bytes. | |
| void | writeUtf16 (Surrogate *memory) const |
| void | readUtf32 (const unsigned int *memory) |
| void | writeUtf32 (unsigned int *memory) const |
| unsigned int | readUtf8 (const unsigned char *memory) |
| void | writeUtf8 (char *memory) const |
| template<int sizeofWchart> | |
| void | writeWCharT (wchar_t *memory) const |
| void | writeWChar (wchar_t *memory) const |
| CodePoint | codePoint () const |
Static Public Member Functions | |
| template<int sizeof_wchar_t> | |
| static CodePoint | widechar (const wchar_t c) |
| static bool | isCodePointValid (CodePoint codePoint) |
| static bool | isSurrogateSubstringValid (const Surrogate *start, const Surrogate *end, const Surrogate *substringStart, const Surrogate *substringEnd) |
| static bool | isSurrogate (Surrogate cp) |
| static DtUnicodeChar | fromUtf32 (unsigned int character) |
| static CodePoint | decodeSurrogatePair (Surrogate hi, Surrogate lo) |
| static void | encodeSurrogatePair (CodePoint cp, Surrogate &hi, Surrogate &lo) |
| static unsigned int | utf8Length (const unsigned char c) |
| Get the length based upon the first character. | |
Static Public Attributes | |
| static const CodePoint | CodePointMax = 0x0010ffff |
| static const Surrogate | LeadSurrogateMin = 0xd800 |
| static const Surrogate | LeadSurrogateMax = 0xdbff |
| static const Surrogate | TrailSurrogateMin = 0xdc00 |
| static const Surrogate | TrailSurrogateMax = 0xdfff |
Protected Member Functions | |
| DtUnicodeChar (unsigned int utf32c) | |
Private Attributes | |
| CodePoint | myCodePoint |
A single unicode character.
| typedef unsigned int makVrv::DtUnicodeChar::CodePoint |
| typedef unsigned short makVrv::DtUnicodeChar::Surrogate |
| typedef unsigned char makVrv::DtUnicodeChar::Octet |
A Unicode Octet is 8bit byte used in UTF-8 encoding.
| makVrv::DtUnicodeChar::DtUnicodeChar | ( | ) | [inline] |
Referenced by fromUtf32().
| makVrv::DtUnicodeChar::DtUnicodeChar | ( | const char | c | ) | [inline, explicit] |
Construct a unicode character for a character c.
C is assumed to be either ASCII or Latin-1
| makVrv::DtUnicodeChar::DtUnicodeChar | ( | const wchar_t | c | ) | [inline, explicit] |
Construct a unicode character for a character c.
C is assumed to be either UTF-16 or UTF-32 depending on encoding. If an invalid UTF-16 character is supplied an exception will be thrown.
| makVrv::DtUnicodeChar::DtUnicodeChar | ( | const unsigned short | s, |
| const unsigned short | c | ||
| ) | [inline, explicit] |
Construct a pair of UTF-16 code units, where the first character must be a surrogate pair.
References isSurrogate().
| makVrv::DtUnicodeChar::DtUnicodeChar | ( | const DtUnicodeChar & | other | ) | [inline] |
| makVrv::DtUnicodeChar::DtUnicodeChar | ( | unsigned int | utf32c | ) | [inline, protected] |
| DtUnicodeChar::CodePoint makVrv::DtUnicodeChar::widechar< 2 > | ( | const wchar_t | c | ) | [inline, static] |
| DtUnicodeChar& makVrv::DtUnicodeChar::operator= | ( | const DtUnicodeChar & | other | ) | [inline] |
References myCodePoint.
| bool makVrv::DtUnicodeChar::operator== | ( | const DtUnicodeChar & | other | ) | const [inline] |
References myCodePoint.
| bool makVrv::DtUnicodeChar::operator!= | ( | const DtUnicodeChar & | other | ) | const [inline] |
References myCodePoint.
| static bool makVrv::DtUnicodeChar::isCodePointValid | ( | CodePoint | codePoint | ) | [inline, static] |
References CodePointMax, and isSurrogate().
Referenced by fromUtf32().
| static bool makVrv::DtUnicodeChar::isSurrogateSubstringValid | ( | const Surrogate * | start, |
| const Surrogate * | end, | ||
| const Surrogate * | substringStart, | ||
| const Surrogate * | substringEnd | ||
| ) | [inline, static] |
References LeadSurrogateMin, and TrailSurrogateMin.
| static bool makVrv::DtUnicodeChar::isSurrogate | ( | Surrogate | cp | ) | [inline, static] |
References LeadSurrogateMin, and TrailSurrogateMax.
Referenced by DtUnicodeChar(), isCodePointValid(), and readUtf16().
| static DtUnicodeChar makVrv::DtUnicodeChar::fromUtf32 | ( | unsigned int | character | ) | [inline, static] |
| DtInvalidInput | if the character is not valid. |
References DtUnicodeChar(), and isCodePointValid().
| unsigned int makVrv::DtUnicodeChar::utf8Length | ( | ) | const [inline] |
Calculate the utf-8 length of a code point.
References myCodePoint.
| unsigned int makVrv::DtUnicodeChar::wchartLength< 4 > | ( | ) | const [inline] |
| unsigned int makVrv::DtUnicodeChar::wideStringLength | ( | ) | const [inline] |
| unsigned int makVrv::DtUnicodeChar::utf16Length | ( | ) | const [inline] |
References myCodePoint.
| unsigned int makVrv::DtUnicodeChar::utf32Length | ( | ) | const [inline] |
| static CodePoint makVrv::DtUnicodeChar::decodeSurrogatePair | ( | Surrogate | hi, |
| Surrogate | lo | ||
| ) | [inline, static] |
References X.
Referenced by readUtf16().
| static void makVrv::DtUnicodeChar::encodeSurrogatePair | ( | CodePoint | cp, |
| Surrogate & | hi, | ||
| Surrogate & | lo | ||
| ) | [inline, static] |
References LeadSurrogateMin, and TrailSurrogateMin.
Referenced by writeUtf16().
| unsigned int makVrv::DtUnicodeChar::utf16CodeUnits | ( | ) | const [inline] |
References myCodePoint.
| unsigned int makVrv::DtUnicodeChar::readUtf16 | ( | const Surrogate * | memory | ) | [inline] |
Read from UTF-16 encoded memory, Returns number of code units read, NOT number of bytes.
References decodeSurrogatePair(), isSurrogate(), and myCodePoint.
| void makVrv::DtUnicodeChar::writeUtf16 | ( | Surrogate * | memory | ) | const [inline] |
References encodeSurrogatePair(), and myCodePoint.
| void makVrv::DtUnicodeChar::readUtf32 | ( | const unsigned int * | memory | ) | [inline] |
References myCodePoint.
| void makVrv::DtUnicodeChar::writeUtf32 | ( | unsigned int * | memory | ) | const [inline] |
References myCodePoint.
| static unsigned int makVrv::DtUnicodeChar::utf8Length | ( | const unsigned char | c | ) | [inline, static] |
Get the length based upon the first character.
| unsigned int makVrv::DtUnicodeChar::readUtf8 | ( | const unsigned char * | memory | ) | [inline] |
References myCodePoint.
| void makVrv::DtUnicodeChar::writeUtf8 | ( | char * | memory | ) | const [inline] |
References myCodePoint.
| void makVrv::DtUnicodeChar::writeWCharT< 4 > | ( | wchar_t * | memory | ) | const [inline] |
| void makVrv::DtUnicodeChar::writeWChar | ( | wchar_t * | memory | ) | const [inline] |
| CodePoint makVrv::DtUnicodeChar::codePoint | ( | ) | const [inline] |
References myCodePoint.
const CodePoint makVrv::DtUnicodeChar::CodePointMax = 0x0010ffff [static] |
Referenced by isCodePointValid().
const Surrogate makVrv::DtUnicodeChar::LeadSurrogateMin = 0xd800 [static] |
Referenced by encodeSurrogatePair(), isSurrogate(), and isSurrogateSubstringValid().
const Surrogate makVrv::DtUnicodeChar::LeadSurrogateMax = 0xdbff [static] |
const Surrogate makVrv::DtUnicodeChar::TrailSurrogateMin = 0xdc00 [static] |
Referenced by encodeSurrogatePair(), and isSurrogateSubstringValid().
const Surrogate makVrv::DtUnicodeChar::TrailSurrogateMax = 0xdfff [static] |
Referenced by isSurrogate().
CodePoint makVrv::DtUnicodeChar::myCodePoint [private] |
Referenced by codePoint(), operator!=(), operator=(), operator==(), readUtf16(), readUtf32(), readUtf8(), utf16CodeUnits(), utf16Length(), utf8Length(), writeUtf16(), writeUtf32(), and writeUtf8().