JSON tools.
More...
#include <cppexpose/include/cppexpose/json/JSON.h>
JSON output mode.
Enumerator |
---|
Compact |
Create JSON without indentation and newlines.
|
Beautify |
Create better readable JSON with indentation and newlines.
|
static std::string cppexpose::JSON::stringify |
( |
const Variant & |
root, |
|
|
OutputMode |
outputMode = Compact |
|
) |
| |
|
static |
Linearize JSON to string.
- Parameters
-
[in] | root | Variant value |
[in] | outputMode | JSON output mode |
- Returns
- JSON string
static void cppexpose::JSON::stringify |
( |
std::ostream & |
stream, |
|
|
const Variant & |
root, |
|
|
OutputMode |
outputMode = Compact |
|
) |
| |
|
static |
Linearize JSON to string.
- Parameters
-
[in] | stream | Stream to write results to |
[in] | root | Variant value |
[in] | outputMode | JSON output mode |
static bool cppexpose::JSON::load |
( |
Variant & |
root, |
|
|
const std::string & |
filename |
|
) |
| |
|
static |
Load JSON from file.
- Parameters
-
[out] | root | Output variant |
[in] | filename | Filename of JSON file |
- Returns
- 'true' if all went fine, 'false' on error
static bool cppexpose::JSON::parse |
( |
Variant & |
root, |
|
|
const std::string & |
document |
|
) |
| |
|
static |
Parse JSON from string.
- Parameters
-
[out] | root | Output variant |
[in] | document | JSON string |
- Returns
- 'true' if all went fine, 'false' on error
The documentation for this class was generated from the following file: