40 #ifndef QCBORVALUE_P_H
41 #define QCBORVALUE_P_H
56 #if QT_CONFIG(cborstreamreader)
60 #include <private/qglobal_p.h>
61 #include <private/qstringconverter_p.h>
102 static_assert(
sizeof(Element) == 16);
108 const char *
byte()
const {
return reinterpret_cast<const char *
>(
this + 1); }
109 char *
byte() {
return reinterpret_cast<char *
>(
this + 1); }
177 size_t offset = size_t(
e.value);
205 if (
value.isContainer())
206 e.container =
nullptr;
212 e.container->deref();
213 e.container =
nullptr;
238 QtCbor::Element::ValueFlags extraFlags = {})
263 #if QT_STRINGVIEW_LEVEL < 2
289 return data->toByteArray();
298 return data->toString();
300 return data->asLatin1();
301 return data->toUtf8String();
306 v.container =
nullptr;
344 e.container->deref();
362 if (
value.container) {
363 e.container =
value.container;
379 template<
typename String>
387 return s.isEmpty() ? 0 : -1;
394 template<
typename String>
400 template<
typename String>
421 #if QT_CONFIG(cborstreamreader)
The QByteArray class provides an array of bytes.
static QByteArray fromRawData(const char *data, qsizetype size)
QString stringAt(qsizetype idx) const
void insertAt(qsizetype idx, const QCborValue &value, ContainerDisposition disp=CopyContainer)
QByteArray::size_type usedData
QCborContainerPrivate * containerAt(qsizetype idx, QCborValue::Type type) 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 int compareUtf8(const QtCbor::ByteData *b, const QLatin1String &s)
static QCborContainerPrivate * grow(QCborContainerPrivate *d, qsizetype index)
static QCborContainerPrivate * detach(QCborContainerPrivate *d, qsizetype reserved)
bool stringEqualsElement(const QtCbor::Element &e, String s) const
void removeAt(qsizetype idx)
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
const QtCbor::ByteData * byteData(QtCbor::Element e) const
void append(QtCbor::Undefined)
QByteArray byteArrayAt(qsizetype idx) 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)
QCborValue extractAt_complex(QtCbor::Element e)
void append(QLatin1String s)
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)
bool stringEqualsElement(qsizetype idx, String s) const
QCborValue valueAt(qsizetype idx) const
void append(qint64 value)
static QCborContainerPrivate * clone(QCborContainerPrivate *d, qsizetype reserved=-1)
The QCborStreamReader class is a simple CBOR stream decoder, operating on either a QByteArray or QIOD...
The QCborValue class encapsulates a value in CBOR.
The QChar class provides a 16-bit Unicode character.
The QExplicitlySharedDataPointer class represents a pointer to an explicitly shared object.
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
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)
The QSharedData class is a base class for shared data objects. \reentrant.
The QString class provides a Unicode character string.
static QString fromUtf8(QByteArrayView utf8)
static QString fromRawData(const QChar *, qsizetype size)
The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QStrin...
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isAscii(QLatin1String s) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs=Qt::CaseSensitive) noexcept
QImageReader reader("image.png")
[1]
Q_DECLARE_TYPEINFO(QtCbor::Element, Q_PRIMITIVE_TYPE)
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
EGLOutputLayerEXT EGLint EGLAttrib value
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
QStringView qToStringViewIgnoringNull(const QStringLike &s) noexcept
QtConcurrent::task([]{ qDebug("Hello, world!");}).spawn(FutureResult void increment(QPromise< int > &promise, int i)
[10]
The QCborError class holds the error condition found while parsing or validating a CBOR stream.
static int compareUtf8(QByteArrayView utf8, QStringView utf16) noexcept
QString toUtf8String() const
const char * byte() const
QStringView asStringView() const
QString asQStringRaw() const
const QChar * utf16() const
QLatin1String asLatin1() 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
XmlOutput::xml_output tag(const QString &name)