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

Utility class. More...

#include <JsonUtils.h>

+ Collaboration diagram for JsonUtils:

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()

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

Referenced by stringToJSON().

+ Here is the caller graph for this function:

◆ stringToJSON()

static 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().

+ Here is the call graph for this function:

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