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
QUnicodeTools Namespace Reference

Namespaces

namespace  GB
 
namespace  LB
 
namespace  SB
 
namespace  Tailored
 
namespace  WB
 

Classes

struct  ScriptItem
 

Typedefs

using ScriptItemArray = QVarLengthArray<ScriptItem, 64>
 

Enumerations

enum  CharAttributeOption {
  GraphemeBreaks = 0x01 , WordBreaks = 0x02 , SentenceBreaks = 0x04 , LineBreaks = 0x08 ,
  WhiteSpaces = 0x10 , HangulLineBreakTailoring = 0x20 , DontClearAttributes = 0x1000
}
 

Functions

static void getGraphemeBreaks (const char16_t *string, qsizetype len, QCharAttributes *attributes)
 
static void getWordBreaks (const char16_t *string, qsizetype len, QCharAttributes *attributes)
 
static void getSentenceBreaks (const char16_t *string, qsizetype len, QCharAttributes *attributes)
 
static void getLineBreaks (const char16_t *string, qsizetype len, QCharAttributes *attributes, QUnicodeTools::CharAttributeOptions options)
 
static void getWhiteSpaces (const char16_t *string, qsizetype len, QCharAttributes *attributes)
 
Q_CORE_EXPORT void initCharAttributes (QStringView string, const ScriptItem *items, qsizetype numItems, QCharAttributes *attributes, CharAttributeOptions options)
 
Q_CORE_EXPORT void initScripts (QStringView string, ScriptItemArray *scripts)
 

Typedef Documentation

◆ ScriptItemArray

Enumeration Type Documentation

◆ CharAttributeOption

Enumerator
GraphemeBreaks 
WordBreaks 
SentenceBreaks 
LineBreaks 
WhiteSpaces 
HangulLineBreakTailoring 
DontClearAttributes 

Definition at line 51 of file qunicodetools_p.h.

Function Documentation

◆ getGraphemeBreaks()

static void QUnicodeTools::getGraphemeBreaks ( const char16_t * string,
qsizetype len,
QCharAttributes * attributes )
static

Definition at line 120 of file qunicodetools.cpp.

References QUnicodeTools::GB::GB11_ExtPicExt, QUnicodeTools::GB::GB11_ExtPicExtZWJ, QUnicodeTools::GB::GB12_13_RI, QCharAttributes::graphemeBoundary, QUnicodeTables::GraphemeBreak_Extend, QUnicodeTables::GraphemeBreak_Extended_Pictographic, QUnicodeTables::GraphemeBreak_LF, QUnicodeTables::GraphemeBreak_RegionalIndicator, QUnicodeTables::GraphemeBreak_ZWJ, QUnicodeTables::Properties::graphemeBreakClass, i, QUnicodeTools::GB::Normal, pos, QUnicodeTables::properties(), Q_ASSERT, QUnicodeTools::GB::shouldBreakBetweenClasses(), and state.

Referenced by initCharAttributes().

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

◆ getLineBreaks()

static void QUnicodeTools::getLineBreaks ( const char16_t * string,
qsizetype len,
QCharAttributes * attributes,
QUnicodeTools::CharAttributeOptions options )
static

Definition at line 608 of file qunicodetools.cpp.

