29#ifndef INCLUDE_OLA_WEB_JSONWRITER_H_
30#define INCLUDE_OLA_WEB_JSONWRITER_H_
49class JsonWriter :
public JsonValueConstVisitorInterface,
50 JsonObjectPropertyVisitor {
68 void Visit(
const JsonString &value);
69 void Visit(
const JsonBool &value);
70 void Visit(
const JsonNull &value);
71 void Visit(
const JsonRawValue &value);
74 void Visit(
const JsonUInt &value);
75 void Visit(
const JsonUInt64 &value);
76 void Visit(
const JsonInt &value);
77 void Visit(
const JsonInt64 &value);
78 void Visit(
const JsonDouble &value);
80 void VisitProperty(
const std::string &property,
const JsonValue &value);
87 std::ostream *m_output;
88 unsigned int m_indent;
89 std::string m_separator;
91 explicit JsonWriter(std::ostream *output)
100 static const unsigned int DEFAULT_INDENT = 2;
Basic data types used to represent elements in a JSON document.
An array of JSON values. Arrays in JSON can contain values of different types.
Definition Json.h:1043
A JSON object. JSON Objects are key : value mappings, similar to dictionaries in Python.
Definition Json.h:899
The base class for JSON values.
Definition Json.h:119
static std::string AsString(const JsonValue &value)
Get the string representation of the JsonValue.
Definition JsonWriter.cpp:38
static void Write(std::ostream *output, const JsonValue &value)
Write the string representation of the JsonValue to a ostream.
Definition JsonWriter.cpp:33
Classes to deal with web services.
Definition Json.cpp:29
The namespace containing all OLA symbols.
Definition Credentials.cpp:44