Maki
Formally verfied low-code orchestration
Loading...
Searching...
No Matches
JSON Class Reference

A class representing a JSON object. More...

#include <json.h>

Inheritance diagram for JSON:

Public Member Functions

 JSON ()
 Constructs an empty JSON object.
 JSON (const QJsonObject &other)
 Constructs a JSON object from another QJsonObject.
QString print () const
 Converts the JSON object to a string representation.

Static Public Member Functions

static Result< JSON > fromFile (const char *filename)
 Creates a JSON object from a file.
static Result< JSON > fromFile (const QString &filename)
 Creates a JSON object from a file.
static QString fromArray (const QVariantList &value, char separator)
 Creates a JSON array from a QVariantList.
static QJsonArray toArray (const QJsonValue &value, char separator)
 Creates a JSON array from a QVariantList.
static QJsonObject fromPointF (const QPointF &value)
 Creates a JSON object from a QPointF.
static QPointF toPointF (const QJsonObject &value)
 Converts a QJsonObject to a QPointF.
static QJsonObject fromSizeF (const QSizeF &value)
 Creates a JSON object from a QSizeF.
static QSizeF toSizeF (const QJsonObject &value)
 Converts a QJsonObject to a QSizeF.
static QJsonObject fromPixmap (const QPixmap &value)
 Creates a JSON object from a QPixmap.
static QPixmap toPixmap (const QJsonObject &value)
 Converts a QJsonObject to a QPixmap.

Detailed Description

A class representing a JSON object.

Constructor & Destructor Documentation

◆ JSON()

JSON::JSON ( const QJsonObject & other)

Constructs a JSON object from another QJsonObject.

Parameters
otherThe QJsonObject to copy.

Member Function Documentation

◆ fromArray()

QString JSON::fromArray ( const QVariantList & value,
char separator )
static

Creates a JSON array from a QVariantList.

Parameters
valueThe QVariantList to convert.
separatorThe separator character.
Returns
QString The resulting string.

◆ fromFile() [1/2]

Result< JSON > JSON::fromFile ( const char * filename)
static

Creates a JSON object from a file.

Parameters
filenameThe path to the file.
Returns
Result<JSON> A result containing the JSON object or an error.

◆ fromFile() [2/2]

Result< JSON > JSON::fromFile ( const QString & filename)
static

Creates a JSON object from a file.

Parameters
filenameThe path to the file.
Returns
Result<JSON> A result containing the JSON object or an error.

◆ fromPixmap()

QJsonObject JSON::fromPixmap ( const QPixmap & value)
static

Creates a JSON object from a QPixmap.

Parameters
valueThe QPixmap to convert.
Returns
QJsonObject The resulting QJsonObject.

◆ fromPointF()

QJsonObject JSON::fromPointF ( const QPointF & value)
static

Creates a JSON object from a QPointF.

Parameters
valueThe QPointF to convert.
Returns
QJsonObject The resulting QJsonObject.

◆ fromSizeF()

QJsonObject JSON::fromSizeF ( const QSizeF & value)
static

Creates a JSON object from a QSizeF.

Parameters
valueThe QSizeF to convert.
Returns
QJsonObject The resulting QJsonObject.

◆ print()

QString JSON::print ( ) const

Converts the JSON object to a string representation.

Returns
QString The string representation of the JSON object.

◆ toArray()

QJsonArray JSON::toArray ( const QJsonValue & value,
char separator )
static

Creates a JSON array from a QVariantList.

Parameters
valueThe QVariantList to convert.
separatorThe separator character.
Returns
QJsonArray The resulting QJsonArray.

◆ toPixmap()

QPixmap JSON::toPixmap ( const QJsonObject & value)
static

Converts a QJsonObject to a QPixmap.

Parameters
valueThe QJsonObject to convert.
Returns
QPixmap The resulting QPixmap.

◆ toPointF()

QPointF JSON::toPointF ( const QJsonObject & value)
static

Converts a QJsonObject to a QPointF.

Parameters
valueThe QJsonObject to convert.
Returns
QPointF The resulting QPointF.

◆ toSizeF()

QSizeF JSON::toSizeF ( const QJsonObject & value)
static

Converts a QJsonObject to a QSizeF.

Parameters
valueThe QJsonObject to convert.
Returns
QSizeF The resulting QSizeF.

The documentation for this class was generated from the following files:
  • /__w/maki/maki/app/common/json.h
  • /__w/maki/maki/app/common/json.cpp