References QUnicodeTools::LB::NS::actionTable, QUnicodeTools::LB::NS::Break, QUnicodeTools::LB::breakTable, QUnicodeTables::Properties::category, QUnicodeTools::LB::CombiningIndirectBreak, QUnicodeTools::LB::CombiningProhibitedBreak, QUnicodeTools::LB::DirectBreak, QUnicodeTables::Properties::eastAsianWidth, QUnicodeTables::F, FLAG, QUnicodeTables::GraphemeBreak_Extended_Pictographic, QUnicodeTables::H, HangulLineBreakTailoring, i, QUnicodeTools::LB::IndirectBreak, QUnicodeTools::LB::IndirectBreakIfNarrow, j, QCharAttributes::lineBreak, lineBreak(), QUnicodeTables::LineBreak_AL, QUnicodeTables::LineBreak_BK, QUnicodeTables::LineBreak_CL, QUnicodeTables::LineBreak_CM, QUnicodeTables::LineBreak_CP, QUnicodeTables::LineBreak_CR, QUnicodeTables::LineBreak_EM, QUnicodeTables::LineBreak_EX, QUnicodeTables::LineBreak_GL, QUnicodeTables::LineBreak_H2, QUnicodeTables::LineBreak_HL, QUnicodeTables::LineBreak_ID, QUnicodeTables::LineBreak_IS, QUnicodeTables::LineBreak_JT, QUnicodeTables::LineBreak_LF, QUnicodeTables::LineBreak_OP, QUnicodeTables::LineBreak_QU, QUnicodeTables::LineBreak_QU_Pf, QUnicodeTables::LineBreak_QU_Pi, QUnicodeTables::LineBreak_RI, QUnicodeTables::LineBreak_SA, QUnicodeTables::LineBreak_SP, QUnicodeTables::LineBreak_SY, QUnicodeTables::LineBreak_WJ, QUnicodeTables::LineBreak_ZW, QUnicodeTables::LineBreak_ZWJ, QUnicodeTables::Properties::lineBreakClass, QCharAttributes::mandatoryBreak, next, QUnicodeTools::LB::NS::None, pos, QUnicodeTools::LB::ProhibitedBreak, QUnicodeTools::LB::ProhibitedBreakAfterHebrewPlusHyphen, QUnicodeTables::properties(), Q_FALLTHROUGH, Q_UNLIKELY, QUnicodeTools::LB::NS::Start, QUnicodeTools::LB::NS::toClass(), QUnicodeTables::W, and QUnicodeTools::LB::NS::XX.

Referenced by initCharAttributes().

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

◆ getSentenceBreaks()

static void QUnicodeTools::getSentenceBreaks ( const char16_t * string,
qsizetype len,
QCharAttributes * attributes )
static

Definition at line 405 of file qunicodetools.cpp.

References QUnicodeTools::SB::BAfter, QUnicodeTools::SB::Break, QUnicodeTools::SB::breakTable, i, QUnicodeTools::SB::Initial, QUnicodeTools::SB::Lookup, pos, QUnicodeTables::properties(), Q_ASSERT, Q_UNLIKELY, QCharAttributes::sentenceBoundary, QUnicodeTables::SentenceBreak_Any, QUnicodeTables::SentenceBreak_Close, QUnicodeTables::SentenceBreak_Extend, QUnicodeTables::SentenceBreak_Lower, QUnicodeTables::SentenceBreak_Numeric, QUnicodeTables::SentenceBreak_SContinue, QUnicodeTables::SentenceBreak_Sp, QUnicodeTables::Properties::sentenceBreakClass, and state.

Referenced by initCharAttributes().

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

◆ getWhiteSpaces()

static void QUnicodeTools::getWhiteSpaces ( const char16_t * string,
qsizetype len,
QCharAttributes * attributes )
static

Definition at line 850 of file qunicodetools.cpp.

References i, Q_UNLIKELY, and QCharAttributes::whiteSpace.

Referenced by initCharAttributes().

+ Here is the caller graph for this function:

◆ getWordBreaks()

◆ initCharAttributes()

Q_CORE_EXPORT void QUnicodeTools::initCharAttributes ( QStringView string,
const ScriptItem * items,
qsizetype numItems,
QCharAttributes * attributes,
CharAttributeOptions options )

Definition at line 2390 of file qunicodetools.cpp.

References DontClearAttributes, QUnicodeTools::Tailored::getCharAttributes(), getGraphemeBreaks(), getLineBreaks(), getSentenceBreaks(), getWhiteSpaces(), getWordBreaks(), GraphemeBreaks, items, LineBreaks, qt_initcharattributes_default_algorithm_only, SentenceBreaks, WhiteSpaces, and WordBreaks.

Referenced by QTextEngine::attributes(), and init().

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

◆ initScripts()

Q_CORE_EXPORT void QUnicodeTools::initScripts ( QStringView string,
ScriptItemArray * scripts )

Definition at line 2426 of file qunicodetools.cpp.

References QVarLengthArray< T, Prealloc >::append(), QUnicodeTables::Properties::category, FLAG, i, QUnicodeTables::properties(), Q_ASSERT, Q_LIKELY, Q_UNLIKELY, and QUnicodeTables::Properties::script.

Referenced by init(), and QTextEngine::itemize().

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