]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/unichar.h
479c44679e72bc73c0bbc08c01c302156d5dd881
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxUniChar
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
12 This class represents a single Unicode character. It can be converted to
13 and from @c char or @c wchar_t and implements commonly used character operations.
22 This is not wchar_t on purpose, it needs to represent the entire
23 Unicode code points range and wchar_t may be too small for that
24 (e.g. on Win32 where wchar_t* is encoded in UTF-16).
26 typedef wxUint32 value_type
;
35 Create the character from 8bit character value encoded in the current
39 wxUniChar(unsigned char c
);
43 wxUniChar(unsigned int c
);
44 wxUniChar(long int c
);
45 wxUniChar(unsigned long int c
);
46 wxUniChar(short int c
);
47 wxUniChar(unsigned short int c
);
49 wxUniChar(const wxUniCharRef
& c
);
52 Returns Unicode code point value of the character.
54 value_type
GetValue() const;
57 Returns true if the character is an ASCII character.
63 Conversions to char and wchar_t types: all of those are needed to be
64 able to pass wxUniChars to various standard narrow and wide character
67 operator char() const { return To8bit(m_value
); }
68 operator unsigned char() const { return (unsigned char)To8bit(m_value
); }
69 operator wchar_t() const { return (wchar_t)m_value
; }
70 operator int() const { return (int)m_value
; }
71 operator unsigned int() const { return (unsigned int)m_value
; }
72 operator long int() const { return (long int)m_value
; }
73 operator unsigned long int() const { return (unsigned long)m_value
; }
74 operator short int() const { return (short int)m_value
; }
75 operator unsigned short int() const { return (unsigned short int)m_value
; }
82 wxUniChar
& operator=(const wxUniChar
& c
);
83 wxUniChar
& operator=(const wxUniCharRef
& c
);
84 wxUniChar
& operator=(char c
);
85 wxUniChar
& operator=(unsigned char c
);
86 wxUniChar
& operator=(wchar_t c
);
87 wxUniChar
& operator=(int c
);
88 wxUniChar
& operator=(unsigned int c
);
89 wxUniChar
& operator=(long int c
);
90 wxUniChar
& operator=(unsigned long int c
);
91 wxUniChar
& operator=(short int c
);
92 wxUniChar
& operator=(unsigned short int c
);
100 Writeable reference to a character in wxString.
102 This class can be used in the same way wxChar is used, except that changing
103 its value updates the underlying string object.