Internal Helper class to handle UTF8 strings.
|
Public Types |
enum | UtfStreamType { StreamIsAscii,
StreamIsUtf8,
StreamIsError
} |
Static Public Member Functions |
void | incUtfPtr (const char *&ptr, const char *endptr) |
void | decUtfPtr (const char *&ptr, const char *beginptr) |
size_t | utfDiff (const char *end, const char *begin) |
bool | isAscii (const char *begin, const char *end) |
ucchar | fetchWideChar (const char *&begin, const char *end) |
ucchar | toWideChar (const char *begin, const char *end) |
int | getByteLength (const char *it) |
int | utflength (ucchar ch) |
| return the number of byte a unicode character needs
|
int | utflength (const ucchar *begin, const ucchar *end) |
| returns the number of bytes a unicode string needs
|
int | utflength (const ucchar *begin) |
UtfStreamType | validUtf8Stream (const byte *begin, const byte *end, bool throwOnFail=true) |
| check if the character byte stream is a valid UTF8 stream.
|
int | uclength (const ucchar *ch) |
| returns the length of 0 terminated unicode character string
|
int | uc2length (const uc2char *ch) |
int | uc4length (const uc4char *ch) |
| returns the length of an 0-terminated uc4char stream
|
int | writeUcToUtf8 (byte *&it, byte *end, ucchar ucc) |
| writes an unicode char into given chars
|
int | writeUcToUtf8 (byte *&it, byte *end, const ucchar *ucbegin, const ucchar *ucend) |
| writes the given unicode character range into 8bit char range
|
ucchar * | uc4touc (ucchar *buffer, const uc4char *source, int length=-1) |
| converts an uc4 character stream to ucchar stream.
|
ucchar * | wcchartouc (ucchar *buffer, const wchar_t *source, int length=-1) |
size_t | stringlength (const char *str) |
size_t | stringlength (const ucchar *str) |
size_t | stringlength (const uc4char *str) |
template<typename ToCharType, typename FromCharType> ToCharType * | convertTo (ToCharType *buffer, const FromCharType *source, int length=-1) |