10#ifndef __RTJsonResult_h__
11#define __RTJsonResult_h__ included
76 RTS_INLINE std::map<std::string, RTJsonResult>::const_iterator
keys_begin()
const;
79 RTS_INLINE std::map<std::string, RTJsonResult>::const_iterator
keys_end()
const;
91 RTS_INLINE
bool ok()
const;
143 std::vector <RTJsonResult> arrayValues;
144 std::map <std::string, RTJsonResult> keysValues;
146 RTS_INLINE
void put_string(
const std::string & val );
147 RTS_INLINE
void put_number(
const std::string & val );
148 RTS_INLINE
void put_bool(
bool );
149 RTS_INLINE
void put_object();
150 RTS_INLINE
void put_array();
151 RTS_INLINE
void put_null();
152 RTS_INLINE
void clear();
156#include <RTJsonResult.inl>
Utility for parsing JSON.
Definition: RTJsonParser.h:23
Definition: RTJsonParserUtils.h:47
Represents the result of parsing a JSON string.
Definition: RTJsonResult.h:29
RTJsonResult & operator=(const RTJsonResult &other)
Assignment operator.
bool operator==(const int) const
Determines if the JSON value is numeric and equal to the given int.
std::map< std::string, RTJsonResult >::const_iterator keys_begin() const
For a JSON object, return its keys begin iterator.
Definition: RTJsonResult.inl:21
RTJsonResult(const RTJsonResult &other)
Copy constructor.
double get_double() const
Interpret the JSON value as a double.
bool operator==(const char *) const
Determines if the JSON value is a string and equal to the given string.
const std::string & get_string() const
Get a string representation of the JSON value.
bool operator==(const RTJsonResult &) const
Determines if the JSON value is equal (but not necessarily the same) as another JSON value.
bool get_bool() const
Interpret the JSON value as a bool.
float get_float() const
Interpret the JSON value as a float.
RTJsonType get_type() const
Get the type of JSON value represented by the RTJsonResult.
bool ok() const
Returns false if this object represents an error result, true otherwise.
Definition: RTJsonResult.inl:31
std::map< std::string, RTJsonResult >::const_iterator keys_end() const
For a JSON object, return its keys end iterator.
Definition: RTJsonResult.inl:26
bool operator==(const double) const
Determines if the JSON value is numeric and equal to the given double.
RTJsonType
The type of JSON value represented by the RTJsonResult object.
Definition: RTJsonResult.h:35
@ RTJSON_NUM
JSON numeric value.
Definition: RTJsonResult.h:45
@ RTJSON_BOOL
JSON boolean value.
Definition: RTJsonResult.h:47
@ RTJSON_ARR
JSON array value.
Definition: RTJsonResult.h:41
@ RTJSON_STR
JSON string value.
Definition: RTJsonResult.h:43
@ RTJSON_NULL
The special null value.
Definition: RTJsonResult.h:37
@ RTJSON_OBJ
JSON object value.
Definition: RTJsonResult.h:39
int get_int() const
Interpret the JSON value as an int.
const RTJsonResult & operator[](size_t index) const
For a JSON array, return the value at the given index.
bool operator==(const bool) const
Determines if the JSON value is boolean and equal to the given bool.
bool operator==(const float) const
Determines if the JSON value is numeric and equal to the given float.
const RTJsonResult & operator[](const std::string &key) const
For a JSON object, return the value for the key with the given name.
static const RTJsonResult ERROR
This special object represents an error result.
Definition: RTJsonResult.h:88
size_t get_size() const
For a JSON array, return the number of array elements.
Definition: RTJsonResult.inl:36