20 #ifndef RIPPLE_JSON_JSON_WRITER_H_INCLUDED
21 #define RIPPLE_JSON_JSON_WRITER_H_INCLUDED
23 #include <ripple/json/json_forwards.h>
24 #include <ripple/json/json_value.h>
221 template <
class Write>
228 template <
class Write>
232 switch (value.
type())
260 int const size = value.
size();
261 for (
int index = 0; index < size; ++index)
274 for (
auto it = members.
begin(); it != members.
end(); ++it)
277 if (it != members.
begin())
298 template <
class Write>
338 o.
write(
static_cast<char const*
>(data), n);
347 #endif // JSON_WRITER_H_INCLUDED
Abstract class for writers.
void write_value(Write const &write, Value const &value)
void stream(Json::Value const &jv, Write const &write)
Stream compact JSON to the specified function.
@ arrayValue
array value (ordered list)
StyledStreamWriter(std::string indentation="\t")
Decorator for streaming out compact json.
bool isMultineArray(const Value &value)
void pushValue(std::string const &value)
Compact(Json::Value &&jv)
Wrap a Json::Value for compact streaming.
std::string valueToString(Int value)
void writeValue(const Value &value)
void pushValue(std::string const &value)
std::string write(const Value &root) override
Serialize a Value in JSON format.
std::string indentString_
void writeArrayValue(const Value &value)
std::ostream & operator<<(std::ostream &sout, const Value &root)
Output using the StyledStreamWriter.
void writeArrayValue(const Value &value)
@ uintValue
unsigned integer value
void write(std::ostream &out, const Value &root)
Serialize a Value in JSON format.
JSON (JavaScript Object Notation).
@ objectValue
object value (collection of name/value pairs).
friend std::ostream & operator<<(std::ostream &o, Compact const &cJv)
Writes a Value in JSON format in a human friendly way.
bool isMultineArray(const Value &value)
Writes a Value in JSON format in a human friendly way, to a stream rather than to a string.
UInt size() const
Number of values in array or object.
@ stringValue
UTF-8 string value.
const char * asCString() const
void write_string(Write const &write, std::string const &s)
std::string write(const Value &root) override
void writeWithIndent(std::string const &value)
Members getMemberNames() const
Return a list of the member names.
@ intValue
signed integer value
Outputs a Value in JSON format without formatting (not human friendly).
void writeValue(const Value &value)
std::string valueToQuotedString(const char *value)
virtual std::string write(const Value &root)=0
void writeValue(const Value &value)
void writeWithIndent(std::string const &value)
std::string indentString_