20#if QT_CONFIG(cborstreamreader)
24#include <private/qglobal_p.h>
25#include <private/qstringconverter_p.h>
66static_assert(
sizeof(Element) == 16);
72 const char *
byte()
const {
return reinterpret_cast<const char *
>(
this + 1); }
73 char *
byte() {
return reinterpret_cast<char *
>(
this + 1); }
87static_assert(std::is_trivial<ByteData>::value);
88static_assert(std::is_standard_layout<ByteData>::value);
132 memcpy(
b->byte(), block,
len);
142 size_t offset = size_t(
e.value);
170 if (
value.isContainer())
171 e.container =
nullptr;
177 e.container->deref();
178 e.container =
nullptr;
203 QtCbor::Element::ValueFlags extraFlags = {})
252 return data->toByteArray();
261 return data->toString();
263 return data->asLatin1();
264 return data->toUtf8String();
269 v.container =
nullptr;
307 e.container->deref();
325 if (
value.container) {
326 e.container =
value.container;
342 template<
typename String>
350 return s.isEmpty() ? 0 : -1;
357 template<
typename String>
363 template<
typename String>
391 if constexpr (std::is_same_v<std::decay_t<KeyType>,
QCborValue>) {
393 }
else if constexpr (std::is_integral_v<KeyType>) {
402 return {
this,
i + 1 };
406 if (self.isMap() && self.container) {
409 return self.container->valueAt(idx);
413 template <
typename KeyType>
static QCborValueRef
434 return { container,
index };
438 template <
typename KeyType>
static QCborValueRef
findOrAddMapKey(QCborValueRef self, KeyType
key);
440#if QT_CONFIG(cborstreamreader)
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
QString stringAt(qsizetype idx) const
void insertAt(qsizetype idx, const QCborValue &value, ContainerDisposition disp=CopyContainer)
QByteArray::size_type usedData
const QtCbor::ByteData * byteData(QtCbor::Element e) const
static int compareUtf8(const QtCbor::ByteData *b, QStringView s)
void replaceAt_internal(QtCbor::Element &e, const QCborValue &value, ContainerDisposition disp)
void append(QStringView s)
void appendUtf8String(const char *str, qsizetype len)
void append(const QString &s)
void append(const QCborValue &v)
const QtCbor::ByteData * byteData(qsizetype idx) const
void appendByteData(const char *data, qsizetype len, QCborValue::Type type, QtCbor::Element::ValueFlags extraFlags={})
static QCborContainerPrivate * grow(QCborContainerPrivate *d, qsizetype index)
Prepare for an insertion at position index.
static QCborContainerPrivate * detach(QCborContainerPrivate *d, qsizetype reserved)
bool stringEqualsElement(const QtCbor::Element &e, String s) const
void removeAt(qsizetype idx)
static int compareUtf8(const QtCbor::ByteData *b, QLatin1StringView s)
void append(QLatin1StringView s)
QCborValueConstRef findCborMapKey(KeyType key)
void replaceAt(qsizetype idx, const QCborValue &value, ContainerDisposition disp=CopyContainer)
QList< QtCbor::Element > elements
void append(QCborTag tag)
void compact(qsizetype reserved)
void appendAsciiString(const char *str, qsizetype len)
QCborValue extractAt(qsizetype idx)
int stringCompareElement(const QtCbor::Element &e, String s) const
void append(QtCbor::Undefined)
QByteArray byteArrayAt(qsizetype idx) const
QCborContainerPrivate * containerAt(qsizetype idx, QCborValue::Type type) const
static QCborValue makeValue(QCborValue::Type type, qint64 n, QCborContainerPrivate *d=nullptr, ContainerDisposition disp=CopyContainer)
static int compareElement_helper(const QCborContainerPrivate *c1, QtCbor::Element e1, const QCborContainerPrivate *c2, QtCbor::Element e2)
static QCborValueRef findOrAddMapKey(QCborContainerPrivate *container, KeyType key)
QCborValue extractAt_complex(QtCbor::Element e)
void appendAsciiString(const QString &s)
int compareElement(qsizetype idx, const QCborValue &value) const
qptrdiff addByteData(const char *block, qsizetype len)
static QtCbor::Element elementFromValue(const QCborValue &value)
void replaceAt_complex(QtCbor::Element &e, const QCborValue &value, ContainerDisposition disp)
static void resetValue(QCborValue &v)
static QCborValue findCborMapKey(const QCborValue &self, KeyType key)
bool stringEqualsElement(qsizetype idx, String s) const
QCborValue valueAt(qsizetype idx) const
void append(qint64 value)
static QCborContainerPrivate * clone(QCborContainerPrivate *d, qsizetype reserved=-1)
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
Type
This enum represents the QCborValue type.
qsizetype size() const noexcept
iterator insert(qsizetype i, parameter_type t)
const_reference at(qsizetype i) const noexcept
void remove(qsizetype i, qsizetype n=1)
void append(parameter_type t)
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString fromRawData(const QChar *, qsizetype size)
Constructs a QString that uses the first size Unicode characters in the array unicode.
QMap< QString, QString > map
[6]
Combined button and popup list for selecting options.
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs=Qt::CaseSensitive) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isAscii(QLatin1StringView s) noexcept
AudioChannelLayoutTag tag
DBusConnection const char DBusError * error
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
static ControlElement< T > * ptr(QWidget *widget)
constexpr const T & qMax(const T &a, const T &b)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
QBasicUtf8StringView< false > QUtf8StringView
QStringView qToStringViewIgnoringNull(const QStringLike &s) noexcept
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
QtConcurrent::task([]{ qDebug("Hello, world!");}).spawn(FutureResult void increment(QPromise< int > &promise, int i)
[10]
\inmodule QtCore \inheaderfile QtCborCommon \reentrant
static int compareUtf8(QByteArrayView utf8, QStringView utf16, Qt::CaseSensitivity cs=Qt::CaseSensitive) noexcept
QString toUtf8String() const
QStringView asStringView() const
QUtf8StringView asUtf8StringView() const
QLatin1StringView asLatin1() const
QString asQStringRaw() const
const QChar * utf16() const
const char * byte() const
QByteArray::size_type len
QByteArray asByteArrayView() const
QByteArray toByteArray() const
Element(qint64 v=0, QCborValue::Type t=QCborValue::Undefined, ValueFlags f={})
Element(QCborContainerPrivate *d, QCborValue::Type t, ValueFlags f={})
QCborContainerPrivate * container