QChar Class Reference

#include <qchar.h>

Class Description

+ Examples:

Definition at line 72 of file qchar.h.

Public Types

enum  SpecialCharacter {
  Null = 0x0000, Nbsp = 0x00a0, ReplacementCharacter = 0xfffd, ObjectReplacementCharacter = 0xfffc,
  ByteOrderMark = 0xfeff, ByteOrderSwapped = 0xfffe, ParagraphSeparator = 0x2029, LineSeparator = 0x2028
}
 
enum  Category {
  NoCategory, Mark_NonSpacing, Mark_SpacingCombining, Mark_Enclosing,
  Number_DecimalDigit, Number_Letter, Number_Other, Separator_Space,
  Separator_Line, Separator_Paragraph, Other_Control, Other_Format,
  Other_Surrogate, Other_PrivateUse, Other_NotAssigned, Letter_Uppercase,
  Letter_Lowercase, Letter_Titlecase, Letter_Modifier, Letter_Other,
  Punctuation_Connector, Punctuation_Dash, Punctuation_Open, Punctuation_Close,
  Punctuation_InitialQuote, Punctuation_FinalQuote, Punctuation_Other, Symbol_Math,
  Symbol_Currency, Symbol_Modifier, Symbol_Other, Punctuation_Dask = Punctuation_Dash
}
 
enum  Direction {
  DirL, DirR, DirEN, DirES,
  DirET, DirAN, DirCS, DirB,
  DirS, DirWS, DirON, DirLRE,
  DirLRO, DirAL, DirRLE, DirRLO,
  DirPDF, DirNSM, DirBN
}
 
enum  Decomposition {
  NoDecomposition, Canonical, Font, NoBreak,
  Initial, Medial, Final, Isolated,
  Circle, Super, Sub, Vertical,
  Wide, Narrow, Small, Square,
  Compat, Fraction
}
 
enum  Joining { OtherJoining, Dual, Right, Center }
 
enum  CombiningClass {
  Combining_BelowLeftAttached = 200, Combining_BelowAttached = 202, Combining_BelowRightAttached = 204, Combining_LeftAttached = 208,
  Combining_RightAttached = 210, Combining_AboveLeftAttached = 212, Combining_AboveAttached = 214, Combining_AboveRightAttached = 216,
  Combining_BelowLeft = 218, Combining_Below = 220, Combining_BelowRight = 222, Combining_Left = 224,
  Combining_Right = 226, Combining_AboveLeft = 228, Combining_Above = 230, Combining_AboveRight = 232,
  Combining_DoubleBelow = 233, Combining_DoubleAbove = 234, Combining_IotaSubscript = 240
}
 
enum  UnicodeVersion {
  Unicode_Unassigned, Unicode_1_1, Unicode_2_0, Unicode_2_1_2,
  Unicode_3_0, Unicode_3_1, Unicode_3_2, Unicode_4_0,
  Unicode_4_1, Unicode_5_0
}
 

Public Member Functions

 QChar ()
 
QT_ASCII_CAST_WARN_CONSTRUCTOR QChar (char c)
 
QT_ASCII_CAST_WARN_CONSTRUCTOR QChar (uchar c)
 
 QChar (QLatin1Char ch)
 
 QChar (uchar c, uchar r)
 
 QChar (ushort rc)
 
 QChar (short rc)
 
 QChar (uint rc)
 
 QChar (int rc)
 
 QChar (SpecialCharacter sc)
 
Category category () const
 
Direction direction () const
 
Joining joining () const
 
bool hasMirrored () const
 
unsigned char combiningClass () const
 
QChar mirroredChar () const
 
QString decomposition () const
 
Decomposition decompositionTag () const
 
int digitValue () const
 
QChar toLower () const
 
QChar toUpper () const
 
QChar toTitleCase () const
 
QChar toCaseFolded () const
 
UnicodeVersion unicodeVersion () const
 
char toAscii () const
 
char toLatin1 () const
 
ushort unicode () const
 
ushort & unicode ()
 
bool isNull () const
 
bool isPrint () const
 
bool isPunct () const
 
bool isSpace () const
 
