48 #ifndef INCLUDE_OLA_WEB_JSON_H_
49 #define INCLUDE_OLA_WEB_JSON_H_
79 virtual void ToString(std::ostream *output,
unsigned int indent)
const = 0;
87 void Indent(std::ostream *output,
unsigned int indent)
const {
88 *output << std::string(indent,
' ');
111 void ToString(std::ostream *output,
unsigned int)
const {
112 *output <<
'"' << EscapeString(EncodeString(m_value)) <<
'"';
116 const std::string m_value;
133 void ToString(std::ostream *output,
unsigned int)
const {
138 const unsigned int m_value;
155 void ToString(std::ostream *output,
unsigned int)
const {
177 void ToString(std::ostream *output,
unsigned int)
const {
178 *output << (m_value ?
"true" :
"false");
196 void ToString(std::ostream *output,
unsigned int)
const {
215 void ToString(std::ostream *output,
unsigned int)
const {
220 const std::string m_value;
246 void Add(
const std::string &key,
const std::string &value);
253 void Add(
const std::string &key,
const char *value);
260 void Add(
const std::string &key,
unsigned int i);
267 void Add(
const std::string &key,
int i);
274 void Add(
const std::string &key,
bool value);
280 void Add(
const std::string &key);
301 void AddRaw(
const std::string &key,
const std::string &value);
303 void ToString(std::ostream *output,
unsigned int indent)
const;
306 typedef std::map<std::string, JsonValue*> MemberMap;
376 m_values.push_back(obj);
377 m_complex_type =
true;
388 m_values.push_back(array);
389 m_complex_type =
true;
400 void ToString(std::ostream *output,
unsigned int indent)
const;
403 typedef std::vector<JsonValue*> ValuesVector;
404 ValuesVector m_values;
432 #endif // INCLUDE_OLA_WEB_JSON_H_