8 #ifndef COMPONENTS_CPP_UTILS_JSON_H_
9 #define COMPONENTS_CPP_UTILS_JSON_H_
62 int getInt(std::string name);
69 void setDouble(std::string name,
double value);
70 void setInt(std::string name,
int value);
72 void setString(std::string name, std::string value);
void setDouble(std::string name, double value)
Set the named double property.
Definition: JSON.cpp:289
double getDouble(std::string name)
Get the named double value from the object.
Definition: JSON.cpp:222
A JSON object.
Definition: JSON.h:59
std::string getString(std::string name)
Get the named string value from the object.
Definition: JSON.cpp:255
void setString(std::string name, std::string value)
Set the named string property.
Definition: JSON.cpp:322
double getDouble(int item)
Get the indexed double value from the array.
Definition: JSON.cpp:139
Top level JSON handler.
Definition: JSON.h:20
void setInt(std::string name, int value)
Set the named int property.
Definition: JSON.cpp:300
int getInt(std::string name)
Get the named int value from the object.
Definition: JSON.cpp:233
static void deleteArray(JsonArray jsonArray)
Delete a JSON array.
Definition: JSON.cpp:36
void addObject(JsonObject value)
Add an object value to the array.
Definition: JSON.cpp:106
bool getBoolean(int item)
Get the indexed boolean value from the array.
Definition: JSON.cpp:125
static JsonArray parseArray(std::string text)
Parse a string that contains a JSON array.
Definition: JSON.cpp:55
void setArray(std::string name, JsonArray array)
Set the named array property.
Definition: JSON.cpp:267
JsonObject getObject(std::string name)
Get the named object value from the object.
Definition: JSON.cpp:244
cJSON * m_node
The underlying cJSON node.
Definition: JSON.h:52
static JsonObject parseObject(std::string text)
Parse a string that contains a JSON object.
Definition: JSON.cpp:65
void addDouble(double value)
Add a double value to the array.
Definition: JSON.cpp:88
std::string toString()
Convert the JSON object to a string.
Definition: JSON.cpp:331
int getInt(int item)
Get the indexed int value from the array.
Definition: JSON.cpp:150
std::size_t size()
Get the number of elements from the array.
Definition: JSON.cpp:194
JsonObject getObject(int item)
Get the indexed object value from the array.
Definition: JSON.cpp:161
void addString(std::string value)
Add a string value to the array.
Definition: JSON.cpp:115
static void deleteObject(JsonObject jsonObject)
Delete a JSON object.
Definition: JSON.cpp:45
static JsonObject createObject()
Create an empty JSON object.
Definition: JSON.cpp:26
void addInt(int value)
Add an int value to the array.
Definition: JSON.cpp:97
void addBoolean(bool value)
Add a boolean value to the array.
Definition: JSON.cpp:79
void setObject(std::string name, JsonObject value)
Set the named object property.
Definition: JSON.cpp:311
void setBoolean(std::string name, bool value)
Set the named boolean property.
Definition: JSON.cpp:278
std::string getString(int item)
Get the indexed object value from the array.
Definition: JSON.cpp:172
bool getBoolean(std::string name)
Get the named boolean value from the object.
Definition: JSON.cpp:208
cJSON * m_node
The underlying cJSON node.
Definition: JSON.h:77
std::string toString()
Convert the JSON array to a string.
Definition: JSON.cpp:182
A JSON array.
Definition: JSON.h:34
static JsonArray createArray()
Create an empty JSON array.
Definition: JSON.cpp:17