bool isMark () const
 
bool isLetter () const
 
bool isNumber () const
 
bool isLetterOrNumber () const
 
bool isDigit () const
 
bool isSymbol () const
 
bool isLower () const
 
bool isUpper () const
 
bool isTitleCase () const
 
bool isHighSurrogate () const
 
bool isLowSurrogate () const
 
uchar cell () const
 
uchar row () const
 
void setCell (uchar cell)
 
void setRow (uchar row)
 

Static Public Member Functions

static QChar fromAscii (char c)
 
static QChar fromLatin1 (char c)
 
static bool isHighSurrogate (uint ucs4)
 
static bool isLowSurrogate (uint ucs4)
 
static bool requiresSurrogates (uint ucs4)
 
static uint surrogateToUcs4 (ushort high, ushort low)
 
static uint surrogateToUcs4 (QChar high, QChar low)
 
static ushort highSurrogate (uint ucs4)
 
static ushort lowSurrogate (uint ucs4)
 
static Category QT_FASTCALL category (uint ucs4)
 
static Category QT_FASTCALL category (ushort ucs2)
 
static Direction QT_FASTCALL direction (uint ucs4)
 
static Direction QT_FASTCALL direction (ushort ucs2)
 
static Joining QT_FASTCALL joining (uint ucs4)
 
static Joining QT_FASTCALL joining (ushort ucs2)
 
static unsigned char QT_FASTCALL combiningClass (uint ucs4)
 
static unsigned char QT_FASTCALL combiningClass (ushort ucs2)
 
static uint QT_FASTCALL mirroredChar (uint ucs4)
 
static ushort QT_FASTCALL mirroredChar (ushort ucs2)
 
static Decomposition QT_FASTCALL decompositionTag (uint ucs4)
 
static int QT_FASTCALL digitValue (uint ucs4)
 
static int QT_FASTCALL digitValue (ushort ucs2)
 
static uint QT_FASTCALL toLower (uint ucs4)
 
static ushort QT_FASTCALL toLower (ushort ucs2)
 
static uint QT_FASTCALL toUpper (uint ucs4)
 
static ushort QT_FASTCALL toUpper (ushort ucs2)
 
static uint QT_FASTCALL toTitleCase (uint ucs4)
 
static ushort QT_FASTCALL toTitleCase (ushort ucs2)
 
static uint QT_FASTCALL toCaseFolded (uint ucs4)
 
static ushort QT_FASTCALL toCaseFolded (ushort ucs2)
 
static UnicodeVersion QT_FASTCALL unicodeVersion (uint ucs4)
 
static UnicodeVersion QT_FASTCALL unicodeVersion (ushort ucs2)
 
static UnicodeVersion QT_FASTCALL currentUnicodeVersion ()
 
static QString QT_FASTCALL decomposition (uint ucs4)
 

Member Enumeration Documentation

Enumerator
Null 
Nbsp 
ReplacementCharacter 
ObjectReplacementCharacter 
ByteOrderMark 
ByteOrderSwapped 
ParagraphSeparator 
LineSeparator 

Definition at line 85 of file qchar.h.

85  {
86  Null = 0x0000,
87  Nbsp = 0x00a0,
88  ReplacementCharacter = 0xfffd,
90  ByteOrderMark = 0xfeff,
91  ByteOrderSwapped = 0xfffe,
92 #ifdef QT3_SUPPORT
93  null = Null,
94  replacement = ReplacementCharacter,
95  byteOrderMark = ByteOrderMark,
96  byteOrderSwapped = ByteOrderSwapped,
97  nbsp = Nbsp,
98 #endif
99  ParagraphSeparator = 0x2029,
100  LineSeparator = 0x2028
101  };
enum Category
Enumerator
NoCategory 
Mark_NonSpacing 
Mark_SpacingCombining 
Mark_Enclosing 
Number_DecimalDigit 
Number_Letter 
Number_Other 
Separator_Space 
Separator_Line 
Separator_Paragraph 
Other_Control 
Other_Format 
Other_Surrogate 
Other_PrivateUse 
Other_NotAssigned 
Letter_Uppercase 
Letter_Lowercase 
Letter_Titlecase 
Letter_Modifier 
Letter_Other 
Punctuation_Connector 
Punctuation_Dash 
Punctuation_Open 
Punctuation_Close 
Punctuation_InitialQuote 
Punctuation_FinalQuote 
Punctuation_Other 
Symbol_Math 
Symbol_Currency 
Symbol_Modifier 
Symbol_Other 
Punctuation_Dask 

