4#ifndef QCBORSTREAMREADER_H
5#define QCBORSTREAMREADER_H
7#include <QtCore/qbytearray.h>
8#include <QtCore/qcborcommon.h>
9#include <QtCore/qfloat16.h>
10#include <QtCore/qscopedpointer.h>
11#include <QtCore/qstring.h>
12#include <QtCore/qstringview.h>
17#if defined(False) && defined(True)
33 NegativeInteger = 0x20,
35 ByteArray = ByteString,
75 { addData(
reinterpret_cast<const char *
>(
data),
len); }
82 qint64 currentOffset()
const;
84 bool isValid()
const {
return !isInvalid(); }
86 int containerDepth()
const;
89 bool next(
int maxRecursion = 10000);
109 bool isBool()
const {
return isFalse() || isTrue(); }
116 bool isContainer()
const {
return isMap() || isArray(); }
118 bool leaveContainer();
123 StringResult<qsizetype> readStringChunk(
char *
ptr,
qsizetype maxlen);
138 if (isNegativeInteger())
145 bool _enterContainer_helper();
146 StringResult<QString> _readString_helper();
147 StringResult<QByteArray> _readByteArray_helper();
148 qsizetype _currentStringChunkSize()
const;
150 template <
typename FP> FP _toFloatingPoint() const noexcept
152 using UIntFP =
typename QIntegerForSizeof<FP>::Unsigned;
153 UIntFP u = UIntFP(value64);
155 memcpy(
static_cast<void *
>(&
f), &u,
sizeof(
f));
169#if defined(QT_X11_DEFINES_FOUND)
IOBluetoothDevice * device
\inmodule QtCore\reentrant
bool isSimpleType() const
Returns true if the type of the current element is any CBOR simple type, including a boolean value (t...
double toDouble() const
Returns the 64-bit double-precision floating point value of the current element.
bool isNull() const
Returns true if the current element is the null value, false if it is anything else.
bool isByteArray() const
Returns true if the type of the current element is a byte array (that is, if type() returns QCborStre...
qfloat16 toFloat16() const
Returns the 16-bit half-precision floating point value of the current element.
float toFloat() const
Returns the 32-bit single-precision floating point value of the current element.
bool isNegativeInteger() const
Returns true if the type of the current element is a negative integer (that is if type() returns QCbo...
QCborSimpleType toSimpleType() const
Returns value of the current simple type.
QCborTag toTag() const
Returns the tag value of the current element.
bool isString() const
Returns true if the type of the current element is a text string (that is, if type() returns QCborStr...
bool isFloat() const
Returns true if the type of the current element is an IEEE 754 single-precision floating point (that ...
bool isArray() const
Returns true if the type of the current element is an array (that is, if type() returns QCborStreamRe...
bool isFalse() const
Returns true if the current element is the false value, false if it is anything else.
StringResult< QByteArray > readByteArray()
Decodes one byte array chunk from the CBOR string and returns it.
bool isMap() const
Returns true if the type of the current element is a map (that is, if type() returns QCborStreamReade...
void addData(const quint8 *data, qsizetype len)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isInvalid() const
Returns true if the current element is invalid, false otherwise.
bool isTag() const
Returns true if the type of the current element is a CBOR tag (that is, if type() returns QCborStream...
bool enterContainer()
Enters the array or map that is the current item and prepares for iterating the elements contained in...
bool isUnsignedInteger() const
Returns true if the type of the current element is an unsigned integer (that is if type() returns QCb...
bool isFloat16() const
Returns true if the type of the current element is an IEEE 754 half-precision floating point (that is...
QCborNegativeInteger toNegativeInteger() const
Returns the negative integer value of the current element.
bool isValid() const
Returns true if the current element is valid, false otherwise.
StringResult< QString > readString()
Decodes one string chunk from the CBOR string and returns it.
bool toBool() const
Returns the boolean value of the current element.
bool isTrue() const
Returns true if the current element is the true value, false if it is anything else.
qsizetype currentStringChunkSize() const
Returns the size of the current text or byte string chunk.
bool isBool() const
Returns true if the current element is a boolean value (true or false), false if it is anything else.
quint64 toUnsignedInteger() const
Returns the unsigned integer value of the current element.
StringResultCode
This enum is returned by readString() and readByteArray() and is used to indicate what the status of ...
bool isInteger() const
Returns true if the type of the current element is either an unsigned integer or a negative one (that...
bool isDouble() const
Returns true if the type of the current element is an IEEE 754 double-precision floating point (that ...
Type
This enumeration contains all possible CBOR types as decoded by QCborStreamReader.
bool isSimpleType(QCborSimpleType st) const
Returns true if the type of the current element is the simple type st, false otherwise.
qint64 toInteger() const
Returns the integer value of the current element, be it negative, positive or zero.
bool isUndefined() const
Returns true if the current element is the undefined value, false if it is anything else.
\inmodule QtCore \reentrant
\keyword 16-bit Floating Point Support\inmodule QtCore \inheaderfile QFloat16
Combined button and popup list for selecting options.
#define Q_DECL_PURE_FUNCTION
static ControlElement< T > * ptr(QWidget *widget)
GLsizei const GLfloat * v
[13]
GLenum GLuint GLenum GLsizei length
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
static bool hasNext(const Symbols &symbols, int i)
#define QT_REQUIRE_CONFIG(feature)
unsigned long long quint64
QList< QPair< QString, QString > > Map
value isSimpleType(QCborSimpleType(12))
[1]
\inmodule QtCore \inheaderfile QtCborCommon \reentrant