Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qunicodetables_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: Unicode-3.0
3
4/* This file is autogenerated from the Unicode 15.1 database. Do not edit */
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists for the convenience
11// of internal files. This header file may change from version to version
12// without notice, or even be removed.
13//
14// We mean it.
15//
16
17#ifndef QUNICODETABLES_P_H
18#define QUNICODETABLES_P_H
19
20#include <QtCore/private/qglobal_p.h>
21
22#include <QtCore/qchar.h>
23
25
26#define UNICODE_DATA_VERSION QChar::Unicode_15_1
27
28namespace QUnicodeTables {
29
38
39struct Properties {
40 ushort category : 5;
41 ushort direction : 5;
42 ushort emojiFlags : 6; /* 5 used */
43 ushort combiningClass : 8;
44 ushort joining : 3;
45 signed short digitValue : 5;
46 signed short mirrorDiff : 16;
47 ushort unicodeVersion : 5; /* 5 used */
48 ushort eastAsianWidth : 3; /* 3 used */
49 ushort nfQuickCheck : 8;
50#ifdef Q_OS_WASM
51 unsigned char : 0; //wasm 64 packing trick
52#endif
53 struct {
54 ushort special : 1;
55 signed short diff : 15;
56 } cases[NumCases];
57#ifdef Q_OS_WASM
58 unsigned char : 0; //wasm 64 packing trick
59#endif
60 ushort graphemeBreakClass : 5; /* 5 used */
61 ushort wordBreakClass : 5; /* 5 used */
62 ushort lineBreakClass : 6; /* 6 used */
63 ushort sentenceBreakClass : 4; /* 4 used */
64 ushort idnaStatus : 4; /* 3 used */
65 ushort script : 8;
66};
67
68Q_CORE_EXPORT const Properties * QT_FASTCALL properties(char32_t ucs4) noexcept;
69Q_CORE_EXPORT const Properties * QT_FASTCALL properties(char16_t ucs2) noexcept;
70
71static_assert(sizeof(Properties) == 20);
72
73enum class EastAsianWidth : unsigned int {
74 A,
75 F,
76 H,
77 N,
78 Na,
79 W,
80};
81
101
125
144
145// see http://www.unicode.org/reports/tr14/tr14-30.html
146// we don't use the XX, AK, AP, AS and AI classes and map them to AL instead.
147// VI and VF classes are mapped to CM.
162
163enum class IdnaStatus : unsigned int {
165 Valid,
166 Ignored,
167 Mapped,
169};
170
171enum class EmojiFlags : uchar {
172 NoEmoji = 0,
173 Emoji = 1,
175 Emoji_Modifier = 4,
177 Emoji_Component = 16
178};
179
180Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(char32_t ucs4) noexcept;
181inline GraphemeBreakClass graphemeBreakClass(QChar ch) noexcept
182{ return graphemeBreakClass(ch.unicode()); }
183
184Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(char32_t ucs4) noexcept;
185inline WordBreakClass wordBreakClass(QChar ch) noexcept
186{ return wordBreakClass(ch.unicode()); }
187
188Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(char32_t ucs4) noexcept;
189inline SentenceBreakClass sentenceBreakClass(QChar ch) noexcept
190{ return sentenceBreakClass(ch.unicode()); }
191
192Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(char32_t ucs4) noexcept;
193inline LineBreakClass lineBreakClass(QChar ch) noexcept
194{ return lineBreakClass(ch.unicode()); }
195
196Q_CORE_EXPORT IdnaStatus QT_FASTCALL idnaStatus(char32_t ucs4) noexcept;
197inline IdnaStatus idnaStatus(QChar ch) noexcept
198{ return idnaStatus(ch.unicode()); }
199
200Q_CORE_EXPORT QStringView QT_FASTCALL idnaMapping(char32_t usc4) noexcept;
201inline QStringView idnaMapping(QChar ch) noexcept
202{ return idnaMapping(ch.unicode()); }
203
204Q_CORE_EXPORT EastAsianWidth QT_FASTCALL eastAsianWidth(char32_t ucs4) noexcept;
205inline EastAsianWidth eastAsianWidth(QChar ch) noexcept
206{ return eastAsianWidth(ch.unicode()); }
207
208} // namespace QUnicodeTables
209
210QT_END_NAMESPACE
211
212#endif // QUNICODETABLES_P_H
\inmodule QtCore\reentrant
Definition qdatastream.h:47
Combined button and popup list for selecting options.
EastAsianWidth eastAsianWidth(QChar ch) noexcept
GraphemeBreakClass graphemeBreakClass(QChar ch) noexcept
IdnaStatus idnaStatus(QChar ch) noexcept
@ GraphemeBreak_Extended_Pictographic
LineBreakClass lineBreakClass(QChar ch) noexcept
SentenceBreakClass sentenceBreakClass(QChar ch) noexcept
static constexpr unsigned short specialCaseMap[]
WordBreakClass wordBreakClass(QChar ch) noexcept
constexpr unsigned int MaxSpecialCaseLength
QStringView idnaMapping(QChar ch) noexcept
static constexpr unsigned short uc_ligature_map[]
constexpr QLatin1Char operator""_L1(char ch) noexcept
Definition qchar.h:692
Definition qcompare.h:72
bool operator<(const UCS2SurrogatePair &ligature, char32_t u1)
Definition qchar.cpp:1910
static constexpr quint32 Hangul_VCount
Definition qchar.cpp:1391
static constexpr char32_t Hangul_SBase
Definition qchar.cpp:1386
static constexpr char32_t Hangul_VBase
Definition qchar.cpp:1388
bool operator<(ushort u1, const UCS2Pair &ligature)
Definition qchar.cpp:1896
#define FLAG(x)
Definition qchar.cpp:15
static constexpr quint32 Hangul_LCount
Definition qchar.cpp:1390
static char32_t ligatureHelper(char32_t u1, char32_t u2)
Definition qchar.cpp:1913
bool operator<(const UCS2Pair &ligature, ushort u1)
Definition qchar.cpp:1898
static void canonicalOrderHelper(QString *str, QChar::UnicodeVersion version, qsizetype from)
Definition qchar.cpp:2013
static constexpr char32_t Hangul_LBase
Definition qchar.cpp:1387
static constexpr char32_t Hangul_TBase
Definition qchar.cpp:1389
bool operator<(char32_t u1, const UCS2SurrogatePair &ligature)
Definition qchar.cpp:1908
static Q_DECL_CONST_FUNCTION T convertCase_helper(T uc, QUnicodeTables::Case which) noexcept
Definition qchar.cpp:1584
static char32_t foldCase(char32_t ch, char32_t &last) noexcept
Definition qchar.cpp:1681
bool operator<(const UCS2SurrogatePair &ligature1, const UCS2SurrogatePair &ligature2)
Definition qchar.cpp:1906
bool operator<(const UCS2Pair &ligature1, const UCS2Pair &ligature2)
Definition qchar.cpp:1894
static auto fullConvertCase(char32_t uc, QUnicodeTables::Case which) noexcept
Definition qchar.cpp:1549
static constexpr quint32 Hangul_NCount
Definition qchar.cpp:1393
static void decomposeHelper(QString *str, bool canonical, QChar::UnicodeVersion version, qsizetype from)
Definition qchar.cpp:1853
static void composeHelper(QString *str, QChar::UnicodeVersion version, qsizetype from)
Definition qchar.cpp:1953
static constexpr quint32 Hangul_SCount
Definition qchar.cpp:1394
static bool normalizationQuickCheckHelper(QString *str, QString::NormalizationForm mode, qsizetype from, qsizetype *lastStable)
Definition qchar.cpp:2095
static QChar foldCase(QChar ch) noexcept
Definition qchar.cpp:1695
static constexpr quint32 Hangul_TCount
Definition qchar.cpp:1392
static char16_t foldCase(char16_t ch) noexcept
Definition qchar.cpp:1690
static char32_t foldCase(const char16_t *ch, const char16_t *start)
Definition qchar.cpp:1673
#define QT_CHAR_FASTCALL
Definition qchar.h:47
QDataStream & operator>>(QDataStream &s, QKeyCombination &combination)
uint QT_FASTCALL fetch1Pixel< QPixelLayout::BPP1LSB >(const uchar *src, int index)
Q_DECLARE_TYPEINFO(QObjectPrivate::ConnectionList, Q_RELOCATABLE_TYPE)
#define GET_LIGATURE_INDEX(ucs4)
#define GET_DECOMPOSITION_INDEX(ucs4)
#define UNICODE_DATA_VERSION
\inmodule QtCore \reentrant
Definition qchar.h:18
friend constexpr Qt::strong_ordering compareThreeWay(const QLatin1Char &lhs, const QLatin1Char &rhs) noexcept
Definition qchar.h:28
constexpr char16_t unicode() const noexcept
Converts a Latin-1 character to an 16-bit-encoded Unicode representation of the character.
Definition qchar.h:22
friend constexpr bool comparesEqual(const QLatin1Char &lhs, const QLatin1Char &rhs) noexcept
Definition qchar.h:25
constexpr char toLatin1() const noexcept
Converts a Latin-1 character to an 8-bit ASCII representation of the character.
Definition qchar.h:21
constexpr QLatin1Char(char c) noexcept
Constructs a Latin-1 character for c.
Definition qchar.h:20
ushort u1
Definition qchar.cpp:1890
ushort u2
Definition qchar.cpp:1891