Definition at line 106 of file qchar.h.

107  {
108  NoCategory, // ### Qt 5: replace with Other_NotAssigned
109 
110  Mark_NonSpacing, // Mn
111  Mark_SpacingCombining, // Mc
112  Mark_Enclosing, // Me
113 
114  Number_DecimalDigit, // Nd
115  Number_Letter, // Nl
116  Number_Other, // No
117 
118  Separator_Space, // Zs
119  Separator_Line, // Zl
120  Separator_Paragraph, // Zp
121 
122  Other_Control, // Cc
123  Other_Format, // Cf
124  Other_Surrogate, // Cs
125  Other_PrivateUse, // Co
126  Other_NotAssigned, // Cn
127 
128  Letter_Uppercase, // Lu
129  Letter_Lowercase, // Ll
130  Letter_Titlecase, // Lt
131  Letter_Modifier, // Lm
132  Letter_Other, // Lo
133 
134  Punctuation_Connector, // Pc
135  Punctuation_Dash, // Pd
136  Punctuation_Open, // Ps
137  Punctuation_Close, // Pe
140  Punctuation_Other, // Po
141 
142  Symbol_Math, // Sm
143  Symbol_Currency, // Sc
144  Symbol_Modifier, // Sk
145  Symbol_Other, // So
146 
147  Punctuation_Dask = Punctuation_Dash // ### Qt 5: remove
148  };
enum Direction
Enumerator
DirL 
DirR 
DirEN 
DirES 
DirET 
DirAN 
DirCS 
DirB 
DirS 
DirWS 
DirON 
DirLRE 
DirLRO 
DirAL 
DirRLE 
DirRLO 
DirPDF 
DirNSM 
DirBN 

Definition at line 150 of file qchar.h.

Enumerator
NoDecomposition 
Canonical 
Font 
NoBreak 
Initial 
Medial 
Final 
Isolated 
Circle 
Super 
Sub 
Vertical 
Wide 
Narrow 
Small 
Square 
Compat 
Fraction 

Definition at line 156 of file qchar.h.

157  {
159  Canonical,
160  Font,
161  NoBreak,
162  Initial,
163  Medial,
164  Final,
165  Isolated,
166  Circle,
167  Super,
168  Sub,
169  Vertical,
170  Wide,
171  Narrow,
172  Small,
173  Square,
174  Compat,
175  Fraction
176 
177 #ifdef QT3_SUPPORT
178  , Single = NoDecomposition
179 #endif
180  };
enum Joining
Enumerator
OtherJoining 
Dual 
Right 
Center 

Definition at line 182 of file qchar.h.

Enumerator
Combining_BelowLeftAttached 
Combining_BelowAttached 
Combining_BelowRightAttached 
Combining_LeftAttached 
Combining_RightAttached 
Combining_AboveLeftAttached 
Combining_AboveAttached 
Combining_AboveRightAttached 
Combining_BelowLeft 
Combining_Below 
Combining_BelowRight 
Combining_Left 
Combining_Right 
Combining_AboveLeft 
Combining_Above 
Combining_AboveRight 
Combining_DoubleBelow 
Combining_DoubleAbove 
Combining_IotaSubscript 

Definition at line 187 of file qchar.h.

188  {
197 
198  Combining_BelowLeft = 218,
199  Combining_Below = 220,
200  Combining_BelowRight = 222,
201  Combining_Left = 224,
202  Combining_Right = 226,
203  Combining_AboveLeft = 228,
204  Combining_Above = 230,
205  Combining_AboveRight = 232,
206 
207  Combining_DoubleBelow = 233,
208  Combining_DoubleAbove = 234,
210  };
Enumerator
Unicode_Unassigned 
Unicode_1_1 
Unicode_2_0 
Unicode_2_1_2 
Unicode_3_0 
Unicode_3_1 
Unicode_3_2 
Unicode_4_0 
Unicode_4_1 
Unicode_5_0 

