CYCLUS
|
Writes a Value in JSON format with custom formatting.
The JSON document is written according to the rules specified in the constructor. Objects and arrays are printed on a single line if they are below a certain length, otherwise they are indented. It is possible to output invalid json if the customizable parameters are specified incorrectly. Set maxWidth to 0 to print output on a single line.
#include <pyne.h>
Public Member Functions | |
CustomWriter (std::string opencurly="{", std::string closecurly="}", std::string opensquare="[", std::string closesquare="]", std::string colon=":", std::string comma=",", std::string indent=" ", int maxWidth=74) | |
virtual std::string | write (const Value &root) |
virtual | ~CustomWriter () |
Public Member Functions inherited from Json::Writer | |
virtual | ~Writer () |
Json::CustomWriter::CustomWriter | ( | std::string | opencurly = "{", |
std::string | closecurly = "}", | ||
std::string | opensquare = "[", | ||
std::string | closesquare = "]", | ||
std::string | colon = ":", | ||
std::string | comma = ",", | ||
std::string | indent = " ", | ||
int | maxWidth = 74 ) |
|
virtual |
Implements Json::Writer.