wxUniChar Class Reference
[Data Structures]

#include <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
Category:  Data Structures

Public Types

typedef wxUint32 value_type
 A type capable of holding any Unicode code point.

Public Member Functions

 wxUniChar ()
 Default ctor.
 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 (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.
bool GetAsChar (char *c) const
 Returns true if the character is representable as a single byte in the current locale encoding.



 wxUniChar (char c)
 Create a character from the 8-bit character value c using the current locale encoding.
 wxUniChar (unsigned char c)
 Create a character from the 8-bit character value c using the current locale encoding.
 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
 Create a character from the 8-bit character value c using the current locale encoding.
 operator wchar_t () const
 Create a character from the 8-bit character value c using the current locale encoding.
 operator int () const
 Create a character from the 8-bit character value c using the current locale encoding.
 operator unsigned int () const
 Create a character from the 8-bit character value c using the current locale encoding.
 operator long int () const
 Create a character from the 8-bit character value c using the current locale encoding.
 operator unsigned long int () const
 Create a character from the 8-bit character value c using the current locale encoding.
 operator short int () const
 Create a character from the 8-bit character value c using the current locale encoding.
 operator unsigned short int () const
 Create a character from the 8-bit character value c using the current locale encoding.
wxUniCharoperator= (const wxUniChar &c)
 Assignment operators.
wxUniCharoperator= (const wxUniCharRef &c)
 Create a character from the 8-bit character value c using the current locale encoding.
wxUniCharoperator= (char c)
 Create a character from the 8-bit character value c using the current locale encoding.
wxUniCharoperator= (unsigned char c)
 Create a character from the 8-bit character value c using the current locale encoding.
wxUniCharoperator= (wchar_t c)
 Create a character from the 8-bit character value c using the current locale encoding.
wxUniCharoperator= (int c)
 Create a character from the 8-bit character value c using the current locale encoding.
wxUniCharoperator= (unsigned int c)
 Create a character from the 8-bit character value c using the current locale encoding.
wxUniCharoperator= (long int c)
 Create a character from the 8-bit character value c using the current locale encoding.
wxUniCharoperator= (unsigned long int c)
 Create a character from the 8-bit character value c using the current locale encoding.
wxUniCharoperator= (short int c)
 Create a character from the 8-bit character value c using the current locale encoding.
wxUniCharoperator= (unsigned short int c)
 Create a character from the 8-bit character value c using the current locale encoding.

List of all members.


Member Typedef Documentation

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::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 ( const wxUniCharRef c  ) 

Member Function Documentation

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
value_type wxUniChar::GetValue (  )  const

Returns Unicode code point value 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).

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

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

wxUniChar::operator long int (  )  const

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

wxUniChar::operator short int (  )  const

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

wxUniChar::operator unsigned char (  )  const

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

wxUniChar::operator unsigned int (  )  const

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

wxUniChar::operator unsigned long int (  )  const

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

wxUniChar::operator unsigned short int (  )  const

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

wxUniChar::operator wchar_t (  )  const

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

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

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

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

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

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

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

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

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

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

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

wxUniChar& wxUniChar::operator= ( int  c  ) 

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

wxUniChar& wxUniChar::operator= ( wchar_t  c  ) 

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

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

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

wxUniChar& wxUniChar::operator= ( char  c  ) 

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

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

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

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

Assignment operators.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines



wxWidgets logo

[ top ]