Definition at line 212 of file qchar.h.

Constructor & Destructor Documentation

QChar ( )
inline

Definition at line 371 of file qchar.h.

371 : ucs(0) {}
QT_ASCII_CAST_WARN_CONSTRUCTOR QChar ( char  c)
QT_ASCII_CAST_WARN_CONSTRUCTOR QChar ( uchar  c)
QChar ( QLatin1Char  ch)
inline

Definition at line 385 of file qchar.h.

385 : ucs(ch.unicode()) {}
ushort unicode() const
Definition: qchar.h:64
QChar ( uchar  c,
uchar  r 
)
inline

Definition at line 380 of file qchar.h.

380 : ucs(ushort((r << 8) | c)){}
GLdouble GLdouble GLdouble r
Definition: GLee.h:1189
const GLubyte * c
Definition: GLee.h:5419
QChar ( ushort  rc)
inline

Definition at line 81 of file qchar.h.

81 : ucs(rc){}
QChar ( short  rc)
inline

Definition at line 381 of file qchar.h.

381 : ucs(ushort(rc)){}
QChar ( uint  rc)
inline

Definition at line 382 of file qchar.h.

382 : ucs(ushort(rc & 0xffff)){}
QChar ( int  rc)
inline

Definition at line 383 of file qchar.h.

383 : ucs(ushort(rc & 0xffff)){}
QChar ( SpecialCharacter  sc)
inline

Definition at line 384 of file qchar.h.

384 : ucs(ushort(s)) {}
GLdouble s
Definition: GLee.h:1173

Member Function Documentation

Category category ( ) const
Direction direction ( ) const
Joining joining ( ) const
bool hasMirrored ( ) const
unsigned char combiningClass ( ) const
QChar mirroredChar ( ) const
QString decomposition ( ) const
Decomposition decompositionTag ( ) const
int digitValue ( ) const
QChar toLower ( ) const
QChar toUpper ( ) const
QChar toTitleCase ( ) const
QChar toCaseFolded ( ) const
UnicodeVersion unicodeVersion ( ) const
char toAscii ( ) const
char toLatin1 ( ) const
inline

Definition at line 376 of file qchar.h.

376 { return ucs > 0xff ? '\0' : char(ucs); }
ushort unicode ( ) const
inline

Definition at line 251 of file qchar.h.

251 { return ucs; }
ushort& unicode ( )
inline

Definition at line 256 of file qchar.h.

256 { return ucs; }
static QChar fromAscii ( char  c)
static
QChar fromLatin1 ( char  c)
inlinestatic

Definition at line 378 of file qchar.h.

378 { return QChar(ushort(uchar(c))); }
QChar()
Definition: qchar.h:371
const GLubyte * c
Definition: GLee.h:5419
bool isNull ( ) const
inline

Definition at line 262 of file qchar.h.

262 { return ucs == 0; }
bool isPrint ( ) const
bool isPunct ( ) const
bool isSpace ( ) const
bool isMark ( ) const
bool isLetter ( ) const
bool isNumber ( ) const
bool isLetterOrNumber ( ) const
bool isDigit ( ) const
bool isSymbol ( ) const
bool isLower ( ) const
inline

Definition at line 272 of file qchar.h.

272 { return category() == Letter_Lowercase; }
Category category() const
bool isUpper ( ) const
inline

Definition at line 273 of file qchar.h.

273 { return category() == Letter_Uppercase; }
Category category() const
bool isTitleCase ( ) const
inline

Definition at line 274 of file qchar.h.

274 { return category() == Letter_Titlecase; }
Category category() const
bool isHighSurrogate ( ) const
inline

Definition at line 276 of file qchar.h.

276  {
277  return ((ucs & 0xfc00) == 0xd800);
278  }
bool isLowSurrogate ( ) const
inline

Definition at line 279 of file qchar.h.

