6#ifndef NIM_CPP_WRAPPER_UTIL_JSON_WRITER_H_INCLUDED
7#define NIM_CPP_WRAPPER_UTIL_JSON_WRITER_H_INCLUDED
9#if !defined(JSON_IS_AMALGAMATION)
18#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) && defined(_MSC_VER)
20#pragma warning(disable : 4251)
135 Value& operator[](
const String& key);
152 virtual String write(
const Value& root) = 0;
166#pragma warning(disable : 4996)
173 void enableYAMLCompatibility();
180 void dropNullPlaceholders();
182 void omitEndingLineFeed();
185 String write(
const Value& root)
override;
188 void writeValue(
const Value& value);
191 bool yamlCompatibilityEnabled_{
false};
192 bool dropNullPlaceholders_{
false};
193 bool omitEndingLineFeed_{
false};
225#pragma warning(disable : 4996)
237 String write(
const Value& root)
override;
240 void writeValue(
const Value& value);
241 void writeArrayValue(
const Value& value);
242 bool isMultilineArray(
const Value& value);
243 void pushValue(
const String& value);
245 void writeWithIndent(
const String& value);
248 void writeCommentBeforeValue(
const Value& root);
249 void writeCommentAfterValueOnSameLine(
const Value& root);
250 static bool hasCommentForValue(
const Value& value);
251 static String normalizeEOL(
const String& text);
253 using ChildValues = std::vector<String>;
255 ChildValues childValues_;
257 String indentString_;
258 unsigned int rightMargin_{74};
259 unsigned int indentSize_{3};
260 bool addChildValues_{
false};
293#pragma warning(disable : 4996)
310 void write(OStream& out,
const Value& root);
313 void writeValue(
const Value& value);
314 void writeArrayValue(
const Value& value);
315 bool isMultilineArray(
const Value& value);
316 void pushValue(
const String& value);
318 void writeWithIndent(
const String& value);
321 void writeCommentBeforeValue(
const Value& root);
322 void writeCommentAfterValueOnSameLine(
const Value& root);
323 static bool hasCommentForValue(
const Value& value);
324 static String normalizeEOL(
const String& text);
326 using ChildValues = std::vector<String>;
328 ChildValues childValues_;
330 String indentString_;
331 unsigned int rightMargin_{74};
333 bool addChildValues_ : 1;
340#if defined(JSON_HAS_INT64)
341String JSON_API valueToString(Int value);
342String JSON_API valueToString(UInt value);
344String JSON_API valueToString(LargestInt value);
345String JSON_API valueToString(LargestUInt value);
346String JSON_API valueToString(
double value,
348 PrecisionType precisionType = PrecisionType::significantDigits);
349String JSON_API valueToString(
bool value);
350String JSON_API valueToQuotedString(
const char* value);
354JSON_API OStream& operator<<(OStream&,
const Value& root);
361#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
Outputs a Value in JSON format without formatting (not human friendly).
Definition: writer.h:168
A simple abstract factory.
Definition: writer.h:59
virtual StreamWriter * newStreamWriter() const =0
Allocate a CharReader via operator new().
Build a StreamWriter implementation.
Definition: writer.h:89
nim_cpp_wrapper_util::Json::Value settings_
Definition: writer.h:119
virtual int write(Value const &root, OStream *sout)=0
Writes a Value in JSON format in a human friendly way, to a stream rather than to a string.
Definition: writer.h:295
Writes a Value in JSON format in a human friendly way.
Definition: writer.h:227
Represents a JSON value.
Definition: value.h:196
static constexpr UInt defaultRealPrecision
Default precision for real value for string representation.
Definition: value.h:248
Abstract class for writers.
Definition: writer.h:148
JSON (JavaScript Object Notation).
Definition: allocator.h:14