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
qstringconverter.cpp File Reference

(f8359084b948fd8f6027d23a869f1a0d50cc30c1)

#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 "qcontainertools_impl.h"
#include <QtCore/qbytearraylist.h>
#include <array>
+ 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)
 
static qsizetype availableCodecCount ()
 

Variables

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

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
Endian 
Data 

Definition at line 47 of file qstringconverter.cpp.

◆ anonymous enum

anonymous enum
Enumerator
HeaderDone 

Definition at line 472 of file qstringconverter.cpp.

Function Documentation

◆ availableCodecCount()

static qsizetype availableCodecCount ( )
static

Definition at line 2364 of file qstringconverter.cpp.

References QStringConverter::LastEncoding.

Referenced by QStringConverter::availableCodecs().

+ Here is the caller graph for this function:

◆ fromLatin1Len()

static qsizetype fromLatin1Len ( qsizetype l)
static

Definition at line 1762 of file qstringconverter.cpp.

◆ fromLocal8Bit()

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

Definition at line 1736 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 1653 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 1663 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 1673 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 1755 of file qstringconverter.cpp.

◆ fromUtf32()

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

Definition at line 1683 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 1693 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 1703 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 1758 of file qstringconverter.cpp.

◆ fromUtf8Len()

static qsizetype fromUtf8Len ( qsizetype l)
static

Definition at line 1751 of file qstringconverter.cpp.

◆ nameMatch()

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

Definition at line 1913 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 2305 of file qstringconverter.cpp.

References ch, header(), pos, QByteArray(), QByteArrayLiteral, qMakeStaticByteArrayMatcher(), qMin(), and qstrlen().

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 467 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 456 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 451 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 461 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 1763 of file qstringconverter.cpp.

◆ toLocal8Bit()

◆ toUtf16()

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

Definition at line 1658 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 1668 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 1678 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 1756 of file qstringconverter.cpp.

◆ toUtf32()

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

Definition at line 1688 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 1698 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 1708 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 1759 of file qstringconverter.cpp.

◆ toUtf8Len()

static qsizetype toUtf8Len ( qsizetype l)
static

Definition at line 1752 of file qstringconverter.cpp.

Variable Documentation

◆ utf8bom

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