#include <wx/unichar.h>
This class represents a single Unicode character.
It can be converted to and from char
or wchar_t
and implements commonly used character operations.
Public Types | |
typedef wxUint32 | value_type |
A type capable of holding any Unicode code point. More... | |
Public Member Functions | |
wxUniChar () | |
Default ctor. More... | |
wxUniChar (int c) | |
wxUniChar (unsigned int c) | |
wxUniChar (long int c) | |
wxUniChar (unsigned long int c) | |
wxUniChar (short int c) | |
wxUniChar (unsigned short int c) | |
wxUniChar (wxLongLong_t c) | |
wxUniChar (wxULongLong_t c) | |
wxUniChar (const wxUniCharRef &c) | |
value_type | GetValue () const |
Returns Unicode code point value of the character. More... | |
bool | IsAscii () const |
Returns true if the character is an ASCII character (i.e. if its value is less than 128). More... | |
bool | GetAsChar (char *c) const |
Returns true if the character is representable as a single byte in the current locale encoding. More... | |
bool | IsBMP () const |
Returns true if the character is a BMP character (i.e. if its value is less than 0x10000). More... | |
bool | IsSupplementary () const |
Returns true if the character is a supplementary character (i.e. between 0x10000 and 0x10FFFF). More... | |
wxUint16 | HighSurrogate () const |
Returns the high surrogate code unit for the supplementary character. More... | |
wxUint16 | LowSurrogate () const |
Returns the low surrogate code unit for the supplementary character. More... | |
wxUniChar (char c) | |
Create a character from the 8-bit character value c using the current locale encoding. More... | |
wxUniChar (unsigned char c) | |
Create a character from the 8-bit character value c using the current locale encoding. More... | |
operator char () const | |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions. More... | |
operator unsigned char () const | |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions. More... | |
operator wchar_t () const | |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions. More... | |
operator int () const | |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions. More... | |
operator unsigned int () const | |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions. More... | |
operator long int () const | |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions. More... | |
operator unsigned long int () const | |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions. More... | |
operator short int () const | |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions. More... | |
operator unsigned short int () const | |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions. More... | |
operator wxLongLong_t () const | |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions. More... | |
operator wxULongLong_t () const | |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions. More... | |
wxUniChar & | operator= (const wxUniChar &c) |
Assignment operators. More... | |
wxUniChar & | operator= (const wxUniCharRef &c) |
Assignment operators. More... | |
wxUniChar & | operator= (char c) |
Assignment operators. More... | |
wxUniChar & | operator= (unsigned char c) |
Assignment operators. More... | |
wxUniChar & | operator= (wchar_t c) |
Assignment operators. More... | |
wxUniChar & | operator= (int c) |
Assignment operators. More... | |
wxUniChar & | operator= (unsigned int c) |
Assignment operators. More... | |
wxUniChar & | operator= (long int c) |
Assignment operators. More... | |
wxUniChar & | operator= (unsigned long int c) |
Assignment operators. More... | |
wxUniChar & | operator= (short int c) |
Assignment operators. More... | |
wxUniChar & | operator= (unsigned short int c) |
Assignment operators. More... | |
wxUniChar & | operator= (wxLongLong_t c) |
Assignment operators. More... | |
wxUniChar & | operator= (wxULongLong_t c) |
Assignment operators. More... | |
Static Public Member Functions | |
static bool | IsBMP (wxUint32 value) |
Returns true if the character is a BMP character (i.e. if its value is less than 0x10000). More... | |
static bool | IsSupplementary (wxUint32 value) |
Returns true if the character is a supplementary character (i.e. between 0x10000 and 0x10FFFF). More... | |
static wxUint16 | HighSurrogate (wxUint32 value) |
Returns the high surrogate code unit for the supplementary character. More... | |
static wxUint16 | LowSurrogate (wxUint32 value) |
Returns the low surrogate code unit for the supplementary character. More... | |
typedef wxUint32 wxUniChar::value_type |
A type capable of holding any Unicode code point.
We do not use wchar_t as it cannot do the job on Win32, where wchar_t is a 16-bit type (wchar_t* is encoded using UTF-16 on Win32).
wxUniChar::wxUniChar | ( | ) |
Default ctor.
wxUniChar::wxUniChar | ( | char | c | ) |
Create a character from the 8-bit character value c using the current locale encoding.
wxUniChar::wxUniChar | ( | unsigned char | c | ) |
Create a character from the 8-bit character value c using the current locale encoding.
wxUniChar::wxUniChar | ( | int | c | ) |
wxUniChar::wxUniChar | ( | unsigned int | c | ) |
wxUniChar::wxUniChar | ( | long int | c | ) |
wxUniChar::wxUniChar | ( | unsigned long int | c | ) |
wxUniChar::wxUniChar | ( | short int | c | ) |
wxUniChar::wxUniChar | ( | unsigned short int | c | ) |
wxUniChar::wxUniChar | ( | wxLongLong_t | c | ) |
wxUniChar::wxUniChar | ( | wxULongLong_t | c | ) |
wxUniChar::wxUniChar | ( | const wxUniCharRef & | c | ) |
bool wxUniChar::GetAsChar | ( | char * | c | ) | const |
Returns true if the character is representable as a single byte in the current locale encoding.
This function only returns true if the character can be converted in exactly one byte, e.g. it only returns true for 7 bit ASCII characters when the encoding used is UTF-8.
It is mostly useful to test if the character can be passed to functions taking a char and is used by wxWidgets itself for this purpose.
c | An output pointer to the value of this Unicode character as a char . Must be non-null. |
value_type wxUniChar::GetValue | ( | ) | const |
Returns Unicode code point value of the character.
wxUint16 wxUniChar::HighSurrogate | ( | ) | const |
Returns the high surrogate code unit for the supplementary character.
Returns the high surrogate code unit for the supplementary character.
value | The Unicode code point of the character. |
bool wxUniChar::IsAscii | ( | ) | const |
Returns true if the character is an ASCII character (i.e. if its value is less than 128).
bool wxUniChar::IsBMP | ( | ) | const |
Returns true if the character is a BMP character (i.e. if its value is less than 0x10000).
|
static |
Returns true if the character is a BMP character (i.e. if its value is less than 0x10000).
value | The Unicode code point of the character. |
bool wxUniChar::IsSupplementary | ( | ) | const |
Returns true if the character is a supplementary character (i.e. between 0x10000 and 0x10FFFF).
|
static |
Returns true if the character is a supplementary character (i.e. between 0x10000 and 0x10FFFF).
value | The Unicode code point of the character. |
wxUint16 wxUniChar::LowSurrogate | ( | ) | const |
Returns the low surrogate code unit for the supplementary character.
Returns the low surrogate code unit for the supplementary character.
value | The Unicode code point of the character. |
wxUniChar::operator char | ( | ) | const |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions.
wxUniChar::operator int | ( | ) | const |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions.
wxUniChar::operator long int | ( | ) | const |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions.
wxUniChar::operator short int | ( | ) | const |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions.
wxUniChar::operator unsigned char | ( | ) | const |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions.
wxUniChar::operator unsigned int | ( | ) | const |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions.
wxUniChar::operator unsigned long int | ( | ) | const |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions.
wxUniChar::operator unsigned short int | ( | ) | const |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions.
wxUniChar::operator wchar_t | ( | ) | const |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions.
wxUniChar::operator wxLongLong_t | ( | ) | const |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions.
wxUniChar::operator wxULongLong_t | ( | ) | const |
Conversions to char and wchar_t types: all of those are needed to be able to pass wxUniChars to various standard narrow and wide character functions.
wxUniChar& wxUniChar::operator= | ( | char | c | ) |
Assignment operators.
wxUniChar& wxUniChar::operator= | ( | const wxUniCharRef & | c | ) |
Assignment operators.
wxUniChar& wxUniChar::operator= | ( | int | c | ) |
Assignment operators.
wxUniChar& wxUniChar::operator= | ( | long int | c | ) |
Assignment operators.
wxUniChar& wxUniChar::operator= | ( | short int | c | ) |
Assignment operators.
wxUniChar& wxUniChar::operator= | ( | unsigned char | c | ) |
Assignment operators.
wxUniChar& wxUniChar::operator= | ( | unsigned int | c | ) |
Assignment operators.
wxUniChar& wxUniChar::operator= | ( | unsigned long int | c | ) |
Assignment operators.
wxUniChar& wxUniChar::operator= | ( | unsigned short int | c | ) |
Assignment operators.
wxUniChar& wxUniChar::operator= | ( | wchar_t | c | ) |
Assignment operators.
wxUniChar& wxUniChar::operator= | ( | wxLongLong_t | c | ) |
Assignment operators.
wxUniChar& wxUniChar::operator= | ( | wxULongLong_t | c | ) |
Assignment operators.