279  {
280  return ((ucs & 0xfc00) == 0xdc00);
281  }
uchar cell ( ) const
inline

Definition at line 283 of file qchar.h.

283 { return uchar(ucs & 0xff); }
uchar row ( ) const
inline

Definition at line 284 of file qchar.h.

284 { return uchar((ucs>>8)&0xff); }
void setCell ( uchar  cell)
inline

Definition at line 387 of file qchar.h.

388 { ucs = ushort((ucs & 0xff00) + acell); }
void setRow ( uchar  row)
inline

Definition at line 389 of file qchar.h.

390 { ucs = ushort((ushort(arow)<<8) + (ucs&0xff)); }
static bool isHighSurrogate ( uint  ucs4)
inlinestatic

Definition at line 288 of file qchar.h.

288  {
289  return ((ucs4 & 0xfffffc00) == 0xd800);
290  }
static bool isLowSurrogate ( uint  ucs4)
inlinestatic

Definition at line 291 of file qchar.h.

291  {
292  return ((ucs4 & 0xfffffc00) == 0xdc00);
293  }
static bool requiresSurrogates ( uint  ucs4)
inlinestatic

Definition at line 294 of file qchar.h.

294  {
295  return (ucs4 >= 0x10000);
296  }
static uint surrogateToUcs4 ( ushort  high,
ushort  low 
)
inlinestatic

Definition at line 297 of file qchar.h.

297  {
298  return (uint(high)<<10) + low - 0x35fdc00;
299  }
static uint surrogateToUcs4 ( QChar  high,
QChar  low 
)
inlinestatic

Definition at line 300 of file qchar.h.

300  {
301  return (uint(high.ucs)<<10) + low.ucs - 0x35fdc00;
302  }
static ushort highSurrogate ( uint  ucs4)
inlinestatic

Definition at line 303 of file qchar.h.

303  {
304  return ushort((ucs4>>10) + 0xd7c0);
305  }
static ushort lowSurrogate ( uint  ucs4)
inlinestatic

Definition at line 306 of file qchar.h.

306  {
307  return ushort(ucs4%0x400 + 0xdc00);
308  }
static Category QT_FASTCALL category ( uint  ucs4)
static
static Category QT_FASTCALL category ( ushort  ucs2)
static
static Direction QT_FASTCALL direction ( uint  ucs4)
static
static Direction QT_FASTCALL direction ( ushort  ucs2)
static
static Joining QT_FASTCALL joining ( uint  ucs4)
static
static Joining QT_FASTCALL joining ( ushort  ucs2)
static
static unsigned char QT_FASTCALL combiningClass ( uint  ucs4)
static
static unsigned char QT_FASTCALL combiningClass ( ushort  ucs2)
static
static uint QT_FASTCALL mirroredChar ( uint  ucs4)
static
static ushort QT_FASTCALL mirroredChar ( ushort  ucs2)
static
static Decomposition QT_FASTCALL decompositionTag ( uint  ucs4)
static
static int QT_FASTCALL digitValue ( uint  ucs4)
static
static int QT_FASTCALL digitValue ( ushort  ucs2)
static
static uint QT_FASTCALL toLower ( uint  ucs4)
static
static ushort QT_FASTCALL toLower ( ushort  ucs2)
static
static uint QT_FASTCALL toUpper ( uint  ucs4)
static
static ushort QT_FASTCALL toUpper ( ushort  ucs2)
static
static uint QT_FASTCALL toTitleCase ( uint  ucs4)
static
static ushort QT_FASTCALL toTitleCase ( ushort  ucs2)
static
static uint QT_FASTCALL toCaseFolded ( uint  ucs4)
static
static ushort QT_FASTCALL toCaseFolded ( ushort  ucs2)
static
static UnicodeVersion QT_FASTCALL unicodeVersion ( uint  ucs4)
static
static UnicodeVersion QT_FASTCALL unicodeVersion ( ushort  ucs2)
static
static UnicodeVersion QT_FASTCALL currentUnicodeVersion ( )
static
static QString QT_FASTCALL decomposition ( uint  ucs4)
static

The documentation for this class was generated from the following file: