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)
125 bool validate(
Json::
Value* invalid) const;
135 static
void setDefaults(
Json::
Value* settings);
163 void enableYAMLCompatibility();
170 void dropNullPlaceholders();
172 void omitEndingLineFeed();
178 void writeValue(
const Value& value);
181 bool yamlCompatiblityEnabled_;
182 bool dropNullPlaceholders_;
183 bool omitEndingLineFeed_;
223 void writeValue(
const Value& value);
224 void writeArrayValue(
const Value& value);
225 bool isMultineArray(
const Value& value);
231 void writeCommentBeforeValue(
const Value& root);
232 void writeCommentAfterValueOnSameLine(
const Value& root);
233 bool hasCommentForValue(
const Value& value);
236 typedef std::vector<JSONCPP_STRING> ChildValues;
238 ChildValues childValues_;
241 unsigned int rightMargin_;
242 unsigned int indentSize_;
243 bool addChildValues_;
287 void writeValue(
const Value& value);
288 void writeArrayValue(
const Value& value);
289 bool isMultineArray(
const Value& value);
295 void writeCommentBeforeValue(
const Value& root);
296 void writeCommentAfterValueOnSameLine(
const Value& root);
297 bool hasCommentForValue(
const Value& value);
300 typedef std::vector<JSONCPP_STRING> ChildValues;
302 ChildValues childValues_;
305 unsigned int rightMargin_;
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
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 amalgated to prevent private header inclusion...
std::string valueToQuotedString(const char *value)
std::string valueToString(Int value)
JSON (JavaScript Object Notation).
Json::Value settings_
Configuration of this builder.
Abstract class for writers.
static std::string normalizeEOL(Reader::Location begin, Reader::Location end)
Writes a Value in JSON format in a human friendly way, to a stream rather than to a string...
std::string writeString(StreamWriter::Factory const &factory, Value const &root)
Write into stringstream, then return string, for convenience.
std::ostream & operator<<(std::ostream &, const Value &root)
Output using the StyledStreamWriter.
Build a StreamWriter implementation.