4#ifndef QANYSTRINGVIEWUTILS_P_H
5#define QANYSTRINGVIEWUTILS_P_H
17#include <QtCore/private/qjson_p.h>
19#include <QtCore/qanystringview.h>
20#include <QtCore/qcbormap.h>
21#include <QtCore/qcborvalue.h>
39 return data->asStringView();
41 return data->asLatin1();
42 return data->asUtf8StringView();
83template<
typename StringView>
86 if constexpr (std::is_same_v<StringView, QStringView>)
88 if constexpr (std::is_same_v<StringView, QLatin1StringView>)
90 if constexpr (std::is_same_v<StringView, QUtf8StringView>)
102template<
typename StringView,
typename Handler>
105 if constexpr (std::is_same_v<StringView, QStringView>)
107 if constexpr (std::is_same_v<StringView, QLatin1StringView>)
109 if constexpr (std::is_same_v<StringView, QUtf8StringView>)
111 if constexpr (std::is_same_v<StringView, QByteArrayView>)
112 return handler(
string);
113 if constexpr (std::is_same_v<StringView, QByteArray>)
115 if constexpr (std::is_same_v<StringView, QAnyStringView>) {
124 struct Wrapper { Handler handler; };
126 return string.visit([
w = Wrapper { std::forward<Handler>(handler) }](
auto view)
mutable {
constexpr qsizetype length() const noexcept
Same as size().
constexpr QAnyStringView last(qsizetype n) const
constexpr QAnyStringView first(qsizetype n) const
constexpr decltype(auto) visit(Visitor &&v) const
Calls v with either a QUtf8StringView, QLatin1String, or QStringView, depending on the encoding of th...
constexpr qsizetype size() const noexcept
const_pointer data() const noexcept
bool contains(QByteArrayView a) const noexcept
int toInt(bool *ok=nullptr, int base=10) const
const QtCbor::ByteData * byteData(QtCbor::Element e) const
QList< QtCbor::Element > elements
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
static qint64 valueHelper(const QCborValue &v)
static QCborContainerPrivate * container(const QCborValue &v)
bool contains(QStringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
qsizetype length() const noexcept
const_reference at(qsizetype i) const noexcept
void append(parameter_type t)
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
QMap< QString, QString > map
[6]
bool startsWith(QAnyStringView whole, QAnyStringView part)
QAnyStringView toStringView(const QCborValue &value)
bool contains(QAnyStringView whole, QLatin1Char part)
QList< QAnyStringView > split(QAnyStringView source, QAnyStringView sep)
bool endsWith(QAnyStringView whole, QAnyStringView part)
QAnyStringView trimmed(QAnyStringView string)
int toInt(QUtf8StringView view)
QAnyStringView doTrimmed(StringView string)
auto processAsUtf8(StringView string, Handler &&handler)
bool doesContain(QStringView whole, QLatin1Char part)
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLsizei GLsizei GLchar * source
static constexpr QChar sep
\inmodule QtCore \reentrant
constexpr char toLatin1() const noexcept
Converts a Latin-1 character to an 8-bit ASCII representation of the character.