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) 164 #if defined(_MSC_VER) 165 #pragma warning(push) 166 #pragma warning(disable : 4996) // Deriving from deprecated class 172 ~FastWriter()
override =
default;
174 void enableYAMLCompatibility();
181 void dropNullPlaceholders();
183 void omitEndingLineFeed();
186 String write(
const Value& root)
override;
189 void writeValue(
const Value& value);
192 bool yamlCompatibilityEnabled_{
false};
193 bool dropNullPlaceholders_{
false};
194 bool omitEndingLineFeed_{
false};
196 #if defined(_MSC_VER) 224 #if defined(_MSC_VER) 225 #pragma warning(push) 226 #pragma warning(disable : 4996) // Deriving from deprecated class 229 StyledWriter :
public Writer {
232 ~StyledWriter()
override =
default;
239 String write(
const Value& root)
override;
242 void writeValue(
const Value& value);
243 void writeArrayValue(
const Value& value);
244 bool isMultilineArray(
const Value& value);
245 void pushValue(
const String& value);
247 void writeWithIndent(
const String& value);
250 void writeCommentBeforeValue(
const Value& root);
251 void writeCommentAfterValueOnSameLine(
const Value& root);
252 static bool hasCommentForValue(
const Value& value);
255 typedef std::vector<String> ChildValues;
257 ChildValues childValues_;
260 unsigned int rightMargin_{74};
261 unsigned int indentSize_{3};
262 bool addChildValues_{
false};
264 #if defined(_MSC_VER) 293 #if defined(_MSC_VER) 294 #pragma warning(push) 295 #pragma warning(disable : 4996) // Deriving from deprecated class 303 StyledStreamWriter(
String indentation =
"\t");
304 ~StyledStreamWriter() =
default;
316 void writeValue(
const Value& value);
317 void writeArrayValue(
const Value& value);
318 bool isMultilineArray(
const Value& value);
319 void pushValue(
const String& value);
321 void writeWithIndent(
const String& value);
324 void writeCommentBeforeValue(
const Value& root);
325 void writeCommentAfterValueOnSameLine(
const Value& root);
326 static bool hasCommentForValue(
const Value& value);
329 typedef std::vector<String> ChildValues;
331 ChildValues childValues_;
334 unsigned int rightMargin_{74};
336 bool addChildValues_ : 1;
339 #if defined(_MSC_VER) 343 #if defined(JSON_HAS_INT64) 346 #endif // if defined(JSON_HAS_INT64) 364 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 366 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 368 #endif // JSON_WRITER_H_INCLUDED #define JSONCPP_DEPRECATED(message)
A simple abstract factory.
#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)
String writeString(StreamWriter::Factory const &factory, Value const &root)
Write into stringstream, then return string, for convenience.
JSON (JavaScript Object Notation).
Json::Value settings_
Configuration of this builder.
static const UInt defaultRealPrecision
Default precision for real value for string representation.
String valueToQuotedString(const char *value)
we set max number of significant digits in string
Build a StreamWriter implementation.
std::basic_string< char, std::char_traits< char >, Allocator< char > > String
OStream & operator<<(OStream &, const Value &root)
Output using the StyledStreamWriter.