Computer Assisted Medical Intervention Tool Kit  version 6.0
Loading...
Searching...
No Matches
JsonUtils Class Reference

Utility class. More...

#include <JsonUtils.h>

Static Public Member Functions

static void printJSON (QJsonObject data, bool indented=true)
static QJsonObject stringToJSON (QString dataString, bool print=false)
 Creates a QJsonObject from a string.

Detailed Description

Utility class.

useful for simplifying test code

Member Function Documentation

◆ printJSON()

void JsonUtils::printJSON ( QJsonObject data,
bool indented = true )
inlinestatic

Referenced by stringToJSON().

◆ stringToJSON()

QJsonObject JsonUtils::stringToJSON ( QString dataString,
bool print = false )
inlinestatic

Creates a QJsonObject from a string.

e.g. JsonUtils::stringToJSON(R"json({ "field1": { "field2": 0} })json"));

Parameters
dataStringthe input string
printif true prints the resulting a formatted json to stdout
Returns
the build json object

References printJSON().


The documentation for this class was generated from the following file: