Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qchar.cpp File Reference

(ee612626f99d5a8da6814c2df90db00f9beb463f)

#include "qchar.h"
#include "qdatastream.h"
#include "qunicodetables_p.h"
#include "qunicodetables.cpp"
#include <algorithm>
+ Include dependency graph for qchar.cpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  UCS2Pair
 
struct  UCS2SurrogatePair
 

Macros

#define FLAG(x)   (1 << (x))
 

Functions

static const QChar *QT_FASTCALL decompositionHelper (char32_t ucs4, qsizetype *length, QChar::Decomposition *tag, QChar *buffer)
 
static auto fullConvertCase (char32_t uc, QUnicodeTables::Case which) noexcept
 
template<typename T >
static Q_DECL_CONST_FUNCTIONconvertCase_helper (T uc, QUnicodeTables::Case which) noexcept
 
static char32_t foldCase (const char16_t *ch, const char16_t *start)
 
static char32_t foldCase (char32_t ch, char32_t &last) noexcept
 
static char16_t foldCase (char16_t ch) noexcept
 
static QChar foldCase (QChar ch) noexcept
 
static void decomposeHelper (QString *str, bool canonical, QChar::UnicodeVersion version, qsizetype from)
 
bool operator< (const UCS2Pair &ligature1, const UCS2Pair &ligature2)
 
bool operator< (ushort u1, const UCS2Pair &ligature)
 
bool operator< (const UCS2Pair &ligature, ushort u1)
 
bool operator< (const UCS2SurrogatePair &ligature1, const UCS2SurrogatePair &ligature2)
 
bool operator< (char32_t u1, const UCS2SurrogatePair &ligature)
 
bool operator< (const UCS2SurrogatePair &ligature, char32_t u1)
 
static char32_t ligatureHelper (char32_t u1, char32_t u2)
 
static void composeHelper (QString *str, QChar::UnicodeVersion version, qsizetype from)
 
static void canonicalOrderHelper (QString *str, QChar::UnicodeVersion version, qsizetype from)
 
static bool normalizationQuickCheckHelper (QString *str, QString::NormalizationForm mode, qsizetype from, qsizetype *lastStable)
 

Variables

static constexpr char32_t Hangul_SBase = 0xac00
 
static constexpr char32_t Hangul_LBase = 0x1100
 
static constexpr char32_t Hangul_VBase = 0x1161
 
static constexpr char32_t Hangul_TBase = 0x11a7
 
static constexpr quint32 Hangul_LCount = 19
 
static constexpr quint32 Hangul_VCount = 21
 
static constexpr quint32 Hangul_TCount = 28
 
static constexpr quint32 Hangul_NCount = Hangul_VCount * Hangul_TCount
 
static constexpr quint32 Hangul_SCount = Hangul_LCount * Hangul_NCount
 

Macro Definition Documentation

◆ FLAG

#define FLAG ( x)    (1 << (x))

Function Documentation

◆ canonicalOrderHelper()

static void canonicalOrderHelper ( QString * str,
QChar::UnicodeVersion version,
qsizetype from )
static

Definition at line 1972 of file qchar.cpp.

References c2, ch, p2, pos, QUnicodeTables::qGetProp(), QString::size(), and str.

Referenced by qt_string_normalize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ composeHelper()

static void composeHelper ( QString * str,
QChar::UnicodeVersion version,
qsizetype from )
static

Definition at line 1912 of file qchar.cpp.

References ch, d, i, j, ligatureHelper(), next, pos, QUnicodeTables::qGetProp(), and str.

Referenced by qt_string_normalize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertCase_helper()

template<typename T >
static Q_DECL_CONST_FUNCTION T convertCase_helper ( T uc,
QUnicodeTables::Case which )
inlinestaticnoexcept

Definition at line 1553 of file qchar.cpp.

References Q_UNLIKELY, QUnicodeTables::qGetProp(), and QUnicodeTables::specialCaseMap.

Referenced by foldCase(), foldCase(), and foldCase().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ decomposeHelper()

static void decomposeHelper ( QString * str,
bool canonical,
QChar::UnicodeVersion version,
qsizetype from )
static

Definition at line 1812 of file qchar.cpp.

References d, decompositionHelper(), pos, str, and tag.

Referenced by qt_string_normalize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ decompositionHelper()

static const QChar *QT_FASTCALL decompositionHelper ( char32_t ucs4,
qsizetype * length,
QChar::Decomposition * tag,
QChar * buffer )
static

Definition at line 1366 of file qchar.cpp.

References GET_DECOMPOSITION_INDEX, Hangul_LBase, Hangul_NCount, Hangul_SBase, Hangul_SCount, Hangul_TBase, Hangul_TCount, Hangul_VBase, tag, and QUnicodeTables::uc_decomposition_map.

Referenced by decomposeHelper().

+ Here is the caller graph for this function:

◆ foldCase() [1/4]

static char16_t foldCase ( char16_t ch)
inlinestaticnoexcept

Definition at line 1649 of file qchar.cpp.

References QUnicodeTables::CaseFold, ch, and convertCase_helper().

+ Here is the call graph for this function:

◆ foldCase() [2/4]

static char32_t foldCase ( char32_t ch,
char32_t & last )
inlinestaticnoexcept

Definition at line 1640 of file qchar.cpp.

References QUnicodeTables::CaseFold, ch, and convertCase_helper().

+ Here is the call graph for this function:

◆ foldCase() [3/4]

static char32_t foldCase ( const char16_t * ch,
const char16_t * start )
inlinestatic

Definition at line 1632 of file qchar.cpp.

References QUnicodeTables::CaseFold, ch, and convertCase_helper().

Referenced by bm_find(), bm_init_skiptable(), QtPrivate::count(), QString::endsWith(), QtPrivate::findString(), foldCase(), QtPrivate::qustrcasechr(), QString::replace(), QString::startsWith(), ucstricmp(), and ucstricmp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ foldCase() [4/4]

static QChar foldCase ( QChar ch)
inlinestaticnoexcept

Definition at line 1654 of file qchar.cpp.

References ch, and foldCase().

+ Here is the call graph for this function:

◆ fullConvertCase()

static auto fullConvertCase ( char32_t uc,
QUnicodeTables::Case which )
staticnoexcept

Definition at line 1518 of file qchar.cpp.

References begin(), QUnicodeTables::MaxSpecialCaseLength, Q_ASSERT, Q_UNLIKELY, QUnicodeTables::qGetProp(), qint8, R, and QUnicodeTables::specialCaseMap.

Referenced by QUnicodeTables::detachAndConvertCase().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ligatureHelper()

static char32_t ligatureHelper ( char32_t u1,
char32_t u2 )
inlinestatic

Definition at line 1872 of file qchar.cpp.

References GET_LIGATURE_INDEX, Hangul_LBase, Hangul_LCount, Hangul_SBase, Hangul_SCount, Hangul_TBase, Hangul_TCount, Hangul_VBase, Hangul_VCount, and QUnicodeTables::uc_ligature_map.

Referenced by composeHelper().

+ Here is the caller graph for this function:

◆ normalizationQuickCheckHelper()

static bool normalizationQuickCheckHelper ( QString * str,
QString::NormalizationForm mode,
qsizetype from,
qsizetype * lastStable )
static

Definition at line 2054 of file qchar.cpp.

References QString::constData(), i, QString::NormalizationForm_C, QString::NormalizationForm_D, QString::NormalizationForm_KC, QString::NormalizationForm_KD, pos, QUnicodeTables::qGetProp(), QString::size(), and str.

Referenced by qt_string_normalize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator<() [1/6]

bool operator< ( char32_t u1,
const UCS2SurrogatePair & ligature )
inline

Definition at line 1867 of file qchar.cpp.

◆ operator<() [2/6]

bool operator< ( const UCS2Pair & ligature,
ushort u1 )
inline

Definition at line 1857 of file qchar.cpp.

◆ operator<() [3/6]

bool operator< ( const UCS2Pair & ligature1,
const UCS2Pair & ligature2 )
inline

Definition at line 1853 of file qchar.cpp.

◆ operator<() [4/6]

bool operator< ( const UCS2SurrogatePair & ligature,
char32_t u1 )
inline

Definition at line 1869 of file qchar.cpp.

◆ operator<() [5/6]

bool operator< ( const UCS2SurrogatePair & ligature1,
const UCS2SurrogatePair & ligature2 )
inline

Definition at line 1865 of file qchar.cpp.

◆ operator<() [6/6]

bool operator< ( ushort u1,
const UCS2Pair & ligature )
inline

Definition at line 1855 of file qchar.cpp.

Variable Documentation

◆ Hangul_LBase

constexpr char32_t Hangul_LBase = 0x1100
staticconstexpr

Definition at line 1356 of file qchar.cpp.

Referenced by decompositionHelper(), and ligatureHelper().

◆ Hangul_LCount

constexpr quint32 Hangul_LCount = 19
staticconstexpr

Definition at line 1359 of file qchar.cpp.

Referenced by ligatureHelper().

◆ Hangul_NCount

constexpr quint32 Hangul_NCount = Hangul_VCount * Hangul_TCount
staticconstexpr

Definition at line 1362 of file qchar.cpp.

Referenced by decompositionHelper().

◆ Hangul_SBase

constexpr char32_t Hangul_SBase = 0xac00
staticconstexpr

Definition at line 1355 of file qchar.cpp.

Referenced by decompositionHelper(), and ligatureHelper().

◆ Hangul_SCount

constexpr quint32 Hangul_SCount = Hangul_LCount * Hangul_NCount
staticconstexpr

Definition at line 1363 of file qchar.cpp.

Referenced by decompositionHelper(), and ligatureHelper().

◆ Hangul_TBase

constexpr char32_t Hangul_TBase = 0x11a7
staticconstexpr

Definition at line 1358 of file qchar.cpp.

Referenced by decompositionHelper(), and ligatureHelper().

◆ Hangul_TCount

constexpr quint32 Hangul_TCount = 28
staticconstexpr

Definition at line 1361 of file qchar.cpp.

Referenced by decompositionHelper(), and ligatureHelper().

◆ Hangul_VBase

constexpr char32_t Hangul_VBase = 0x1161
staticconstexpr

Definition at line 1357 of file qchar.cpp.

Referenced by decompositionHelper(), and ligatureHelper().

◆ Hangul_VCount

constexpr quint32 Hangul_VCount = 21
staticconstexpr

Definition at line 1360 of file qchar.cpp.

Referenced by ligatureHelper().