1 #ifndef JSON_WRITER_H_INCLUDED
2 # define JSON_WRITER_H_INCLUDED
20 virtual std::string write(
const Value &root ) = 0;
35 void enableYAMLCompatibility();
38 virtual std::string write(
const Value &root );
41 void writeValue(
const Value &value );
43 std::string document_;
44 bool yamlCompatiblityEnabled_;
76 virtual std::string write(
const Value &root );
79 void writeValue(
const Value &value );
80 void writeArrayValue(
const Value &value );
81 bool isMultineArray(
const Value &value );
82 void pushValue(
const std::string &value );
84 void writeWithIndent(
const std::string &value );
87 void writeCommentBeforeValue(
const Value &root );
88 void writeCommentAfterValueOnSameLine(
const Value &root );
89 bool hasCommentForValue(
const Value &value );
90 static std::string normalizeEOL(
const std::string &text );
92 typedef std::vector<std::string> ChildValues;
94 ChildValues childValues_;
95 std::string document_;
96 std::string indentString_;
134 void write( std::ostream &out,
const Value &root );
137 void writeValue(
const Value &value );
138 void writeArrayValue(
const Value &value );
139 bool isMultineArray(
const Value &value );
140 void pushValue(
const std::string &value );
142 void writeWithIndent(
const std::string &value );
145 void writeCommentBeforeValue(
const Value &root );
146 void writeCommentAfterValueOnSameLine(
const Value &root );
147 bool hasCommentForValue(
const Value &value );
148 static std::string normalizeEOL(
const std::string &text );
150 typedef std::vector<std::string> ChildValues;
152 ChildValues childValues_;
153 std::ostream* document_;
154 std::string indentString_;
156 std::string indentation_;
157 bool addChildValues_;
168 std::ostream&
operator<<( std::ostream&,
const Value &root );
174 #endif // JSON_WRITER_H_INCLUDED