My Project
 All Classes Functions Variables Pages
Public Member Functions | Friends | List of all members
JsonArray Class Reference

A JSON array. More...

#include <JSON.h>

Public Member Functions

int getInt (int item)
 Get the indexed int value from the array. More...
 
JsonObject getObject (int item)
 Get the indexed object value from the array. More...
 
std::string getString (int item)
 Get the indexed object value from the array. More...
 
bool getBoolean (int item)
 Get the indexed boolean value from the array. More...
 
double getDouble (int item)
 Get the indexed double value from the array. More...
 
void addBoolean (bool value)
 Add a boolean value to the array. More...
 
void addDouble (double value)
 Add a double value to the array. More...
 
void addInt (int value)
 Add an int value to the array. More...
 
void addObject (JsonObject value)
 Add an object value to the array. More...
 
void addString (std::string value)
 Add a string value to the array. More...
 
std::string toString ()
 Convert the JSON array to a string. More...
 
std::string toStringUnformatted ()
 Build an unformatted string representation. More...
 
std::size_t size ()
 Get the number of elements from the array. More...
 

Friends

class JSON
 
class JsonObject
 

Detailed Description

A JSON array.

Member Function Documentation

void JsonArray::addBoolean ( bool  value)

Add a boolean value to the array.

Parameters
[in]valueThe boolean value to add to the array.
void JsonArray::addDouble ( double  value)

Add a double value to the array.

Parameters
[in]valueThe double value to add to the array.
void JsonArray::addInt ( int  value)

Add an int value to the array.

Parameters
[in]valueThe int value to add to the array.
void JsonArray::addObject ( JsonObject  value)

Add an object value to the array.

Parameters
[in]valueThe object value to add to the array.
void JsonArray::addString ( std::string  value)

Add a string value to the array.

Parameters
[in]valueThe string value to add to the array.
bool JsonArray::getBoolean ( int  item)

Get the indexed boolean value from the array.

Parameters
[in]itemThe index of the array to retrieve.
Returns
The boolean value at the given index.
double JsonArray::getDouble ( int  item)

Get the indexed double value from the array.

Parameters
[in]itemThe index of the array to retrieve.
Returns
The double value at the given index.
int JsonArray::getInt ( int  item)

Get the indexed int value from the array.

Parameters
[in]itemThe index of the array to retrieve.
Returns
The int value at the given index.
JsonObject JsonArray::getObject ( int  item)

Get the indexed object value from the array.

Parameters
[in]itemThe index of the array to retrieve.
Returns
The object value at the given index.
std::string JsonArray::getString ( int  item)

Get the indexed object value from the array.

Parameters
[in]itemThe index of the array to retrieve.
Returns
The object value at the given index.
std::size_t JsonArray::size ( )

Get the number of elements from the array.

Returns
The int value that represents the number of elements.
std::string JsonArray::toString ( )

Convert the JSON array to a string.

Returns
A JSON string representation of the array.
std::string JsonArray::toStringUnformatted ( )

Build an unformatted string representation.

Returns
A string representation.

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