Open Lighting Architecture  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
ola::web::JsonArray Class Reference

Detailed Description

An array of JSON values. Arrays in JSON can contain values of different types.

Inheritance diagram for ola::web::JsonArray:
ola::web::JsonValue

Public Member Functions

void Append (const std::string &value)
 Append a string value to the array.
void Append (const char *value)
 Append a string value to the array.
void Append (unsigned int i)
 Append an unsigned int value to the array.
void Append (int i)
 Append an int value to the array.
void Append (bool value)
 Append a bool value to the array.
void Append ()
 Append a null value to the array.
JsonObjectAppendObject ()
 Append a JsonObject to the array.
JsonArrayAppendArray ()
 Append a JsonArray to the array.
void AppendRaw (const std::string &value)
 Append a raw value to the array.
void ToString (std::ostream *output, unsigned int indent) const
 Output the string representation of this value to an ostream.

Additional Inherited Members

- Protected Member Functions inherited from ola::web::JsonValue
void Indent (std::ostream *output, unsigned int indent) const
 Append the give number of spaces to the output stream.
- Static Protected Attributes inherited from ola::web::JsonValue
static const unsigned int DEFAULT_INDENT = 2
 the default indent level

Member Function Documentation

void ola::web::JsonArray::Append ( const std::string &  value)
inline

Append a string value to the array.

Parameters
valuethe value to append
void ola::web::JsonArray::Append ( const char *  value)
inline

Append a string value to the array.

Parameters
valuethe value to append
void ola::web::JsonArray::Append ( unsigned int  i)
inline

Append an unsigned int value to the array.

Parameters
ithe value to append
void ola::web::JsonArray::Append ( int  i)
inline

Append an int value to the array.

Parameters
ithe value to append
void ola::web::JsonArray::Append ( bool  value)
inline

Append a bool value to the array.

Parameters
valuethe value to append
JsonArray* ola::web::JsonArray::AppendArray ( )
inline

Append a JsonArray to the array.

Returns
the new JsonArray. Ownership is not transferred and the pointer is valid for the lifetime of this JsonArray.
JsonObject* ola::web::JsonArray::AppendObject ( )
inline

Append a JsonObject to the array.

Returns
the new JsonObject. Ownership is not transferred and the pointer is valid for the lifetime of this JsonArray.
void ola::web::JsonArray::ToString ( std::ostream *  output,
unsigned int  indent 
) const
virtual

Output the string representation of this value to an ostream.

Parameters
outputthe ostream to output to.
indentthe number of spaces to prepend.

Implements ola::web::JsonValue.


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