ESPectro32 Library
Library for using ESPectro32 board
 All Classes Functions Variables Enumerations Enumerator Pages
Public Member Functions | Public Attributes | List of all members
JsonObject Class Reference

A JSON object. More...

#include <JSON.h>

Public Member Functions

 JsonObject (cJSON *node)
 
int getInt (std::string name)
 Get the named int value from the object. More...
 
JsonObject getObject (std::string name)
 Get the named object value from the object. More...
 
std::string getString (std::string name)
 Get the named string value from the object. More...
 
bool getBoolean (std::string name)
 Get the named boolean value from the object. More...
 
double getDouble (std::string name)
 Get the named double value from the object. More...
 
void setArray (std::string name, JsonArray array)
 Set the named array property. More...
 
void setBoolean (std::string name, bool value)
 Set the named boolean property. More...
 
void setDouble (std::string name, double value)
 Set the named double property. More...
 
void setInt (std::string name, int value)
 Set the named int property. More...
 
void setObject (std::string name, JsonObject value)
 Set the named object property. More...
 
void setString (std::string name, std::string value)
 Set the named string property. More...
 
std::string toString ()
 Convert the JSON object to a string. More...
 

Public Attributes

cJSON * m_node
 The underlying cJSON node.
 

Detailed Description

A JSON object.

Member Function Documentation

bool JsonObject::getBoolean ( std::string  name)

Get the named boolean value from the object.

Parameters
[in]nameThe name of the object property.
Returns
The boolean value from the object.
double JsonObject::getDouble ( std::string  name)

Get the named double value from the object.

Parameters
[in]nameThe name of the object property.
Returns
The double value from the object.
int JsonObject::getInt ( std::string  name)

Get the named int value from the object.

Parameters
[in]nameThe name of the object property.
Returns
The int value from the object.
JsonObject JsonObject::getObject ( std::string  name)

Get the named object value from the object.

Parameters
[in]nameThe name of the object property.
Returns
The object value from the object.
std::string JsonObject::getString ( std::string  name)

Get the named string value from the object.

Parameters
[in]nameThe name of the object property.
Returns
The string value from the object.
void JsonObject::setArray ( std::string  name,
JsonArray  array 
)

Set the named array property.

Parameters
[in]nameThe name of the property to add.
[in]arrayThe array to add to the object.
Returns
N/A.
void JsonObject::setBoolean ( std::string  name,
bool  value 
)

Set the named boolean property.

Parameters
[in]nameThe name of the property to add.
[in]valueThe boolean to add to the object.
Returns
N/A.
void JsonObject::setDouble ( std::string  name,
double  value 
)

Set the named double property.

Parameters
[in]nameThe name of the property to add.
[in]valueThe double to add to the object.
Returns
N/A.
void JsonObject::setInt ( std::string  name,
int  value 
)

Set the named int property.

Parameters
[in]nameThe name of the property to add.
[in]valueThe int to add to the object.
Returns
N/A.
void JsonObject::setObject ( std::string  name,
JsonObject  value 
)

Set the named object property.

Parameters
[in]nameThe name of the property to add.
[in]valueThe object to add to the object.
Returns
N/A.
void JsonObject::setString ( std::string  name,
std::string  value 
)

Set the named string property.

Parameters
[in]nameThe name of the property to add.
[in]valueThe string to add to the object.
Returns
N/A.
std::string JsonObject::toString ( )

Convert the JSON object to a string.

Returns
A JSON string representation of the object.

The documentation for this class was generated from the following files: