5#ifndef QSTRINGCONVERTER_BASE_H
6#define QSTRINGCONVERTER_BASE_H
11#pragma qt_sync_stop_processing
16#include <QtCore/qglobal.h>
17#include <QtCore/qflags.h>
18#include <QtCore/qcontainerfwd.h>
19#include <QtCore/qstringfwd.h>
30#if QT_VERSION < QT_VERSION_CHECK(7
, 0
, 0
) && !defined(Q_QDOC) && !defined(QT_BOOTSTRAPPED)
31class QStringConverterBase
45 Q_DECLARE_FLAGS(Flags,
Flag)
89#if QT_VERSION < QT_VERSION_CHECK(7
, 0
, 0
) && !defined(Q_QDOC) && !defined(QT_BOOTSTRAPPED)
104#ifndef QT_BOOTSTRAPPED
121 using DecoderFn = QChar * (*)(QChar *out, QByteArrayView in, State *state);
140#if QT_CORE_REMOVED_SINCE(6
, 8
)
158 bool hasError()
const noexcept {
return state.invalidChars != 0; }
162#if QT_CORE_REMOVED_SINCE(6
, 8
)
182 template <
typename Char>
Q_CORE_EXPORT const char * name() const noexcept
Returns the canonical name of the encoding this QStringConverter can encode or decode.
bool hasError() const noexcept
Returns true if a conversion could not correctly convert a character.
constexpr QStringConverter(Encoding encoding, Flags f)
QStringConverter(QStringConverter &&)=default
Flag
\value Default Default conversion rules apply.
bool isValid() const noexcept
Returns true if this is a valid string converter that can be used for encoding or decoding text.
void resetState() noexcept
Resets the internal state of the converter, clearing potential errors or partial conversions.
~QStringConverter()=default
Encoding
\value Utf8 Create a converter to or from UTF-8 \value Utf16 Create a converter to or from UTF-16.
constexpr QStringConverter(const Interface *i) noexcept
QStringConverter & operator=(QStringConverter &&)=default
constexpr QStringConverter() noexcept
Error
\value NoError No error.
FinalizeResultBase::Error Error
QChar *(*)(QChar *out, QByteArrayView in, State *state) DecoderFn
char *(*)(char *out, QStringView in, State *state) EncoderFn