6 #ifndef JSON_WRITER_H_INCLUDED
7 #define JSON_WRITER_H_INCLUDED
9 #if !defined(JSON_IS_AMALGAMATION)
11 #endif // if !defined(JSON_IS_AMALGAMATION)
18 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
20 #pragma warning(disable : 4251)
21 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
52 virtual int write(
Value const& root, std::ostream* sout) = 0;
128 Value& operator[](std::string key);
145 virtual std::string write(
const Value& root) = 0;
163 void enableYAMLCompatibility();
170 void dropNullPlaceholders();
172 void omitEndingLineFeed();
175 std::string write(
const Value& root)
override;
178 void writeValue(
const Value& value);
180 std::string document_;
181 bool yamlCompatiblityEnabled_;
182 bool dropNullPlaceholders_;
183 bool omitEndingLineFeed_;
220 std::string write(
const Value& root)
override;
223 void writeValue(
const Value& value);
224 void writeArrayValue(
const Value& value);
225 bool isMultineArray(
const Value& value);
226 void pushValue(
const std::string& value);
228 void writeWithIndent(
const std::string& value);
231 void writeCommentBeforeValue(
const Value& root);
232 void writeCommentAfterValueOnSameLine(
const Value& root);
233 bool hasCommentForValue(
const Value& value);
234 static std::string
normalizeEOL(
const std::string& text);
236 typedef std::vector<std::string> ChildValues;
238 ChildValues childValues_;
239 std::string document_;
240 std::string indentString_;
243 bool addChildValues_;
284 void write(std::ostream& out,
const Value& root);
287 void writeValue(
const Value& value);
288 void writeArrayValue(
const Value& value);
289 bool isMultineArray(
const Value& value);
290 void pushValue(
const std::string& value);
292 void writeWithIndent(
const std::string& value);
295 void writeCommentBeforeValue(
const Value& root);
296 void writeCommentAfterValueOnSameLine(
const Value& root);
297 bool hasCommentForValue(
const Value& value);
298 static std::string
normalizeEOL(
const std::string& text);
300 typedef std::vector<std::string> ChildValues;
302 ChildValues childValues_;
303 std::ostream* document_;
304 std::string indentString_;
306 std::string indentation_;
307 bool addChildValues_ : 1;
311 #if defined(JSON_HAS_INT64)
314 #endif // if defined(JSON_HAS_INT64)
327 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
329 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
331 #endif // JSON_WRITER_H_INCLUDED