Yate
|
A single Unicode character. More...
#include <yateclass.h>
Public Member Functions | |
UChar (uint32_t code=0) | |
UChar (int32_t code) | |
UChar (signed char code) | |
UChar (unsigned char code) | |
UChar & | operator= (uint32_t code) |
UChar & | operator= (char code) |
uint32_t | code () const |
const char * | c_str () const |
operator const char * () const | |
bool | decode (const char *&str, uint32_t maxChar=0x10ffff, bool overlong=false) |
A single Unicode character.
A simple class to hold a single Unicode character and convert it to / from UTF-8
|
inlineexplicit |
Constructor from unsigned numeric code
code | Code of the Unicode character |
|
inlineexplicit |
Constructor from signed numeric code
code | Code of the Unicode character |
|
inlineexplicit |
Constructor from signed character
code | Character to construct from |
|
inlineexplicit |
Constructor from unsigned character
code | Character to construct from |
|
inline |
Get the value of the character as UTF-8 string.
|
inline |
Get the Unicode value of the character
Referenced by UChar::operator=().
bool decode | ( | const char *& | str, |
uint32_t | maxChar = 0x10ffff , |
||
bool | overlong = false |
||
) |
Decode the first Unicode character from an UTF-8 C string
str | String to extract from, will be advanced past the character |
maxChar | Maximum accepted Unicode character code |
overlong | Accept overlong UTF-8 sequences (dangerous!) |
|
inline |
Conversion to "const char *" operator.
|
inline |
Assignment operator from a character code
code | Character code to assign |
References UChar::code().
|
inline |
Assignment operator from a character
code | Character to assign |