1 /****************************************************************************
2 **
3 ** DQt - D bindings for the Qt Toolkit
4 **
5 ** GNU Lesser General Public License Usage
6 ** This file may be used under the terms of the GNU Lesser
7 ** General Public License version 3 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
9 ** packaging of this file. Please review the following information to
10 ** ensure the GNU Lesser General Public License version 3 requirements
11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
12 **
13 ****************************************************************************/
14 module qt.core.qchar;
15 extern(C++):
16 
17 import core.stdc.stddef;
18 import qt.config;
19 import qt.core.global;
20 import qt.core.metatype;
21 import qt.core.string;
22 import qt.core.typeinfo;
23 import qt.helpers;
24 
25 /+ class QString; +/
26 
27 struct QLatin1Char
28 {
29 public:
30     /+ explicit +/pragma(inline, true) this(char c)/+ noexcept+/
31     {
32         this.ch = c;
33     }
34     pragma(inline, true) char toLatin1() const/+ noexcept+/ { return ch; }
35     pragma(inline, true) ushort unicode() const/+ noexcept+/ { return ushort(uchar(ch)); }
36 
37 private:
38     char ch;
39 }
40 
41 /+pragma(inline, true) bool operator ==(char lhs, QLatin1Char rhs)/+ noexcept+/ { return lhs == rhs.toLatin1(); }+/
42 /+pragma(inline, true) bool operator !=(char lhs, QLatin1Char rhs)/+ noexcept+/ { return lhs != rhs.toLatin1(); }+/
43 /+pragma(inline, true) bool operator <=(char lhs, QLatin1Char rhs)/+ noexcept+/ { return lhs <= rhs.toLatin1(); }+/
44 /+pragma(inline, true) bool operator >=(char lhs, QLatin1Char rhs)/+ noexcept+/ { return lhs >= rhs.toLatin1(); }+/
45 /+pragma(inline, true) bool operator < (char lhs, QLatin1Char rhs)/+ noexcept+/ { return lhs <  rhs.toLatin1(); }+/
46 /+pragma(inline, true) bool operator > (char lhs, QLatin1Char rhs)/+ noexcept+/ { return lhs >  rhs.toLatin1(); }+/
47 
48 /+pragma(inline, true) bool operator ==(QLatin1Char lhs, char rhs)/+ noexcept+/ { return lhs.toLatin1() == rhs; }+/
49 /+pragma(inline, true) bool operator !=(QLatin1Char lhs, char rhs)/+ noexcept+/ { return lhs.toLatin1() != rhs; }+/
50 /+pragma(inline, true) bool operator <=(QLatin1Char lhs, char rhs)/+ noexcept+/ { return lhs.toLatin1() <= rhs; }+/
51 /+pragma(inline, true) bool operator >=(QLatin1Char lhs, char rhs)/+ noexcept+/ { return lhs.toLatin1() >= rhs; }+/
52 /+pragma(inline, true) bool operator < (QLatin1Char lhs, char rhs)/+ noexcept+/ { return lhs.toLatin1() <  rhs; }+/
53 /+pragma(inline, true) bool operator > (QLatin1Char lhs, char rhs)/+ noexcept+/ { return lhs.toLatin1() >  rhs; }+/
54 
55 @(QMetaType.Type.QChar) @Q_MOVABLE_TYPE extern(C++, class) struct /+ Q_CORE_EXPORT +/ QChar {
56 public:
57     enum SpecialCharacter {
58         Null = 0x0000,
59         Tabulation = 0x0009,
60         LineFeed = 0x000a,
61         FormFeed = 0x000c,
62         CarriageReturn = 0x000d,
63         Space = 0x0020,
64         Nbsp = 0x00a0,
65         SoftHyphen = 0x00ad,
66         ReplacementCharacter = 0xfffd,
67         ObjectReplacementCharacter = 0xfffc,
68         ByteOrderMark = 0xfeff,
69         ByteOrderSwapped = 0xfffe,
70         ParagraphSeparator = 0x2029,
71         LineSeparator = 0x2028,
72         LastValidCodePoint = 0x10ffff
73     }
74 
75     /+this()/+ noexcept+/
76     {
77         this.ucs = 0;
78     }+/
79     this(ushort rc)/+ noexcept+/
80     {
81         this.ucs = rc;
82     } // implicit
83     this(uchar c, uchar r)/+ noexcept+/
84     {
85         this.ucs = cast(ushort)((r << 8) | c);
86     }
87     this(short rc)/+ noexcept+/
88     {
89         this.ucs = ushort(rc);
90     } // implicit
91     this(uint rc)/+ noexcept+/
92     {
93         this.ucs = cast(ushort)(rc & 0xffff);
94     }
95     this(int rc)/+ noexcept+/
96     {
97         this.ucs = cast(ushort)(rc & 0xffff);
98     }
99     this(SpecialCharacter s)/+ noexcept+/
100     {
101         this.ucs = cast(ushort)(s);
102     } // implicit
103     this(QLatin1Char ch)/+ noexcept+/
104     {
105         this.ucs = ch.unicode();
106     } // implicit
107 /+ #if defined(Q_COMPILER_UNICODE_STRINGS) +/
108     this(wchar ch)/+ noexcept+/
109     {
110         this.ucs = ushort(ch);
111     } // implicit
112 /+ #endif
113 #if defined(Q_OS_WIN) +/
114     static if((versionIsSet!("Windows") && !versionIsSet!("Cygwin")))
115     {
116         mixin(Q_STATIC_ASSERT(q{wchar_t.sizeof == ushort.sizeof}));
117     }
118 /+ #endif
119 #if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC)
120 #   if !defined(_WCHAR_T_DEFINED) || defined(_NATIVE_WCHAR_T_DEFINED)
121     QChar(wchar_t ch) noexcept : ucs(ushort(ch)) {} // implicit
122 #   endif
123 #endif
124 
125 #ifndef QT_NO_CAST_FROM_ASCII
126     QT_ASCII_CAST_WARN explicit QChar(char c) noexcept : ucs(uchar(c)) { }
127 #ifndef QT_RESTRICTED_CAST_FROM_ASCII
128     QT_ASCII_CAST_WARN explicit QChar(uchar c) noexcept : ucs(c) { }
129 #endif
130 #endif +/
131     this(char c)
132     {
133         this.ucs = c;
134     }
135     // Unicode information
136 
137     enum Category
138     {
139         Mark_NonSpacing,          //   Mn
140         Mark_SpacingCombining,    //   Mc
141         Mark_Enclosing,           //   Me
142 
143         Number_DecimalDigit,      //   Nd
144         Number_Letter,            //   Nl
145         Number_Other,             //   No
146 
147         Separator_Space,          //   Zs
148         Separator_Line,           //   Zl
149         Separator_Paragraph,      //   Zp
150 
151         Other_Control,            //   Cc
152         Other_Format,             //   Cf
153         Other_Surrogate,          //   Cs
154         Other_PrivateUse,         //   Co
155         Other_NotAssigned,        //   Cn
156 
157         Letter_Uppercase,         //   Lu
158         Letter_Lowercase,         //   Ll
159         Letter_Titlecase,         //   Lt
160         Letter_Modifier,          //   Lm
161         Letter_Other,             //   Lo
162 
163         Punctuation_Connector,    //   Pc
164         Punctuation_Dash,         //   Pd
165         Punctuation_Open,         //   Ps
166         Punctuation_Close,        //   Pe
167         Punctuation_InitialQuote, //   Pi
168         Punctuation_FinalQuote,   //   Pf
169         Punctuation_Other,        //   Po
170 
171         Symbol_Math,              //   Sm
172         Symbol_Currency,          //   Sc
173         Symbol_Modifier,          //   Sk
174         Symbol_Other              //   So
175     }
176 
177     enum Script
178     {
179         Script_Unknown,
180         Script_Inherited,
181         Script_Common,
182 
183         Script_Latin,
184         Script_Greek,
185         Script_Cyrillic,
186         Script_Armenian,
187         Script_Hebrew,
188         Script_Arabic,
189         Script_Syriac,
190         Script_Thaana,
191         Script_Devanagari,
192         Script_Bengali,
193         Script_Gurmukhi,
194         Script_Gujarati,
195         Script_Oriya,
196         Script_Tamil,
197         Script_Telugu,
198         Script_Kannada,
199         Script_Malayalam,
200         Script_Sinhala,
201         Script_Thai,
202         Script_Lao,
203         Script_Tibetan,
204         Script_Myanmar,
205         Script_Georgian,
206         Script_Hangul,
207         Script_Ethiopic,
208         Script_Cherokee,
209         Script_CanadianAboriginal,
210         Script_Ogham,
211         Script_Runic,
212         Script_Khmer,
213         Script_Mongolian,
214         Script_Hiragana,
215         Script_Katakana,
216         Script_Bopomofo,
217         Script_Han,
218         Script_Yi,
219         Script_OldItalic,
220         Script_Gothic,
221         Script_Deseret,
222         Script_Tagalog,
223         Script_Hanunoo,
224         Script_Buhid,
225         Script_Tagbanwa,
226         Script_Coptic,
227 
228         // Unicode 4.0 additions
229         Script_Limbu,
230         Script_TaiLe,
231         Script_LinearB,
232         Script_Ugaritic,
233         Script_Shavian,
234         Script_Osmanya,
235         Script_Cypriot,
236         Script_Braille,
237 
238         // Unicode 4.1 additions
239         Script_Buginese,
240         Script_NewTaiLue,
241         Script_Glagolitic,
242         Script_Tifinagh,
243         Script_SylotiNagri,
244         Script_OldPersian,
245         Script_Kharoshthi,
246 
247         // Unicode 5.0 additions
248         Script_Balinese,
249         Script_Cuneiform,
250         Script_Phoenician,
251         Script_PhagsPa,
252         Script_Nko,
253 
254         // Unicode 5.1 additions
255         Script_Sundanese,
256         Script_Lepcha,
257         Script_OlChiki,
258         Script_Vai,
259         Script_Saurashtra,
260         Script_KayahLi,
261         Script_Rejang,
262         Script_Lycian,
263         Script_Carian,
264         Script_Lydian,
265         Script_Cham,
266 
267         // Unicode 5.2 additions
268         Script_TaiTham,
269         Script_TaiViet,
270         Script_Avestan,
271         Script_EgyptianHieroglyphs,
272         Script_Samaritan,
273         Script_Lisu,
274         Script_Bamum,
275         Script_Javanese,
276         Script_MeeteiMayek,
277         Script_ImperialAramaic,
278         Script_OldSouthArabian,
279         Script_InscriptionalParthian,
280         Script_InscriptionalPahlavi,
281         Script_OldTurkic,
282         Script_Kaithi,
283 
284         // Unicode 6.0 additions
285         Script_Batak,
286         Script_Brahmi,
287         Script_Mandaic,
288 
289         // Unicode 6.1 additions
290         Script_Chakma,
291         Script_MeroiticCursive,
292         Script_MeroiticHieroglyphs,
293         Script_Miao,
294         Script_Sharada,
295         Script_SoraSompeng,
296         Script_Takri,
297 
298         // Unicode 7.0 additions
299         Script_CaucasianAlbanian,
300         Script_BassaVah,
301         Script_Duployan,
302         Script_Elbasan,
303         Script_Grantha,
304         Script_PahawhHmong,
305         Script_Khojki,
306         Script_LinearA,
307         Script_Mahajani,
308         Script_Manichaean,
309         Script_MendeKikakui,
310         Script_Modi,
311         Script_Mro,
312         Script_OldNorthArabian,
313         Script_Nabataean,
314         Script_Palmyrene,
315         Script_PauCinHau,
316         Script_OldPermic,
317         Script_PsalterPahlavi,
318         Script_Siddham,
319         Script_Khudawadi,
320         Script_Tirhuta,
321         Script_WarangCiti,
322 
323         // Unicode 8.0 additions
324         Script_Ahom,
325         Script_AnatolianHieroglyphs,
326         Script_Hatran,
327         Script_Multani,
328         Script_OldHungarian,
329         Script_SignWriting,
330 
331         // Unicode 9.0 additions
332         Script_Adlam,
333         Script_Bhaiksuki,
334         Script_Marchen,
335         Script_Newa,
336         Script_Osage,
337         Script_Tangut,
338 
339         // Unicode 10.0 additions
340         Script_MasaramGondi,
341         Script_Nushu,
342         Script_Soyombo,
343         Script_ZanabazarSquare,
344 
345         // Unicode 12.1 additions
346         Script_Dogra,
347         Script_GunjalaGondi,
348         Script_HanifiRohingya,
349         Script_Makasar,
350         Script_Medefaidrin,
351         Script_OldSogdian,
352         Script_Sogdian,
353         Script_Elymaic,
354         Script_Nandinagari,
355         Script_NyiakengPuachueHmong,
356         Script_Wancho,
357 
358         // Unicode 13.0 additions
359         Script_Chorasmian,
360         Script_DivesAkuru,
361         Script_KhitanSmallScript,
362         Script_Yezidi,
363 
364         ScriptCount
365     }
366 
367     enum Direction
368     {
369         DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON,
370         DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN,
371         DirLRI, DirRLI, DirFSI, DirPDI
372     }
373 
374     enum Decomposition
375     {
376         NoDecomposition,
377         Canonical,
378         Font,
379         NoBreak,
380         Initial,
381         Medial,
382         Final,
383         Isolated,
384         Circle,
385         Super,
386         Sub,
387         Vertical,
388         Wide,
389         Narrow,
390         Small,
391         Square,
392         Compat,
393         Fraction
394     }
395 
396     enum JoiningType {
397         Joining_None,
398         Joining_Causing,
399         Joining_Dual,
400         Joining_Right,
401         Joining_Left,
402         Joining_Transparent
403     }
404 
405 /+ #if QT_DEPRECATED_SINCE(5, 3) +/
406     enum Joining
407     {
408         OtherJoining, Dual, Right, Center
409     }
410 /+ #endif +/
411 
412     enum CombiningClass
413     {
414         Combining_BelowLeftAttached       = 200,
415         Combining_BelowAttached           = 202,
416         Combining_BelowRightAttached      = 204,
417         Combining_LeftAttached            = 208,
418         Combining_RightAttached           = 210,
419         Combining_AboveLeftAttached       = 212,
420         Combining_AboveAttached           = 214,
421         Combining_AboveRightAttached      = 216,
422 
423         Combining_BelowLeft               = 218,
424         Combining_Below                   = 220,
425         Combining_BelowRight              = 222,
426         Combining_Left                    = 224,
427         Combining_Right                   = 226,
428         Combining_AboveLeft               = 228,
429         Combining_Above                   = 230,
430         Combining_AboveRight              = 232,
431 
432         Combining_DoubleBelow             = 233,
433         Combining_DoubleAbove             = 234,
434         Combining_IotaSubscript           = 240
435     }
436 
437     enum UnicodeVersion {
438         Unicode_Unassigned,
439         Unicode_1_1,
440         Unicode_2_0,
441         Unicode_2_1_2,
442         Unicode_3_0,
443         Unicode_3_1,
444         Unicode_3_2,
445         Unicode_4_0,
446         Unicode_4_1,
447         Unicode_5_0,
448         Unicode_5_1,
449         Unicode_5_2,
450         Unicode_6_0,
451         Unicode_6_1,
452         Unicode_6_2,
453         Unicode_6_3,
454         Unicode_7_0,
455         Unicode_8_0,
456         Unicode_9_0,
457         Unicode_10_0,
458         Unicode_11_0,
459         Unicode_12_0,
460         Unicode_12_1,
461         Unicode_13_0
462     }
463     // ****** WHEN ADDING FUNCTIONS, CONSIDER ADDING TO QCharRef TOO
464 
465 /+    pragma(inline, true) Category category() const/+ noexcept+/ { return QChar.category(ucs); }
466     pragma(inline, true) Direction direction() const/+ noexcept+/ { return QChar.direction(ucs); }
467     pragma(inline, true) JoiningType joiningType() const/+ noexcept+/ { return QChar.joiningType(ucs); }
468 /+ #if QT_DEPRECATED_SINCE(5, 3) +/
469     /+ QT_DEPRECATED +/ pragma(inline, true) Joining joining() const/+ noexcept+/
470     {
471         switch (QChar.joiningType(ucs)) {
472         case QChar.JoiningType.Joining_Causing: return QChar.Joining.Center;
473         case QChar.JoiningType.Joining_Dual: return QChar.Joining.Dual;
474         case QChar.JoiningType.Joining_Right: return QChar.Joining.Right;
475         case QChar.JoiningType.Joining_None:
476         case QChar.JoiningType.Joining_Left:
477         case QChar.JoiningType.Joining_Transparent:
478         default: return QChar.Joining.OtherJoining;
479         }
480     }
481 /+ #endif +/
482     pragma(inline, true) ubyte  combiningClass() const/+ noexcept+/ { return QChar.combiningClass(ucs); }
483 
484     pragma(inline, true) QChar mirroredChar() const/+ noexcept+/ { return QChar(QChar.mirroredChar(ucs)); }
485     pragma(inline, true) bool hasMirrored() const/+ noexcept+/ { return QChar.hasMirrored(ucs); }
486 
487     QString decomposition() const;
488     pragma(inline, true) Decomposition decompositionTag() const/+ noexcept+/ { return QChar.decompositionTag(ucs); }
489 
490     pragma(inline, true) int digitValue() const/+ noexcept+/ { return QChar.digitValue(ucs); }
491     pragma(inline, true) QChar toLower() const/+ noexcept+/ { return QChar(QChar.toLower(ucs)); }
492     pragma(inline, true) QChar toUpper() const/+ noexcept+/ { return QChar(QChar.toUpper(ucs)); }
493     pragma(inline, true) QChar toTitleCase() const/+ noexcept+/ { return QChar(QChar.toTitleCase(ucs)); }
494     pragma(inline, true) QChar toCaseFolded() const/+ noexcept+/ { return QChar(QChar.toCaseFolded(ucs)); }
495 
496     pragma(inline, true) Script script() const/+ noexcept+/ { return QChar.script(ucs); }
497 
498     pragma(inline, true) UnicodeVersion unicodeVersion() const/+ noexcept+/ { return QChar.unicodeVersion(ucs); }+/
499 
500 /+ #if QT_DEPRECATED_SINCE(5, 0)
501     QT_DEPRECATED inline char toAscii() const noexcept { return toLatin1(); }
502 #endif +/
503     pragma(inline, true) char toLatin1() const/+ noexcept+/ { return ucs > 0xff ? '\0' : cast(char)(ucs); }
504     pragma(inline, true) ushort unicode() const/+ noexcept+/ { return ucs; }
505     pragma(inline, true) ref ushort unicode()/+ noexcept+/ return { return ucs; }
506 
507 /+ #if QT_DEPRECATED_SINCE(5, 0)
508     QT_DEPRECATED static inline QChar fromAscii(char c) noexcept
509     { return fromLatin1(c); }
510 #endif +/
511     pragma(inline, true) static QChar fromLatin1(char c)/+ noexcept+/ { return QChar(ushort(uchar(c))); }
512 
513     pragma(inline, true) bool isNull() const/+ noexcept+/ { return ucs == 0; }
514 
515 /+    pragma(inline, true) bool isPrint() const/+ noexcept+/ { return QChar.isPrint(ucs); }
516     pragma(inline, true) bool isSpace() const/+ noexcept+/ { return QChar.isSpace(ucs); }
517     pragma(inline, true) bool isMark() const/+ noexcept+/ { return QChar.isMark(ucs); }
518     pragma(inline, true) bool isPunct() const/+ noexcept+/ { return QChar.isPunct(ucs); }
519     pragma(inline, true) bool isSymbol() const/+ noexcept+/ { return QChar.isSymbol(ucs); }
520     pragma(inline, true) bool isLetter() const/+ noexcept+/ { return QChar.isLetter(ucs); }
521     pragma(inline, true) bool isNumber() const/+ noexcept+/ { return QChar.isNumber(ucs); }
522     pragma(inline, true) bool isLetterOrNumber() const/+ noexcept+/ { return QChar.isLetterOrNumber(ucs); }
523     pragma(inline, true) bool isDigit() const/+ noexcept+/ { return QChar.isDigit(ucs); }
524     pragma(inline, true) bool isLower() const/+ noexcept+/ { return QChar.isLower(ucs); }
525     pragma(inline, true) bool isUpper() const/+ noexcept+/ { return QChar.isUpper(ucs); }
526     pragma(inline, true) bool isTitleCase() const/+ noexcept+/ { return QChar.isTitleCase(ucs); }
527 
528     pragma(inline, true) bool isNonCharacter() const/+ noexcept+/ { return QChar.isNonCharacter(ucs); }
529     pragma(inline, true) bool isHighSurrogate() const/+ noexcept+/ { return QChar.isHighSurrogate(ucs); }
530     pragma(inline, true) bool isLowSurrogate() const/+ noexcept+/ { return QChar.isLowSurrogate(ucs); }
531     pragma(inline, true) bool isSurrogate() const/+ noexcept+/ { return QChar.isSurrogate(ucs); }
532 
533     pragma(inline, true) uchar cell() const/+ noexcept+/ { return cast(uchar)(ucs & 0xff); }
534     pragma(inline, true) uchar row() const/+ noexcept+/ { return cast(uchar)((ucs>>8)&0xff); }
535     pragma(inline, true) void setCell(uchar acell)/+ noexcept+/ { ucs = cast(ushort)((ucs & 0xff00) + acell); }
536     pragma(inline, true) void setRow(uchar arow)/+ noexcept+/ { ucs = cast(ushort)((ushort(arow)<<8) + (ucs&0xff)); }+/
537 
538     pragma(inline, true) static bool isNonCharacter(uint ucs4)/+ noexcept+/
539     {
540         return ucs4 >= 0xfdd0 && (ucs4 <= 0xfdef || (ucs4 & 0xfffe) == 0xfffe);
541     }
542     pragma(inline, true) static bool isHighSurrogate(uint ucs4)/+ noexcept+/
543     {
544         return ((ucs4 & 0xfffffc00) == 0xd800);
545     }
546     pragma(inline, true) static bool isLowSurrogate(uint ucs4)/+ noexcept+/
547     {
548         return ((ucs4 & 0xfffffc00) == 0xdc00);
549     }
550     pragma(inline, true) static bool isSurrogate(uint ucs4)/+ noexcept+/
551     {
552         return (ucs4 - 0xd800u < 2048u);
553     }
554     pragma(inline, true) static bool requiresSurrogates(uint ucs4)/+ noexcept+/
555     {
556         return (ucs4 >= 0x10000);
557     }
558     pragma(inline, true) static uint surrogateToUcs4(ushort high, ushort low)/+ noexcept+/
559     {
560         return (uint(high)<<10) + low - 0x35fdc00;
561     }
562     pragma(inline, true) static uint surrogateToUcs4(QChar high, QChar low)/+ noexcept+/
563     {
564         return surrogateToUcs4(high.ucs, low.ucs);
565     }
566     pragma(inline, true) static ushort highSurrogate(uint ucs4)/+ noexcept+/
567     {
568         return cast(ushort)((ucs4>>10) + 0xd7c0);
569     }
570     pragma(inline, true) static ushort lowSurrogate(uint ucs4)/+ noexcept+/
571     {
572         return cast(ushort)(ucs4%0x400 + 0xdc00);
573     }
574 
575 /+    static Category /+ QT_FASTCALL +/ category(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
576     static Direction /+ QT_FASTCALL +/ direction(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
577     static JoiningType /+ QT_FASTCALL +/ joiningType(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
578 /+ #if QT_DEPRECATED_SINCE(5, 3) +/
579     /+ QT_DEPRECATED +/ static Joining /+ QT_FASTCALL +/ joining(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
580 /+ #endif +/
581     static ubyte  /+ QT_FASTCALL +/ combiningClass(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
582 
583     static uint /+ QT_FASTCALL +/ mirroredChar(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
584     static bool /+ QT_FASTCALL +/ hasMirrored(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
585 
586     static QString /+ QT_FASTCALL +/ decomposition(uint ucs4);
587     static Decomposition /+ QT_FASTCALL +/ decompositionTag(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
588 
589     static int /+ QT_FASTCALL +/ digitValue(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
590     static uint /+ QT_FASTCALL +/ toLower(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
591     static uint /+ QT_FASTCALL +/ toUpper(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
592     static uint /+ QT_FASTCALL +/ toTitleCase(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
593     static uint /+ QT_FASTCALL +/ toCaseFolded(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
594 
595     static Script /+ QT_FASTCALL +/ script(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
596 
597     static UnicodeVersion /+ QT_FASTCALL +/ unicodeVersion(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
598 
599     static UnicodeVersion /+ QT_FASTCALL +/ currentUnicodeVersion()/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
600 
601     static bool /+ QT_FASTCALL +/ isPrint(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
602     pragma(inline, true) static bool isSpace(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/
603     __attribute__((const))+/    {
604         // note that [0x09..0x0d] + 0x85 are exceptional Cc-s and must be handled explicitly
605         return ucs4 == 0x20 || (ucs4 <= 0x0d && ucs4 >= 0x09)
606                 || (ucs4 > 127 && (ucs4 == 0x85 || ucs4 == 0xa0 || QChar.isSpace_helper(ucs4)));
607     }
608     static bool /+ QT_FASTCALL +/ isMark(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
609     static bool /+ QT_FASTCALL +/ isPunct(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
610     static bool /+ QT_FASTCALL +/ isSymbol(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
611     pragma(inline, true) static bool isLetter(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/
612     __attribute__((const))+/    {
613         return (ucs4 >= 'A' && ucs4 <= 'z' && (ucs4 >= 'a' || ucs4 <= 'Z'))
614                 || (ucs4 > 127 && QChar.isLetter_helper(ucs4));
615     }
616     pragma(inline, true) static bool isNumber(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/
617     __attribute__((const))+/    { return (ucs4 <= '9' && ucs4 >= '0') || (ucs4 > 127 && QChar.isNumber_helper(ucs4)); }
618     pragma(inline, true) static bool isLetterOrNumber(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/
619     __attribute__((const))+/    {
620         return (ucs4 >= 'A' && ucs4 <= 'z' && (ucs4 >= 'a' || ucs4 <= 'Z'))
621                 || (ucs4 >= '0' && ucs4 <= '9')
622                 || (ucs4 > 127 && QChar.isLetterOrNumber_helper(ucs4));
623     }
624     pragma(inline, true) static bool isDigit(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/
625     __attribute__((const))+/    { return (ucs4 <= '9' && ucs4 >= '0') || (ucs4 > 127 && QChar.category(ucs4) == Category.Number_DecimalDigit); }
626     pragma(inline, true) static bool isLower(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/
627     __attribute__((const))+/    { return (ucs4 <= 'z' && ucs4 >= 'a') || (ucs4 > 127 && QChar.category(ucs4) == Category.Letter_Lowercase); }
628     pragma(inline, true) static bool isUpper(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/
629     __attribute__((const))+/    { return (ucs4 <= 'Z' && ucs4 >= 'A') || (ucs4 > 127 && QChar.category(ucs4) == Category.Letter_Uppercase); }
630     pragma(inline, true) static bool isTitleCase(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/
631     __attribute__((const))+/    { return ucs4 > 127 && QChar.category(ucs4) == Category.Letter_Titlecase; }
632 +/
633 private:
634 /*    static bool /+ QT_FASTCALL +/ isSpace_helper(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
635     static bool /+ QT_FASTCALL +/ isLetter_helper(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
636     static bool /+ QT_FASTCALL +/ isNumber_helper(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
637     static bool /+ QT_FASTCALL +/ isLetterOrNumber_helper(uint ucs4)/+ noexcept /+ Q_DECL_CONST_FUNCTION +/__attribute__((const))+/;
638 */
639 /+ #ifdef QT_NO_CAST_FROM_ASCII +/
640     //this(char c)/+ noexcept+/;
641     //this(uchar c)/+ noexcept+/;
642 /+ #endif +/
643 
644     /+ friend bool operator==(QChar, QChar) noexcept; +/
645     /+ friend bool operator< (QChar, QChar) noexcept; +/
646     ushort ucs = 0;
647 }
648 
649 /+ Q_DECLARE_TYPEINFO(QChar, Q_MOVABLE_TYPE); +/
650 
651 /+pragma(inline, true) bool operator ==(QChar c1, QChar c2)/+ noexcept+/ { return c1.ucs == c2.ucs; }+/
652 /+pragma(inline, true) bool operator < (QChar c1, QChar c2)/+ noexcept+/ { return c1.ucs <  c2.ucs; }+/
653 
654 /+pragma(inline, true) bool operator !=(QChar c1, QChar c2)/+ noexcept+/ { return !operator==(c1, c2); }+/
655 /+pragma(inline, true) bool operator >=(QChar c1, QChar c2)/+ noexcept+/ { return !operator< (c1, c2); }+/
656 /+pragma(inline, true) bool operator > (QChar c1, QChar c2)/+ noexcept+/ { return  operator< (c2, c1); }+/
657 /+pragma(inline, true) bool operator <=(QChar c1, QChar c2)/+ noexcept+/ { return !operator< (c2, c1); }+/
658 
659 
660 /+pragma(inline, true) bool operator ==(QChar lhs, /+ std:: +/nullptr_t)/+ noexcept+/ { return lhs.isNull(); }+/
661 /+pragma(inline, true) bool operator < (QChar,     /+ std:: +/nullptr_t)/+ noexcept+/ { return false; }+/
662 /+pragma(inline, true) bool operator ==(/+ std:: +/nullptr_t, QChar rhs)/+ noexcept+/ { return rhs.isNull(); }+/
663 /+pragma(inline, true) bool operator < (/+ std:: +/nullptr_t, QChar rhs)/+ noexcept+/ { return !rhs.isNull(); }+/
664 
665 /+pragma(inline, true) bool operator !=(QChar lhs, /+ std:: +/nullptr_t)/+ noexcept+/ { return !operator==(lhs, null); }+/
666 /+pragma(inline, true) bool operator >=(QChar lhs, /+ std:: +/nullptr_t)/+ noexcept+/ { return !operator< (lhs, null); }+/
667 /+pragma(inline, true) bool operator > (QChar lhs, /+ std:: +/nullptr_t)/+ noexcept+/ { return  operator< (null, lhs); }+/
668 /+pragma(inline, true) bool operator <=(QChar lhs, /+ std:: +/nullptr_t)/+ noexcept+/ { return !operator< (null, lhs); }+/
669 
670 /+pragma(inline, true) bool operator !=(/+ std:: +/nullptr_t, QChar rhs)/+ noexcept+/ { return !operator==(null, rhs); }+/
671 /+pragma(inline, true) bool operator >=(/+ std:: +/nullptr_t, QChar rhs)/+ noexcept+/ { return !operator< (null, rhs); }+/
672 /+pragma(inline, true) bool operator > (/+ std:: +/nullptr_t, QChar rhs)/+ noexcept+/ { return  operator< (rhs, null); }+/
673 /+pragma(inline, true) bool operator <=(/+ std:: +/nullptr_t, QChar rhs)/+ noexcept+/ { return !operator< (rhs, null); }+/
674 
675 /+ #ifndef QT_NO_DATASTREAM
676 Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, QChar);
677 Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QChar &);
678 #endif +/
679