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) && defined(_MSC_VER)
20 #pragma warning(disable : 4251)
21 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
166 #if defined(_MSC_VER)
167 #pragma warning(push)
168 #pragma warning(disable : 4996) // Deriving from deprecated class
176 void enableYAMLCompatibility();
183 void dropNullPlaceholders();
185 void omitEndingLineFeed();
191 void writeValue(
const Value& value);
194 bool yamlCompatibilityEnabled_{
false};
195 bool dropNullPlaceholders_{
false};
196 bool omitEndingLineFeed_{
false};
198 #if defined(_MSC_VER)
226 #if defined(_MSC_VER)
227 #pragma warning(push)
228 #pragma warning(disable : 4996) // Deriving from deprecated class
244 void writeValue(
const Value& value);
245 void writeArrayValue(
const Value& value);
246 bool isMultilineArray(
const Value& value);
247 void pushValue(
const String& value);
249 void writeWithIndent(
const String& value);
252 void writeCommentBeforeValue(
const Value& root);
253 void writeCommentAfterValueOnSameLine(
const Value& root);
254 static bool hasCommentForValue(
const Value& value);
257 using ChildValues = std::vector<String>;
259 ChildValues childValues_;
262 unsigned int rightMargin_{74};
263 unsigned int indentSize_{3};
264 bool addChildValues_{
false};
266 #if defined(_MSC_VER)
295 #if defined(_MSC_VER)
296 #pragma warning(push)
297 #pragma warning(disable : 4996) // Deriving from deprecated class
318 void writeValue(
const Value& value);
319 void writeArrayValue(
const Value& value);
320 bool isMultilineArray(
const Value& value);
321 void pushValue(
const String& value);
323 void writeWithIndent(
const String& value);
326 void writeCommentBeforeValue(
const Value& root);
327 void writeCommentAfterValueOnSameLine(
const Value& root);
328 static bool hasCommentForValue(
const Value& value);
331 using ChildValues = std::vector<String>;
333 ChildValues childValues_;
336 unsigned int rightMargin_{74};
338 bool addChildValues_ : 1;
341 #if defined(_MSC_VER)
345 #if defined(JSON_HAS_INT64)
348 #endif // if defined(JSON_HAS_INT64)
365 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
367 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
369 #endif // JSON_WRITER_H_INCLUDED
Outputs a Value in JSON format without formatting (not human friendly).
A simple abstract factory.
Writes a Value in JSON format in a human friendly way.
#define JSON_API
If defined, indicates that the source file is amalgamated to prevent private header inclusion...
PrecisionType
Type of precision for formatting of real values.
String valueToString(Int value)
OStream & operator<<(OStream &, const Value &root)
Output using the StyledStreamWriter.
std::basic_string< char, std::char_traits< char >, Allocator< char >> String
String writeString(StreamWriter::Factory const &factory, Value const &root)
Write into stringstream, then return string, for convenience.
static constexpr UInt defaultRealPrecision
Default precision for real value for string representation.
JSON (JavaScript Object Notation).
Json::Value settings_
Configuration of this builder.
Abstract class for writers.
String valueToQuotedString(const char *value)
Writes a Value in JSON format in a human friendly way, to a stream rather than to a string...
we set max number of significant digits in string
Build a StreamWriter implementation.