7#pragma qt_class(QStringConverter)
8#pragma qt_class(QStringConverterBase)
11#ifndef QSTRINGCONVERTER_H
12#define QSTRINGCONVERTER_H
14#include <QtCore/qstringconverter_base.h>
15#include <QtCore/qstring.h>
16#include <QtCore/qstringbuilder.h>
49 {
return DecodedData<const QString &>{
this,
str}; }
51 {
return DecodedData<QStringView>{
this,
in}; }
54 {
return DecodedData<const QString &>{
this,
str}; }
56 {
return DecodedData<QStringView>{
this,
in}; }
114 {
return EncodedData<const QByteArray &>{
this,
ba}; }
116 {
return EncodedData<QByteArrayView>{
this,
ba}; }
119 {
return EncodedData<const QByteArray &>{
this,
ba}; }
121 {
return EncodedData<QByteArrayView>{
this,
ba}; }
154#if defined(QT_USE_FAST_OPERATOR_PLUS) || defined(QT_USE_QSTRINGBUILDER)
161 enum { ExactSize =
false };
165 out =
s.decoder->appendToBuffer(
out,
s.data);
175 enum { ExactSize =
false };
179 out =
s.encoder->appendToBuffer(
out,
s.data);
189 QConcatenable<QStringDecoder::EncodedData<T>>::appendTo(
b,
it);
200 QConcatenable<QStringEncoder::DecodedData<T>>::appendTo(
b,
it);
206template <
typename InputIterator>
207void QString::assign_helper_char8(InputIterator
first, InputIterator last)
209 static_assert(!QString::is_contiguous_iterator_v<InputIterator>,
210 "Internal error: Should have been handed over to the QAnyStringView overload."
213 using ValueType =
typename std::iterator_traits<InputIterator>::value_type;
214 constexpr bool IsFwdIt = std::is_convertible_v<
215 typename std::iterator_traits<InputIterator>::iterator_category,
216 std::forward_iterator_tag
225 if constexpr (IsFwdIt)
231 auto *dend = d.
data() + availableCapacity;
246 if constexpr (!IsFwdIt) {
250 if (dend -
dst <
n) {
256 dend = d.
data() + availableCapacity;
Encoding
\value Utf8 Create a converter to or from UTF-8 \value Utf16 Create a converter to or from UTF-16.
constexpr QStringConverter() noexcept
Q_WEAK_OVERLOAD EncodedData< const QByteArray & > decode(const QByteArray &ba)
constexpr QStringDecoder(Encoding encoding, Flags flags=Flag::Default)
Creates an decoder object using encoding and flags.
Q_WEAK_OVERLOAD QStringDecoder(const QString &name, Flags f=Flag::Default)
EncodedData< QByteArrayView > operator()(QByteArrayView ba)
Q_WEAK_OVERLOAD EncodedData< const QByteArray & > operator()(const QByteArray &ba)
char16_t * appendToBuffer(char16_t *out, QByteArrayView ba)
EncodedData< QByteArrayView > decode(QByteArrayView ba)
Converts ba and returns a struct that is implicitly convertible to QString.
constexpr QStringDecoder(const Interface *i) noexcept
qsizetype requiredSpace(qsizetype inputLength) const
Returns the maximum amount of UTF-16 code units required to be able to process inputLength encoded da...
QChar * appendToBuffer(QChar *out, QByteArrayView ba)
Decodes the sequence of bytes viewed by in and writes the decoded result into the buffer starting at ...
static Q_CORE_EXPORT QStringDecoder decoderForHtml(QByteArrayView data)
Tries to determine the encoding of the HTML in data by looking at leading byte order marks or a chars...
QStringDecoder(const char *name, Flags f=Flag::Default)
Creates an decoder object using name and flags.
constexpr QStringDecoder() noexcept
Default constructs an decoder.
QStringEncoder(const char *name, Flags flags=Flag::Default)
Creates an encoder object using name and flags.
constexpr QStringEncoder() noexcept
Default constructs an encoder.
char * appendToBuffer(char *out, QStringView in)
Encodes in and writes the encoded result into the buffer starting at out.
constexpr QStringEncoder(Encoding encoding, Flags flags=Flag::Default)
Creates an encoder object using encoding and flags.
DecodedData< QStringView > operator()(QStringView in)
Converts in and returns a struct that is implicitly convertible to QByteArray.
Q_WEAK_OVERLOAD DecodedData< const QString & > operator()(const QString &str)
DecodedData< QStringView > encode(QStringView in)
Q_WEAK_OVERLOAD QStringEncoder(const QString &name, Flags flags=Flag::Default)
qsizetype requiredSpace(qsizetype inputLength) const
Returns the maximum amount of characters required to be able to process inputLength decoded data.
Q_WEAK_OVERLOAD DecodedData< const QString & > encode(const QString &str)
constexpr QStringEncoder(const Interface *i) noexcept
\macro QT_RESTRICTED_CAST_FROM_ASCII
void reserve(qsizetype size)
Ensures the string has space for at least size characters.
QString last(qsizetype n) const &
void resize(qsizetype size)
Sets the size of the string to size characters.
QSet< QString >::iterator it
Combined button and popup list for selecting options.
constexpr Initialization Uninitialized
constexpr timespec & operator+=(timespec &t1, const timespec &t2)
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLuint GLintptr offset
QBasicUtf8StringView< false > QUtf8StringView
QTextStream out(stdout)
[7]
qsizetype freeSpaceAtBegin() const noexcept
void setBegin(T *begin) noexcept
qsizetype constAllocatedCapacity() const noexcept