5#ifndef QSTRINGCONVERTER_BASE_H
6#define QSTRINGCONVERTER_BASE_H
10#pragma qt_sync_stop_processing
15#include <QtCore/qglobal.h>
16#include <QtCore/qflags.h>
17#include <QtCore/qcontainerfwd.h>
18#include <QtCore/qstringfwd.h>
29#if QT_VERSION < QT_VERSION_CHECK(7
, 0
, 0
) && !defined(Q_QDOC) && !defined(QT_BOOTSTRAPPED)
30class QStringConverterBase
44 Q_DECLARE_FLAGS(Flags,
Flag)
88#if QT_VERSION < QT_VERSION_CHECK(7
, 0
, 0
) && !defined(Q_QDOC) && !defined(QT_BOOTSTRAPPED)
103#ifndef QT_BOOTSTRAPPED
120 using DecoderFn = QChar * (*)(QChar *out, QByteArrayView in, State *state);
122 using EncoderFn =
char * (*)(
char *out,
QStringView in, State *state);
139#if QT_CORE_REMOVED_SINCE(6
, 8
)
157 bool hasError()
const noexcept {
return state.invalidChars != 0; }
161#if QT_CORE_REMOVED_SINCE(6
, 8
)
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.
static Q_CORE_EXPORT const char * nameForEncoding(Encoding e)
Returns the canonical name for encoding e.
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