Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qjsonwriter.cpp File Reference
#include <cmath>
#include <qlocale.h>
#include "qjsonwriter_p.h"
#include "qjson_p.h"
#include "private/qstringconverter_p.h"
#include <private/qnumeric_p.h>
#include <private/qcborvalue_p.h>
+ Include dependency graph for qjsonwriter.cpp:

Go to the source code of this file.

Functions

static void objectContentToJson (const QCborContainerPrivate *o, QByteArray &json, int indent, bool compact)
 
static void arrayContentToJson (const QCborContainerPrivate *a, QByteArray &json, int indent, bool compact)
 
static uchar hexdig (uint u)
 
static QByteArray escapedString (QStringView s)
 
static void valueToJson (const QCborValue &v, QByteArray &json, int indent, bool compact)
 

Function Documentation

◆ arrayContentToJson()

static void arrayContentToJson ( const QCborContainerPrivate a,
QByteArray json,
int  indent,
bool  compact 
)
static

Definition at line 142 of file qjsonwriter.cpp.

References i, and valueToJson().

Referenced by QJsonPrivate::Writer::arrayToJson(), and valueToJson().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ escapedString()

static QByteArray escapedString ( QStringView  s)
static

Definition at line 25 of file qjsonwriter.cpp.

References ba, QByteArray::constData(), cursor, QByteArray::data(), hexdig(), pos, qMax(), QByteArray::resize(), QByteArray::size(), and Qt::Uninitialized.

Referenced by objectContentToJson(), and valueToJson().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hexdig()

static uchar hexdig ( uint  u)
inlinestatic

Definition at line 20 of file qjsonwriter.cpp.

Referenced by escapedString().

+ Here is the caller graph for this function:

◆ objectContentToJson()

static void objectContentToJson ( const QCborContainerPrivate o,
QByteArray json,
int  indent,
bool  compact 
)
static

Definition at line 165 of file qjsonwriter.cpp.

References e, escapedString(), i, o, and valueToJson().

Referenced by QJsonPrivate::Writer::objectToJson(), and valueToJson().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ valueToJson()

static void valueToJson ( const QCborValue v,
QByteArray json,
int  indent,
bool  compact 
)
static

Definition at line 96 of file qjsonwriter.cpp.

References QCborValue::Array, arrayContentToJson(), QJsonPrivate::Value::container(), d, QCborValue::Double, escapedString(), QCborValue::False, QLocale::FloatingPointShortest, QCborValue::Integer, QCborValue::Map, QCborValue::Null, QByteArray::number(), objectContentToJson(), qIsFinite(), QCborValue::String, and QCborValue::True.

Referenced by arrayContentToJson(), and objectContentToJson().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: