6#define CBOR_NO_PARSER_API
7#include <private/qcborcommon_p.h>
9#include <private/qnumeric_p.h>
17#define CBOR_ENCODER_WRITER_CONTROL 1
18#define CBOR_ENCODER_WRITE_FUNCTION qt_cbor_encoder_write_callback
19#define CBOR_ENCODER_NO_CHECK_USER
24#include <cborencoder.c>
32 Q_UNREACHABLE_RETURN(CborErrorInternalError);
37 Q_UNREACHABLE_RETURN(CborErrorInternalError);
214 qWarning(
"QCborStreamWriter: container of size %llu is too big for a 32-bit build; "
215 "will use indeterminate length instead",
len);
216 len = CborIndefiniteLength;
227 qWarning(
"QCborStreamWriter: closing map or array that wasn't open");
232 CborError err = cbor_encoder_close_container(&container, &
encoder);
236 if (err == CborErrorTooFewItems)
237 qWarning(
"QCborStreamWriter: not enough items added to array or map");
238 else if (err == CborErrorTooManyItems)
239 qWarning(
"QCborStreamWriter: too many items added to array or map");
253 return (written ==
qsizetype(
len) ? CborNoError : CborErrorIO);
520#ifndef QT_BOOTSTRAPPED
535 d->
executeAppend(cbor_encode_half_float,
static_cast<const void *
>(&
f));
578 this->d->executeAppend(cbor_encode_double,
d);
596 d->
executeAppend(cbor_encode_byte_string,
reinterpret_cast<const uint8_t *
>(
data),
size_t(
len));
834#undef CBOR_ENCODER_WRITER_CONTROL
835#undef CBOR_ENCODER_WRITE_FUNCTION
836#undef CBOR_ENCODER_NO_CHECK_USER
IOBluetoothDevice * device
\inmodule QtCore \reentrant
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
~QCborStreamWriterPrivate()
void executeAppend(CborError(*f)(CborEncoder *, Args...), Args... args)
QCborStreamWriterPrivate(QIODevice *device)
QStack< CborEncoder > containerStack
static constexpr quint64 IndefiniteLength
void createContainer(CborError(*f)(CborEncoder *, CborEncoder *, size_t), quint64 len=IndefiniteLength)
void setDevice(QIODevice *device)
Replaces the device or byte array that this QCborStreamWriter object is writing to with device.
~QCborStreamWriter()
Destroys this QCborStreamWriter object and frees any resources associated.
bool endMap()
Terminates the map started by either overload of startMap() and returns true if the correct number of...
void startMap()
Starts a CBOR Map with indeterminate length in the CBOR stream.
void appendTextString(const char *utf8, qsizetype len)
Appends len bytes of text starting from utf8 to the stream, creating a CBOR Text String value.
void appendByteString(const char *data, qsizetype len)
Appends len bytes of data starting from data to the stream, creating a CBOR Byte String value.
QCborStreamWriter(QIODevice *device)
Creates a QCborStreamWriter object that will write the stream to device.
void startArray()
Starts a CBOR Array with indeterminate length in the CBOR stream.
void append(quint64 u)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool endArray()
Terminates the array started by either overload of startArray() and returns true if the correct numbe...
QIODevice * device() const
Returns the QIODevice that this QCborStreamWriter object is writing to.
\inmodule QtCore \reentrant
virtual bool open(QIODeviceBase::OpenMode mode)
Opens the device and sets its OpenMode to mode.
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
bool isEmpty() const noexcept
T & top()
Returns a reference to the stack's top item.
T pop()
Removes the top item from the stack and returns it.
void push(const T &t)
Adds element t to the top of the stack.
\macro QT_RESTRICTED_CAST_FROM_ASCII
qsizetype size() const
Returns the number of characters in this string.
QByteArray toUtf8() const &
\keyword 16-bit Floating Point Support\inmodule QtCore \inheaderfile QFloat16
Combined button and popup list for selecting options.
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isAscii(QLatin1StringView s) noexcept
QT_WARNING_PUSH static QT_WARNING_POP CborError cbor_encoder_close_container_checked(CborEncoder *, const CborEncoder *)
static QT_BEGIN_NAMESPACE CborError qt_cbor_encoder_write_callback(void *token, const void *data, size_t len, CborEncoderAppendType)
static CborError cbor_encode_float_as_half_float(CborEncoder *, float)
#define QT_WARNING_DISABLE_MSVC(number)
AudioChannelLayoutTag tag
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
unsigned long long quint64