Open Lighting Architecture
0.9.2
|
An array of JSON values. Arrays in JSON can contain values of different types.
Public Member Functions | |
JsonValue * | LookupElementWithIter (JsonPointer::Iterator *iter) |
Lookup the Value referred to by the Iterator. | |
bool | operator== (const JsonValue &other) const |
Equality operator. | |
bool | Equals (const JsonArray &other) const |
Check if this JsonValue equals a JsonArray. | |
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. | |
void | Append (JsonValue *value) |
Append a JsonValue. Takes ownership of the pointer. | |
void | Append (JsonObject *value) |
Append a JsonValue. Takes ownership of the pointer. | |
JsonObject * | AppendObject () |
Append a JsonObject to the array. | |
JsonArray * | AppendArray () |
Append a JsonArray to the array. | |
void | AppendValue (JsonValue *value) |
Append a JsonValue to the array. | |
void | AppendRaw (const std::string &value) |
Append a raw value to the array. | |
bool | RemoveElementAt (uint32_t index) |
Remove the JsonValue at the specified index. | |
bool | ReplaceElementAt (uint32_t index, JsonValue *value) |
Replace the JsonValue at the specified index. | |
bool | InsertElementAt (uint32_t index, JsonValue *value) |
Inserts the JsonValue at the specified index. | |
void | Accept (JsonValueVisitorInterface *visitor) |
The Accept method for the visitor pattern. | |
void | Accept (JsonValueConstVisitorInterface *visitor) const |
The Accept (const) method for the visitor pattern. | |
JsonValue * | Clone () const |
Make a copy of this JsonValue. | |
bool | IsEmpty () const |
Check if there are elements within the array. | |
unsigned int | Size () const |
Return the number of elements in the array. | |
const JsonValue * | ElementAt (unsigned int i) const |
Return the element at index i. | |
bool | IsComplexType () const |
Return true if this array contains nested arrays or objects. | |
Public Member Functions inherited from ola::web::JsonValue | |
virtual JsonValue * | LookupElement (const JsonPointer &pointer) |
Locate the JsonValue referred to by the JSON Pointer. | |
virtual bool | operator!= (const JsonValue &other) const |
Not-equals operator. |
|
inlinevirtual |
The Accept method for the visitor pattern.
This can be used to traverse the Json Tree in a type-safe manner.
Implements ola::web::JsonValue.
|
inlinevirtual |
The Accept (const) method for the visitor pattern.
This can be used to traverse the Json Tree in a type-safe manner.
Implements ola::web::JsonValue.
|
inline |
Append a string value to the array.
value | the value to append |
|
inline |
Append a string value to the array.
value | the value to append |
|
inline |
Append an unsigned int value to the array.
i | the value to append |
|
inline |
Append an int value to the array.
i | the value to append |
|
inline |
Append a bool value to the array.
value | the value to append |
|
inline |
|
inline |
Append a JsonObject to the array.
|
inline |
const JsonValue * ola::web::JsonArray::ElementAt | ( | unsigned int | i | ) | const |
Return the element at index i.
|
virtual |
Check if this JsonValue equals a JsonArray.
Reimplemented from ola::web::JsonValue.
bool ola::web::JsonArray::InsertElementAt | ( | uint32_t | index, |
JsonValue * | value | ||
) |
|
inline |
Check if there are elements within the array.
|
virtual |
Lookup the Value referred to by the Iterator.
This is used by recursively by JsonValue classes. You should call LookupElement() instead.
Implements ola::web::JsonValue.
|
inlinevirtual |
Equality operator.
This implements equality as defined in section 3.6 of the JSON Schema Core document.
Implements ola::web::JsonValue.
bool ola::web::JsonArray::RemoveElementAt | ( | uint32_t | index | ) |
Remove the JsonValue at the specified index.
index | the index of the value to remove |
bool ola::web::JsonArray::ReplaceElementAt | ( | uint32_t | index, |
JsonValue * | value | ||
) |