Writes a Value in JSON format in a human friendly way, to a stream rather than to a string. More...
#include "json.h"
Public Member Functions | |
StyledStreamWriter (std::string indentation="\t") | |
~StyledStreamWriter () | |
void | write (std::ostream &out, const Value &root) |
Serialize a Value in JSON format. More... | |
Private Types | |
typedef std::vector< std::string > | ChildValues |
Private Member Functions | |
void | writeValue (const Value &value) |
void | writeArrayValue (const Value &value) |
bool | isMultineArray (const Value &value) |
void | pushValue (const std::string &value) |
void | writeIndent () |
void | writeWithIndent (const std::string &value) |
void | indent () |
void | unindent () |
void | writeCommentBeforeValue (const Value &root) |
void | writeCommentAfterValueOnSameLine (const Value &root) |
bool | hasCommentForValue (const Value &value) |
Static Private Member Functions | |
static std::string | normalizeEOL (const std::string &text) |
Private Attributes | |
ChildValues | childValues_ |
std::ostream * | document_ |
std::string | indentString_ |
int | rightMargin_ |
std::string | indentation_ |
bool | addChildValues_ |
Writes a Value in JSON format in a human friendly way, to a stream rather than to a string.
The rules for line break and indent are as follow:
If the Value have comments then they are outputed according to their CommentPlacement.
indentation | Each level will be indented by this amount extra. |
|
private |
Json::StyledStreamWriter::StyledStreamWriter | ( | std::string | indentation = "\t" | ) |
|
inline |
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
void Json::StyledStreamWriter::write | ( | std::ostream & | out, |
const Value & | root | ||
) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |