Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QUtf8 Struct Reference

#include <qstringconverter_p.h>

+ Collaboration diagram for QUtf8:

Classes

struct  ValidUtf8Result
 

Public Member Functions

template<typename OnErrorLambda>
Q_ALWAYS_INLINE char * convertFromUnicode (char *out, QStringView in, OnErrorLambda &&onError) noexcept
 
template<typename OnErrorLambda>
Q_ALWAYS_INLINE char16_t * convertToUnicode (char16_t *dst, QByteArrayView in, OnErrorLambda &&onError) noexcept
 

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 char * convertFromUnicode (char *dst, QStringView in) noexcept
 
static Q_CORE_EXPORT QByteArray convertFromUnicode (QStringView in)
 
static Q_CORE_EXPORT QByteArray convertFromUnicode (QStringView in, QStringConverter::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 301 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 1104 of file qstringconverter.cpp.

◆ compareUtf8() [2/3]

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

Definition at line 1074 of file qstringconverter.cpp.

◆ compareUtf8() [3/3]

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

Definition at line 1034 of file qstringconverter.cpp.

◆ convertFromLatin1()

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

Definition at line 783 of file qstringconverter.cpp.

◆ convertFromUnicode() [1/5]

char * QUtf8::convertFromUnicode ( char * dst,
QStringView in )
staticnoexcept

Definition at line 698 of file qstringconverter.cpp.

◆ convertFromUnicode() [2/5]

template<typename OnErrorLambda>
Q_ALWAYS_INLINE char * QUtf8::convertFromUnicode ( char * out,
QStringView in,
OnErrorLambda && onError )
noexcept

Definition at line 674 of file qstringconverter.cpp.

◆ convertFromUnicode() [3/5]

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

Definition at line 726 of file qstringconverter.cpp.

◆ convertFromUnicode() [4/5]

QByteArray QUtf8::convertFromUnicode ( QStringView in)
static

Definition at line 706 of file qstringconverter.cpp.

◆ convertFromUnicode() [5/5]

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

Definition at line 718 of file qstringconverter.cpp.

◆ convertToUnicode() [1/7]

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 838 of file qstringconverter.cpp.

◆ convertToUnicode() [2/7]

template<typename OnErrorLambda>
Q_ALWAYS_INLINE char16_t * QUtf8::convertToUnicode ( char16_t * dst,
QByteArrayView in,
OnErrorLambda && onError )
noexcept

Definition at line 853 of file qstringconverter.cpp.

◆ convertToUnicode() [3/7]

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

Definition at line 898 of file qstringconverter.cpp.

◆ convertToUnicode() [4/7]

QString QUtf8::convertToUnicode ( QByteArrayView in)
static

Definition at line 798 of file qstringconverter.cpp.

◆ convertToUnicode() [5/7]

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

Definition at line 880 of file qstringconverter.cpp.

◆ convertToUnicode() [6/7]

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

Definition at line 303 of file qstringconverter_p.h.

◆ convertToUnicode() [7/7]

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

Definition at line 314 of file qstringconverter_p.h.

◆ isValidUtf8()

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

Definition at line 1003 of file qstringconverter.cpp.


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