Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qstringconverter.cpp File Reference
#include <qstringconverter.h>
#include <private/qstringconverter_p.h>
#include "qendian.h"
#include "private/qsimd_p.h"
#include "private/qstringiterator_p.h"
#include "private/qtools_p.h"
#include "qbytearraymatcher.h"
+ Include dependency graph for qstringconverter.cpp:

Go to the source code of this file.

Classes

struct  QUtf8NoOutputTraits
 
struct  QUtf8NoOutputTraits::NoOutput
 

Enumerations

enum  { Endian = 0 , Data = 1 }
 
enum  { HeaderDone = 1 }
 

Functions

static bool simdEncodeAscii (uchar *, const char16_t *, const char16_t *, const char16_t *)
 
static bool simdDecodeAscii (char16_t *, const uchar *, const uchar *, const uchar *)
 
static const ucharsimdFindNonAscii (const uchar *src, const uchar *end, const uchar *&nextAscii)
 
static void simdCompareAscii (const qchar8_t *&, const qchar8_t *, const char16_t *&, const char16_t *)
 
static QCharfromUtf16 (QChar *out, QByteArrayView in, QStringConverter::State *state)
 
static char * toUtf16 (char *out, QStringView in, QStringConverter::State *state)
 
static QCharfromUtf16BE (QChar *out, QByteArrayView in, QStringConverter::State *state)
 
static char * toUtf16BE (char *out, QStringView in, QStringConverter::State *state)
 
static QCharfromUtf16LE (QChar *out, QByteArrayView in, QStringConverter::State *state)
 
static char * toUtf16LE (char *out, QStringView in, QStringConverter::State *state)
 
static QCharfromUtf32 (QChar *out, QByteArrayView in, QStringConverter::State *state)
 
static char * toUtf32 (char *out, QStringView in, QStringConverter::State *state)
 
static QCharfromUtf32BE (QChar *out, QByteArrayView in, QStringConverter::State *state)
 
static char * toUtf32BE (char *out, QStringView in, QStringConverter::State *state)
 
static QCharfromUtf32LE (QChar *out, QByteArrayView in, QStringConverter::State *state)
 
static char * toUtf32LE (char *out, QStringView in, QStringConverter::State *state)
 
static QCharfromLocal8Bit (QChar *out, QByteArrayView in, QStringConverter::State *state)
 
static char * toLocal8Bit (char *out, QStringView in, QStringConverter::State *state)
 
static qsizetype fromUtf8Len (qsizetype l)
 
static qsizetype toUtf8Len (qsizetype l)
 
static qsizetype fromUtf16Len (qsizetype l)
 
static qsizetype toUtf16Len (qsizetype l)
 
static qsizetype fromUtf32Len (qsizetype l)
 
static qsizetype toUtf32Len (qsizetype l)
 
static qsizetype fromLatin1Len (qsizetype l)
 
static qsizetype toLatin1Len (qsizetype l)
 
static bool nameMatch (const char *a, const char *b)
 
static QByteArray parseHtmlMetaForEncoding (QByteArrayView data)
 

Variables

static const uchar utf8bom [] = { 0xef, 0xbb, 0xbf }
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
Endian 
Data 

Definition at line 41 of file qstringconverter.cpp.

◆ anonymous enum

anonymous enum
Enumerator
HeaderDone 

Definition at line 466 of file qstringconverter.cpp.

Function Documentation

◆ fromLatin1Len()

static qsizetype fromLatin1Len ( qsizetype  l)
static

Definition at line 1571 of file qstringconverter.cpp.

◆ fromLocal8Bit()

static QChar * fromLocal8Bit ( QChar out,
QByteArrayView  in,
QStringConverter::State state 
)
static

Definition at line 1547 of file qstringconverter.cpp.

References QLocal8Bit::convertToUnicode(), out, and state.

Referenced by QString::fromLocal8Bit().

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

◆ fromUtf16()

static QChar * fromUtf16 ( QChar out,
QByteArrayView  in,
QStringConverter::State state 
)
static

Definition at line 1465 of file qstringconverter.cpp.

References QUtf16::convertToUnicode(), DetectEndianness, out, and state.

+ Here is the call graph for this function:

◆ fromUtf16BE()

static QChar * fromUtf16BE ( QChar out,
QByteArrayView  in,
QStringConverter::State state 
)
static

Definition at line 1475 of file qstringconverter.cpp.

References BigEndianness, QUtf16::convertToUnicode(), out, and state.

+ Here is the call graph for this function:

◆ fromUtf16LE()

static QChar * fromUtf16LE ( QChar out,
QByteArrayView  in,
QStringConverter::State state 
)
static

Definition at line 1485 of file qstringconverter.cpp.

References QUtf16::convertToUnicode(), LittleEndianness, out, and state.

+ Here is the call graph for this function:

◆ fromUtf16Len()

static qsizetype fromUtf16Len ( qsizetype  l)
static

Definition at line 1565 of file qstringconverter.cpp.

◆ fromUtf32()

static QChar * fromUtf32 ( QChar out,
QByteArrayView  in,
QStringConverter::State state 
)
static

Definition at line 1495 of file qstringconverter.cpp.

References QUtf32::convertToUnicode(), DetectEndianness, out, and state.

+ Here is the call graph for this function:

◆ fromUtf32BE()

static QChar * fromUtf32BE ( QChar out,
QByteArrayView  in,
QStringConverter::State state 
)
static

Definition at line 1505 of file qstringconverter.cpp.

References BigEndianness, QUtf32::convertToUnicode(), out, and state.

+ Here is the call graph for this function:

◆ fromUtf32LE()

static QChar * fromUtf32LE ( QChar out,
QByteArrayView  in,
QStringConverter::State state 
)
static

Definition at line 1515 of file qstringconverter.cpp.

References QUtf32::convertToUnicode(), LittleEndianness, out, and state.

+ Here is the call graph for this function:

◆ fromUtf32Len()

static qsizetype fromUtf32Len ( qsizetype  l)
static

Definition at line 1568 of file qstringconverter.cpp.

◆ fromUtf8Len()

static qsizetype fromUtf8Len ( qsizetype  l)
static

Definition at line 1562 of file qstringconverter.cpp.

◆ nameMatch()

static bool nameMatch ( const char *  a,
const char *  b 
)
static

Definition at line 1716 of file qstringconverter.cpp.

References QtMiscUtils::toAsciiLower().

Referenced by QStringConverter::encodingForName().

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

◆ parseHtmlMetaForEncoding()

static QByteArray parseHtmlMetaForEncoding ( QByteArrayView  data)
static

Definition at line 2107 of file qstringconverter.cpp.

References QString::at(), ch, QString::first(), header(), QString::indexOf(), QString::left(), QString::mid(), pos, QByteArrayLiteral, qMakeStaticByteArrayMatcher(), qMin(), qstrlen(), QString::simplified(), QString::size(), and QString::toLower().

Referenced by QStringDecoder::decoderForHtml(), and QStringConverter::encodingForHtml().

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

◆ simdCompareAscii()

static void simdCompareAscii ( const qchar8_t *&  ,
const qchar8_t ,
const char16_t *&  ,
const char16_t *   
)
static

Definition at line 461 of file qstringconverter.cpp.

Referenced by QUtf8::compareUtf8().

+ Here is the caller graph for this function:

◆ simdDecodeAscii()

static bool simdDecodeAscii ( char16_t *  ,
const uchar ,
const uchar ,
const uchar  
)
inlinestatic

Definition at line 450 of file qstringconverter.cpp.

Referenced by QUtf8::convertToUnicode(), and QUtf8::convertToUnicode().

+ Here is the caller graph for this function:

◆ simdEncodeAscii()

static bool simdEncodeAscii ( uchar ,
const char16_t *  ,
const char16_t *  ,
const char16_t *   
)
inlinestatic

Definition at line 445 of file qstringconverter.cpp.

Referenced by QUtf8::convertFromUnicode(), and QUtf8::convertFromUnicode().

+ Here is the caller graph for this function:

◆ simdFindNonAscii()

static const uchar * simdFindNonAscii ( const uchar src,
const uchar end,
const uchar *&  nextAscii 
)
inlinestatic

Definition at line 455 of file qstringconverter.cpp.

Referenced by QUtf8::isValidUtf8().

+ Here is the caller graph for this function:

◆ toLatin1Len()

static qsizetype toLatin1Len ( qsizetype  l)
static

Definition at line 1572 of file qstringconverter.cpp.

◆ toLocal8Bit()

◆ toUtf16()

static char * toUtf16 ( char *  out,
QStringView  in,
QStringConverter::State state 
)
static

Definition at line 1470 of file qstringconverter.cpp.

References QUtf16::convertFromUnicode(), DetectEndianness, out, and state.

+ Here is the call graph for this function:

◆ toUtf16BE()

static char * toUtf16BE ( char *  out,
QStringView  in,
QStringConverter::State state 
)
static

Definition at line 1480 of file qstringconverter.cpp.

References BigEndianness, QUtf16::convertFromUnicode(), out, and state.

+ Here is the call graph for this function:

◆ toUtf16LE()

static char * toUtf16LE ( char *  out,
QStringView  in,
QStringConverter::State state 
)
static

Definition at line 1490 of file qstringconverter.cpp.

References QUtf16::convertFromUnicode(), LittleEndianness, out, and state.

+ Here is the call graph for this function:

◆ toUtf16Len()

static qsizetype toUtf16Len ( qsizetype  l)
static

Definition at line 1566 of file qstringconverter.cpp.

◆ toUtf32()

static char * toUtf32 ( char *  out,
QStringView  in,
QStringConverter::State state 
)
static

Definition at line 1500 of file qstringconverter.cpp.

References QUtf32::convertFromUnicode(), DetectEndianness, out, and state.

+ Here is the call graph for this function:

◆ toUtf32BE()

static char * toUtf32BE ( char *  out,
QStringView  in,
QStringConverter::State state 
)
static

Definition at line 1510 of file qstringconverter.cpp.

References BigEndianness, QUtf32::convertFromUnicode(), out, and state.

+ Here is the call graph for this function:

◆ toUtf32LE()

static char * toUtf32LE ( char *  out,
QStringView  in,
QStringConverter::State state 
)
static

Definition at line 1520 of file qstringconverter.cpp.

References QUtf32::convertFromUnicode(), LittleEndianness, out, and state.

+ Here is the call graph for this function:

◆ toUtf32Len()

static qsizetype toUtf32Len ( qsizetype  l)
static

Definition at line 1569 of file qstringconverter.cpp.

◆ toUtf8Len()

static qsizetype toUtf8Len ( qsizetype  l)
static

Definition at line 1563 of file qstringconverter.cpp.

Variable Documentation

◆ utf8bom

const uchar utf8bom[] = { 0xef, 0xbb, 0xbf }
static