9#include "private/qstringconverter_p.h"
10#include <private/qnumeric_p.h>
11#include <private/qcborvalue_p.h>
22 return (u < 0xa ?
'0' + u :
'a' + u - 0xa);
30 auto ba_const_start = [&]() {
return reinterpret_cast<const uchar *
>(
ba.
constData()); };
33 const char16_t *
src =
s.utf16();
34 const char16_t *
const end =
s.utf16() +
s.size();
37 if (
cursor >= ba_end - 6) {
42 ba_end = ba_const_start() +
ba.
size();
47 if (u < 0x20 || u == 0x22 || u == 0x5c) {
81 }
else if (QUtf8Functions::toUtf8<QUtf8BaseTraits>(u,
cursor,
src,
end) < 0) {
110 const double d =
v.toDouble();
123 json += compact ?
"[" :
"[\n";
130 json += compact ?
"{" :
"{\n";
144 if (!
a ||
a->elements.empty())
151 json += indentString;
154 if (++
i ==
a->elements.size()) {
160 json += compact ?
"," :
",\n";
167 if (!
o ||
o->elements.empty())
175 json += indentString;
178 json += compact ?
"\":" :
"\": ";
181 if ((
i += 2) ==
o->elements.size()) {
187 json += compact ?
"," :
",\n";
193 json.
reserve(json.
size() + (
o ? (
int)
o->elements.size() : 16));
194 json += compact ?
"{" :
"{\n";
197 json += compact ?
"}" :
"}\n";
202 json.
reserve(json.
size() + (
a ? (
int)
a->elements.size() : 16));
203 json += compact ?
"[" :
"[\n";
206 json += compact ?
"]" :
"]\n";
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
void reserve(qsizetype size)
Attempts to allocate memory for at least size bytes.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
static QByteArray number(int, int base=10)
Returns a byte-array representing the whole number n as text.
void resize(qsizetype size)
Sets the size of the byte array to size bytes.
\inmodule QtCore\reentrant
Type
This enum represents the QCborValue type.
static QCborContainerPrivate * container(const QCborValue &v)
static void objectToJson(const QCborContainerPrivate *o, QByteArray &json, int indent, bool compact=false)
static void arrayToJson(const QCborContainerPrivate *a, QByteArray &json, int indent, bool compact=false)
Combined button and popup list for selecting options.
constexpr Initialization Uninitialized
bool qIsFinite(qfloat16 f) noexcept
static void arrayContentToJson(const QCborContainerPrivate *a, QByteArray &json, int indent, bool compact)
static QByteArray escapedString(QStringView s)
static void objectContentToJson(const QCborContainerPrivate *o, QByteArray &json, int indent, bool compact)
static void valueToJson(const QCborValue &v, QByteArray &json, int indent, bool compact)
static uchar hexdig(uint u)
constexpr const T & qMax(const T &a, const T &b)
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]