15#define FLAG(x) (1 << (x))
759bool QChar::isPrint(
char32_t ucs4)
noexcept
761 if (ucs4 > LastValidCodePoint)
763 const int test =
FLAG(Other_Control) |
765 FLAG(Other_Surrogate) |
766 FLAG(Other_PrivateUse) |
767 FLAG(Other_NotAssigned);
794bool QT_FASTCALL QChar::isSpace_helper(
char32_t ucs4)
noexcept
796 if (ucs4 > LastValidCodePoint)
798 const int test =
FLAG(Separator_Space) |
799 FLAG(Separator_Line) |
800 FLAG(Separator_Paragraph);
822bool QChar::isMark(
char32_t ucs4)
noexcept
824 if (ucs4 > LastValidCodePoint)
826 const int test =
FLAG(Mark_NonSpacing) |
827 FLAG(Mark_SpacingCombining) |
828 FLAG(Mark_Enclosing);
848bool QChar::isPunct(
char32_t ucs4)
noexcept
850 if (ucs4 > LastValidCodePoint)
852 const int test =
FLAG(Punctuation_Connector) |
853 FLAG(Punctuation_Dash) |
854 FLAG(Punctuation_Open) |
855 FLAG(Punctuation_Close) |
856 FLAG(Punctuation_InitialQuote) |
857 FLAG(Punctuation_FinalQuote) |
858 FLAG(Punctuation_Other);
878bool QChar::isSymbol(
char32_t ucs4)
noexcept
880 if (ucs4 > LastValidCodePoint)
882 const int test =
FLAG(Symbol_Math) |
883 FLAG(Symbol_Currency) |
884 FLAG(Symbol_Modifier) |
910bool QT_FASTCALL QChar::isLetter_helper(
char32_t ucs4)
noexcept
912 if (ucs4 > LastValidCodePoint)
914 const int test =
FLAG(Letter_Uppercase) |
915 FLAG(Letter_Lowercase) |
916 FLAG(Letter_Titlecase) |
917 FLAG(Letter_Modifier) |
947bool QT_FASTCALL QChar::isNumber_helper(
char32_t ucs4)
noexcept
949 if (ucs4 > LastValidCodePoint)
951 const int test =
FLAG(Number_DecimalDigit) |
952 FLAG(Number_Letter) |
978bool QT_FASTCALL QChar::isLetterOrNumber_helper(
char32_t ucs4)
noexcept
980 if (ucs4 > LastValidCodePoint)
982 const int test =
FLAG(Letter_Uppercase) |
983 FLAG(Letter_Lowercase) |
984 FLAG(Letter_Titlecase) |
985 FLAG(Letter_Modifier) |
987 FLAG(Number_DecimalDigit) |
988 FLAG(Number_Letter) |
1163int QChar::digitValue(
char32_t ucs4)
noexcept
1165 if (ucs4 > LastValidCodePoint)
1182QChar::Category QChar::category(
char32_t ucs4)
noexcept
1184 if (ucs4 > LastValidCodePoint)
1185 return QChar::Other_NotAssigned;
1186 return (QChar::Category)
qGetProp(ucs4)->category;
1201QChar::Direction QChar::direction(
char32_t ucs4)
noexcept
1203 if (ucs4 > LastValidCodePoint)
1205 return (QChar::Direction)
qGetProp(ucs4)->direction;
1226QChar::JoiningType QChar::joiningType(
char32_t ucs4)
noexcept
1228 if (ucs4 > LastValidCodePoint)
1229 return QChar::Joining_None;
1230 return QChar::JoiningType(
qGetProp(ucs4)->joining);
1257bool QChar::hasMirrored(
char32_t ucs4)
noexcept
1259 if (ucs4 > LastValidCodePoint)
1261 return qGetProp(ucs4)->mirrorDiff != 0;
1347char32_t QChar::mirroredChar(
char32_t ucs4)
noexcept
1349 if (ucs4 > LastValidCodePoint)
1351 return ucs4 +
qGetProp(ucs4)->mirrorDiff;
1376 *
tag = QChar::Canonical;
1381 if (
index == 0xffff) {
1383 *
tag = QChar::NoDecomposition;
1388 *
tag = QChar::Decomposition((*decomposition) & 0xff);
1389 *
length = (*decomposition) >> 8;
1390 return reinterpret_cast<const QChar *
>(decomposition + 1);
1397QString QChar::decomposition()
const
1399 return QChar::decomposition(ucs);
1409QString QChar::decomposition(
char32_t ucs4)
1413 QChar::Decomposition
tag;
1432QChar::Decomposition QChar::decompositionTag(
char32_t ucs4)
noexcept
1435 return QChar::Canonical;
1437 if (
index == 0xffff)
1438 return QChar::NoDecomposition;
1460unsigned char QChar::combiningClass(
char32_t ucs4)
noexcept
1462 if (ucs4 > LastValidCodePoint)
1464 return (
unsigned char)
qGetProp(ucs4)->combiningClass;
1483QChar::Script QChar::script(
char32_t ucs4)
noexcept
1485 if (ucs4 > LastValidCodePoint)
1486 return QChar::Script_Unknown;
1487 return (QChar::Script)
qGetProp(ucs4)->script;
1503QChar::UnicodeVersion QChar::unicodeVersion(
char32_t ucs4)
noexcept
1505 if (ucs4 > LastValidCodePoint)
1506 return QChar::Unicode_Unassigned;
1507 return (QChar::UnicodeVersion)
qGetProp(ucs4)->unicodeVersion;
1513QChar::UnicodeVersion QChar::currentUnicodeVersion() noexcept
1525 auto begin()
const {
return chars; }
1526 auto end()
const {
return chars + sz; }
1528 auto data()
const {
return chars; }
1529 auto size()
const {
return sz; }
1531 Q_ASSERT(uc <= QChar::LastValidCodePoint);
1535 const auto fold =
qGetProp(uc)->cases[which];
1536 const auto caseDiff = fold.diff;
1540 auto length = *specialCase++;
1542 *pp++ = *specialCase++;
1545 for (
char16_t c : QChar::fromUcs4(uc + caseDiff))
1552template <
typename T>
1555 const auto fold =
qGetProp(uc)->cases[which];
1560 return *specialCase == 1 ? specialCase[1] : uc;
1563 return uc + fold.diff;
1581char32_t QChar::toLower(
char32_t ucs4)
noexcept
1583 if (ucs4 > LastValidCodePoint)
1603char32_t QChar::toUpper(
char32_t ucs4)
noexcept
1605 if (ucs4 > LastValidCodePoint)
1625char32_t QChar::toTitleCase(
char32_t ucs4)
noexcept
1627 if (ucs4 > LastValidCodePoint)
1634 char32_t ucs4 = *
ch;
1635 if (QChar::isLowSurrogate(ucs4) &&
ch >
start && QChar::isHighSurrogate(*(
ch - 1)))
1636 ucs4 = QChar::surrogateToUcs4(*(
ch - 1), ucs4);
1640static inline char32_t foldCase(
char32_t ch,
char32_t &last)
noexcept
1643 if (QChar::isLowSurrogate(ucs4) && QChar::isHighSurrogate(last))
1644 ucs4 = QChar::surrogateToUcs4(last, ucs4);
1673char32_t QChar::toCaseFolded(
char32_t ucs4)
noexcept
1675 if (ucs4 > LastValidCodePoint)
1703#ifndef QT_NO_DATASTREAM
1728 chr.unicode() = char16_t(u);
1815 QChar::Decomposition
tag;
1820 const unsigned short *utf16 =
reinterpret_cast<unsigned short *
>(
s.data());
1821 const unsigned short *uc = utf16 +
s.size();
1822 while (uc != utf16 + from) {
1823 char32_t ucs4 = *(--uc);
1824 if (
QChar(ucs4).isLowSurrogate() && uc != utf16) {
1826 if (
QChar(high).isHighSurrogate()) {
1828 ucs4 = QChar::surrogateToUcs4(high, ucs4);
1832 if (QChar::unicodeVersion(ucs4) > version)
1836 if (!
d || (canonical &&
tag != QChar::Canonical))
1840 s.replace(
pos, QChar::requiresSurrogates(ucs4) ? 2 : 1,
d,
length);
1842 utf16 =
reinterpret_cast<unsigned short *
>(
s.data());
1854{
return ligature1.u1 < ligature2.u1; }
1856{
return u1 < ligature.u1; }
1858{
return ligature.u1 <
u1; }
1866{
return QChar::surrogateToUcs4(ligature1.p1.u1, ligature1.p1.u2) < QChar::surrogateToUcs4(ligature2.p1.u1, ligature2.p1.u2); }
1868{
return u1 < QChar::surrogateToUcs4(ligature.p1.u1, ligature.p1.u2); }
1870{
return QChar::surrogateToUcs4(ligature.p1.u1, ligature.p1.u2) <
u1; }
1893 if (
index == 0xffff)
1897 if (QChar::requiresSurrogates(
u1)) {
1900 if (
r !=
data +
length && QChar::surrogateToUcs4(
r->p1.u1,
r->p1.u2) ==
u1)
1901 return QChar::surrogateToUcs4(
r->p2.u1,
r->p2.u2);
1916 if (from < 0 ||
s.size() - from < 2)
1919 char32_t stcode = 0;
1922 int lastCombining = 255;
1925 while (
pos <
s.size()) {
1927 char32_t uc =
s.at(
pos).unicode();
1928 if (
QChar(uc).isHighSurrogate() &&
pos <
s.size()-1) {
1930 if (
QChar(low).isLowSurrogate()) {
1931 uc = QChar::surrogateToUcs4(uc, low);
1937 if (
p->unicodeVersion > version) {
1940 lastCombining = 255;
1945 int combining =
p->combiningClass;
1946 if ((
i ==
next || combining > lastCombining) && starter >= from) {
1954 for (
QChar ch : QChar::fromUcs4(ligature))
1955 d[starter +
j++] =
ch;
1960 if (combining == 0) {
1965 lastCombining = combining;
1983 u1 =
s.at(
pos).unicode();
1984 if (QChar::isHighSurrogate(
u1)) {
1985 const char16_t low =
s.at(
p2).unicode();
1986 if (QChar::isLowSurrogate(low)) {
1987 u1 = QChar::surrogateToUcs4(
u1, low);
1996 u2 =
s.at(
p2).unicode();
1997 if (QChar::isHighSurrogate(
u2) &&
p2 < l) {
1998 const char16_t low =
s.at(
p2+1).unicode();
1999 if (QChar::isLowSurrogate(low)) {
2000 u2 = QChar::surrogateToUcs4(
u2, low);
2008 if (
p->unicodeVersion <= version)
2009 c2 =
p->combiningClass;
2018 if (
p->unicodeVersion <= version)
2019 c1 =
p->combiningClass;
2032 if (
pos > 0 &&
s.at(
pos).isLowSurrogate())
2036 if (QChar::requiresSurrogates(
u1))
2042 if (QChar::requiresSurrogates(
u1))
2061 enum { NFQC_YES = 0, NFQC_NO = 1, NFQC_MAYBE = 3 };
2063 const auto *
string =
reinterpret_cast<const char16_t *
>(
str->
constData());
2067 while (
length > from && QChar::isHighSurrogate(
string[
length - 1]))
2070 uchar lastCombining = 0;
2073 char32_t uc =
string[
i];
2081 if (QChar::isHighSurrogate(uc)) {
2083 if (!QChar::isLowSurrogate(low)) {
2090 uc = QChar::surrogateToUcs4(uc, low);
2095 if (
p->combiningClass < lastCombining &&
p->combiningClass > 0)
2098 const uchar check = (
p->nfQuickCheck >> (
mode << 1)) & 0x03;
2099 if (check != NFQC_YES)
2102 lastCombining =
p->combiningClass;
2103 if (lastCombining == 0)
2108 *lastStable =
str->
size() - 1;
QDataStream & operator<<(QDataStream &out, QChar chr)
Writes the char chr to the stream out.
QDataStream & operator>>(QDataStream &in, QChar &chr)
Reads a char from the stream in into char chr.
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
const QChar * constData() const
Returns a pointer to the data stored in the QString.
qsizetype size() const noexcept
Returns the number of characters in this string.
NormalizationForm
This enum describes the various normalized forms of Unicode text.
const QLoggingCategory & category()
[1]
Combined button and popup list for selecting options.
static constexpr unsigned short uc_decomposition_map[]
static Q_DECL_CONST_FUNCTION const Properties * qGetProp(char32_t ucs4) noexcept
static constexpr unsigned short specialCaseMap[]
constexpr unsigned int MaxSpecialCaseLength
static constexpr unsigned short uc_ligature_map[]
static constexpr char32_t Hangul_SBase
static char32_t ligatureHelper(char32_t u1, char32_t u2)
static void canonicalOrderHelper(QString *str, QChar::UnicodeVersion version, qsizetype from)
static Q_DECL_CONST_FUNCTION T convertCase_helper(T uc, QUnicodeTables::Case which) noexcept
static constexpr quint32 Hangul_VCount
static constexpr quint32 Hangul_SCount
bool operator<(const UCS2Pair &ligature1, const UCS2Pair &ligature2)
static auto fullConvertCase(char32_t uc, QUnicodeTables::Case which) noexcept
static constexpr quint32 Hangul_NCount
static constexpr char32_t Hangul_TBase
static void decomposeHelper(QString *str, bool canonical, QChar::UnicodeVersion version, qsizetype from)
static void composeHelper(QString *str, QChar::UnicodeVersion version, qsizetype from)
static constexpr char32_t Hangul_VBase
static constexpr quint32 Hangul_TCount
static const QChar *QT_FASTCALL decompositionHelper(char32_t ucs4, qsizetype *length, QChar::Decomposition *tag, QChar *buffer)
static bool normalizationQuickCheckHelper(QString *str, QString::NormalizationForm mode, qsizetype from, qsizetype *lastStable)
static constexpr quint32 Hangul_LCount
static constexpr char32_t Hangul_LBase
static char32_t foldCase(const char16_t *ch, const char16_t *start)
#define Q_DECL_CONST_FUNCTION
AudioChannelLayoutTag tag
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei length
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
QT_BEGIN_NAMESPACE typedef signed char qint8
#define GET_LIGATURE_INDEX(ucs4)
#define GET_DECOMPOSITION_INDEX(ucs4)
#define UNICODE_DATA_VERSION
QTextStream out(stdout)
[7]