wxWidgets: wxUniChar Class Reference

| Version: 3.1.5

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
wxUniChar Class Reference
Class List by Category » Data Structures

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.1/wxWidgets3.1-3.1.5-3.x86_64/src/wxWidgets-3.1.5/interface/wx/unichar.h>`

## Detailed Description

This class represents a single Unicode character.

It can be converted to and from `char` or `wchar_t` and implements commonly used character operations.

##

Library: wxBase

<>< =''>:</>&;&;< =''>\ </></>

## Public Types
typedef wxUint32 | value_type
| A type capable of holding any Unicode code point.

## Public Member Functions
| wxUniChar ()
| Default ctor.
| wxUniChar (char c)
| Create a character from the 8-bit character value c using the current locale encoding.
| wxUniChar (unsigned char c)
| 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.
bool | IsAscii () const
| Returns true if the character is an ASCII character (i.e. if its value is less than 128).
bool | GetAsChar (char *c) const
| Returns true if the character is representable as a single byte in the current locale encoding.
bool | IsBMP () const
| Returns true if the character is a BMP character (i.e. if its value is less than 0x10000).
bool | IsSupplementary () const
| Returns true if the character is a supplementary character (i.e. between 0x10000 and 0x10FFFF).
wxUint16 | HighSurrogate () const
| Returns the high surrogate code unit for the supplementary character.
wxUint16 | LowSurrogate () const
| Returns the low surrogate code unit for the supplementary character.
| 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.
| operator unsigned char () const
| operator wchar_t () const
| operator int () const
| operator unsigned int () const
| operator long int () const
| operator unsigned long int () const
| operator short int () const
| operator unsigned short int () const
| operator wxLongLong_t () const
| operator wxULongLong_t () const
wxUniChar & | operator= (const wxUniChar &c)
| Assignment operators.
wxUniChar & | operator= (const wxUniCharRef &c)
wxUniChar & | operator= (char c)
wxUniChar & | operator= (unsigned char c)
wxUniChar & | operator= (wchar_t c)
wxUniChar & | operator= (int c)
wxUniChar & | operator= (unsigned int c)
wxUniChar & | operator= (long int c)
wxUniChar & | operator= (unsigned long int c)
wxUniChar & | operator= (short int c)
wxUniChar & | operator= (unsigned short int c)
wxUniChar & | operator= (wxLongLong_t c)
wxUniChar & | operator= (wxULongLong_t c)

## 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).
static bool | IsSupplementary (wxUint32 value)
| Returns true if the character is a supplementary character (i.e. between 0x10000 and 0x10FFFF).
static wxUint16 | HighSurrogate (wxUint32 value)
| Returns the high surrogate code unit for the supplementary character.
static wxUint16 | LowSurrogate (wxUint32 value)
| Returns the low surrogate code unit for the supplementary character.

## Member Typedef Documentation

## ◆ value_type

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).

## Constructor & Destructor Documentation

## ◆ wxUniChar() [1/12]

wxUniChar::wxUniChar | ( |  | ) |

Default ctor.

## ◆ wxUniChar() [2/12]

wxUniChar::wxUniChar | ( | char | c | ) |

Create a character from the 8-bit character value c using the current locale encoding.

## ◆ wxUniChar() [3/12]

wxUniChar::wxUniChar | ( | unsigned char | c | ) |

## ◆ wxUniChar() [4/12]

wxUniChar::wxUniChar | ( | int | c | ) |

## ◆ wxUniChar() [5/12]

wxUniChar::wxUniChar | ( | unsigned int | c | ) |

## ◆ wxUniChar() [6/12]

wxUniChar::wxUniChar | ( | long int | c | ) |

## ◆ wxUniChar() [7/12]

wxUniChar::wxUniChar | ( | unsigned long int | c | ) |

## ◆ wxUniChar() [8/12]

wxUniChar::wxUniChar | ( | short int | c | ) |

## ◆ wxUniChar() [9/12]

wxUniChar::wxUniChar | ( | unsigned short int | c | ) |

## ◆ wxUniChar() [10/12]

wxUniChar::wxUniChar | ( | wxLongLong_t | c | ) |

## ◆ wxUniChar() [11/12]

wxUniChar::wxUniChar | ( | wxULongLong_t | c | ) |

## ◆ wxUniChar() [12/12]

wxUniChar::wxUniChar | ( | const wxUniCharRef & | c | ) |

## Member Function Documentation

## ◆ GetAsChar()

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.

Parameters

  c | An output pointer to the value of this Unicode character as a `char`. Must be non-NULL.

Returns
  true if the object is an 8 bit char and c was filled with its value as char or false otherwise (c won't be modified then).

See also
  IsAscii()

Since
  2.9.1

## ◆ GetValue()

value_type wxUniChar::GetValue | ( |  | ) | const

Returns Unicode code point value of the character.

## ◆ HighSurrogate() [1/2]

wxUint16 wxUniChar::HighSurrogate | ( |  | ) | const

Returns the high surrogate code unit for the supplementary character.

Precondition
  IsSupplementary() const

Since
  3.1.1

## ◆ HighSurrogate() [2/2]

wxUint16 wxUniChar::HighSurrogate | ( | wxUint32 | value | ) |
| static

Returns the high surrogate code unit for the supplementary character.

Parameters

  value | The Unicode code point of the character.

Precondition
  IsSupplementary(wxUint32 value)

Since
  3.1.1

## ◆ IsAscii()

bool wxUniChar::IsAscii | ( |  | ) | const

Returns true if the character is an ASCII character (i.e. if its value is less than 128).

## ◆ IsBMP() [1/2]

bool wxUniChar::IsBMP | ( |  | ) | const

Returns true if the character is a BMP character (i.e. if its value is less than 0x10000).

Since
  3.1.1

## ◆ IsBMP() [2/2]

bool wxUniChar::IsBMP | ( | wxUint32 | value | ) |
| static

Returns true if the character is a BMP character (i.e. if its value is less than 0x10000).

Parameters

  value | The Unicode code point of the character.

Since
  3.1.1

## ◆ IsSupplementary() [1/2]

bool wxUniChar::IsSupplementary | ( |  | ) | const

Returns true if the character is a supplementary character (i.e. between 0x10000 and 0x10FFFF).

Since
  3.1.1

## ◆ IsSupplementary() [2/2]

bool wxUniChar::IsSupplementary | ( | wxUint32 | value | ) |
| static

Returns true if the character is a supplementary character (i.e. between 0x10000 and 0x10FFFF).

Parameters

  value | The Unicode code point of the character.

Since
  3.1.1

## ◆ LowSurrogate() [1/2]

wxUint16 wxUniChar::LowSurrogate | ( |  | ) | const

Returns the low surrogate code unit for the supplementary character.

Precondition
  IsSupplementary() const

Since
  3.1.1

## ◆ LowSurrogate() [2/2]

wxUint16 wxUniChar::LowSurrogate | ( | wxUint32 | value | ) |
| static

Returns the low surrogate code unit for the supplementary character.

Parameters

  value | The Unicode code point of the character.

Precondition
  IsSupplementary(wxUint32 value)

Since
  3.1.1

## ◆ operator char()

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.

## ◆ operator int()

wxUniChar::operator int | ( |  | ) | const

## ◆ operator long int()

wxUniChar::operator long int | ( |  | ) | const

## ◆ operator short int()

wxUniChar::operator short int | ( |  | ) | const

## ◆ operator unsigned char()

wxUniChar::operator unsigned char | ( |  | ) | const

## ◆ operator unsigned int()

wxUniChar::operator unsigned int | ( |  | ) | const

## ◆ operator unsigned long int()

wxUniChar::operator unsigned long int | ( |  | ) | const

## ◆ operator unsigned short int()

wxUniChar::operator unsigned short int | ( |  | ) | const

## ◆ operator wchar_t()

wxUniChar::operator wchar_t | ( |  | ) | const

## ◆ operator wxLongLong_t()

wxUniChar::operator wxLongLong_t | ( |  | ) | const

## ◆ operator wxULongLong_t()

wxUniChar::operator wxULongLong_t | ( |  | ) | const

## ◆ operator=() [1/13]

wxUniChar & wxUniChar::operator= | ( | char | c | ) |

## ◆ operator=() [2/13]

wxUniChar & wxUniChar::operator= | ( | const wxUniChar & | c | ) |

Assignment operators.

## ◆ operator=() [3/13]

wxUniChar & wxUniChar::operator= | ( | const wxUniCharRef & | c | ) |

## ◆ operator=() [4/13]

wxUniChar & wxUniChar::operator= | ( | int | c | ) |

## ◆ operator=() [5/13]

wxUniChar & wxUniChar::operator= | ( | long int | c | ) |

## ◆ operator=() [6/13]

wxUniChar & wxUniChar::operator= | ( | short int | c | ) |

## ◆ operator=() [7/13]

wxUniChar & wxUniChar::operator= | ( | unsigned char | c | ) |

## ◆ operator=() [8/13]

wxUniChar & wxUniChar::operator= | ( | unsigned int | c | ) |

## ◆ operator=() [9/13]

wxUniChar & wxUniChar::operator= | ( | unsigned long int | c | ) |

## ◆ operator=() [10/13]

wxUniChar & wxUniChar::operator= | ( | unsigned short int | c | ) |

## ◆ operator=() [11/13]

wxUniChar & wxUniChar::operator= | ( | wchar_t | c | ) |

## ◆ operator=() [12/13]

wxUniChar & wxUniChar::operator= | ( | wxLongLong_t | c | ) |

## ◆ operator=() [13/13]

wxUniChar & wxUniChar::operator= | ( | wxULongLong_t | c | ) |