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
QUtf8 Struct Reference

#include <qstringconverter_p.h>

+ Collaboration diagram for QUtf8:

Classes

struct  ValidUtf8Result
 

Static Public Member Functions

static QCharconvertToUnicode (QChar *buffer, QByteArrayView in) noexcept
 
static Q_CORE_EXPORT char16_t * convertToUnicode (char16_t *dst, QByteArrayView in) noexcept
 
static QString convertToUnicode (QByteArrayView in)
 
static Q_CORE_EXPORT QString convertToUnicode (QByteArrayView in, QStringConverter::State *state)
 
static QCharconvertToUnicode (QChar *out, QByteArrayView in, QStringConverter::State *state)
 
static char16_t * convertToUnicode (char16_t *dst, QByteArrayView in, QStringConverter::State *state)
 
static Q_CORE_EXPORT QByteArray convertFromUnicode (QStringView in)
 
static Q_CORE_EXPORT QByteArray convertFromUnicode (QStringView in, QStringConverterBase::State *state)
 
static char * convertFromUnicode (char *out, QStringView in, QStringConverter::State *state)
 
static Q_CORE_EXPORT char * convertFromLatin1 (char *out, QLatin1StringView in)
 
static ValidUtf8Result isValidUtf8 (QByteArrayView in)
 
static int compareUtf8 (QByteArrayView utf8, QStringView utf16, Qt::CaseSensitivity cs=Qt::CaseSensitive) noexcept
 
static int compareUtf8 (QByteArrayView utf8, QLatin1StringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive)
 
static int compareUtf8 (QByteArrayView lhs, QByteArrayView rhs, Qt::CaseSensitivity cs=Qt::CaseSensitive) noexcept
 

Detailed Description

Definition at line 299 of file qstringconverter_p.h.

Member Function Documentation

◆ compareUtf8() [1/3]

int QUtf8::compareUtf8 ( QByteArrayView lhs,
QByteArrayView rhs,
Qt::CaseSensitivity cs = Qt::CaseSensitive )
staticnoexcept

Definition at line 900 of file qstringconverter.cpp.

References Qt::CaseSensitive, output, and QtMiscUtils::qt_lencmp().

+ Here is the call graph for this function:

◆ compareUtf8() [2/3]

int QUtf8::compareUtf8 ( QByteArrayView utf8,
QLatin1StringView s,
Qt::CaseSensitivity cs = Qt::CaseSensitive )
static

Definition at line 870 of file qstringconverter.cpp.

References Qt::CaseInsensitive, and output.

◆ compareUtf8() [3/3]

int QUtf8::compareUtf8 ( QByteArrayView utf8,
QStringView utf16,
Qt::CaseSensitivity cs = Qt::CaseSensitive )
staticnoexcept

Definition at line 830 of file qstringconverter.cpp.

References Qt::CaseInsensitive, output, and simdCompareAscii().

Referenced by QStringView::compareStrings(), QStringView::compareStrings(), QStringView::compareStrings(), QCborContainerPrivate::compareUtf8(), QCborContainerPrivate::compareUtf8(), QtPrivate::equalStrings(), and QtPrivate::equalStrings().

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

◆ convertFromLatin1()

char * QUtf8::convertFromLatin1 ( char * out,
QLatin1StringView in )
static

Definition at line 581 of file qstringconverter.cpp.

References ch, and out.

Referenced by QCborStreamWriter::append().

+ Here is the caller graph for this function:

◆ convertFromUnicode() [1/3]

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

Definition at line 511 of file qstringconverter.cpp.

References QStringConverterBase::ConvertInvalidToNull, cursor, QUtf8BaseTraits::EndOfString, QUtf8BaseTraits::Error, HeaderDone, out, Q_ASSERT, Q_LIKELY, simdEncodeAscii(), state, QStringConverterBase::Stateless, utf8bom, and QStringConverterBase::WriteBom.

+ Here is the call graph for this function:

◆ convertFromUnicode() [2/3]

QByteArray QUtf8::convertFromUnicode ( QStringView in)
static

Definition at line 474 of file qstringconverter.cpp.

References simdEncodeAscii(), and Qt::Uninitialized.

Referenced by QLocal8Bit::convertFromUnicode(), convertFromUnicode(), and qt_convert_to_utf8().

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

◆ convertFromUnicode() [3/3]

QByteArray QUtf8::convertFromUnicode ( QStringView in,
QStringConverterBase::State * state )
static

Definition at line 503 of file qstringconverter.cpp.

References ba, convertFromUnicode(), QByteArray::data(), state, QByteArray::truncate(), and Qt::Uninitialized.

+ Here is the call graph for this function:

◆ convertToUnicode() [1/6]

char16_t * QUtf8::convertToUnicode ( char16_t * dst,
QByteArrayView in )
staticnoexcept
Since
6.6 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Converts the UTF-8 sequence of bytes viewed by in to a sequence of QChar starting at dst in the destination buffer. The buffer is expected to be large enough to hold the result. An upper bound for the size of the buffer is in.size() QChars.

If, during decoding, an error occurs, a QChar::ReplacementCharacter is written.

Returns a pointer to one past the last QChar written.

This function never throws.

For QChar buffers, instead of casting manually, you can use the static QUtf8::convertToUnicode(QChar *, QByteArrayView) directly.

Definition at line 636 of file qstringconverter.cpp.

References Q_UNLIKELY, simdDecodeAscii(), and utf8bom.

+ Here is the call graph for this function:

◆ convertToUnicode() [2/6]

char16_t * QUtf8::convertToUnicode ( char16_t * dst,
QByteArrayView in,
QStringConverter::State * state )
static

Definition at line 690 of file qstringconverter.cpp.

References begin(), ch, QStringConverterBase::ConvertInitialBom, QStringConverterBase::ConvertInvalidToNull, QUtf8BaseTraits::EndOfString, QUtf8BaseTraits::Error, HeaderDone, Q_ASSERT, simdDecodeAscii(), state, QStringConverterBase::Stateless, and utf8bom.

+ Here is the call graph for this function:

◆ convertToUnicode() [3/6]

QString QUtf8::convertToUnicode ( QByteArrayView in)
static

Definition at line 596 of file qstringconverter.cpp.

References convertToUnicode(), and Qt::Uninitialized.

+ Here is the call graph for this function:

◆ convertToUnicode() [4/6]

QString QUtf8::convertToUnicode ( QByteArrayView in,
QStringConverter::State * state )
static

Definition at line 672 of file qstringconverter.cpp.

References convertToUnicode(), state, and Qt::Uninitialized.

+ Here is the call graph for this function:

◆ convertToUnicode() [5/6]

static QChar * QUtf8::convertToUnicode ( QChar * buffer,
QByteArrayView in )
inlinestaticnoexcept

Definition at line 301 of file qstringconverter_p.h.

References convertToUnicode().

Referenced by append_utf8(), QAbstractConcatenable::convertFromUtf8(), convertToUnicode(), convertToUnicode(), QLocal8Bit::convertToUnicode(), convertToUnicode(), convertToUnicode(), QString::fromUtf8(), QString::insert(), and QCborStreamReaderPrivate::readStringChunk_unicode().

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

◆ convertToUnicode() [6/6]

static QChar * QUtf8::convertToUnicode ( QChar * out,
QByteArrayView in,
QStringConverter::State * state )
inlinestatic

Definition at line 312 of file qstringconverter_p.h.

References convertToUnicode(), out, and state.

+ Here is the call graph for this function:

◆ isValidUtf8()

QUtf8::ValidUtf8Result QUtf8::isValidUtf8 ( QByteArrayView in)
static

Definition at line 799 of file qstringconverter.cpp.

References output, and simdFindNonAscii().

Referenced by QtPrivate::isValidUtf8().

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

The documentation for this struct was generated from the following files: