forked from bblanchon/ArduinoJson
Added comments
This commit is contained in:
@ -14,71 +14,86 @@ namespace ArduinoJson
|
|||||||
{
|
{
|
||||||
class JsonObject;
|
class JsonObject;
|
||||||
|
|
||||||
|
// A JSON array.
|
||||||
class JsonArray : JsonValue
|
class JsonArray : JsonValue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Create an invalid array.
|
||||||
JsonArray()
|
JsonArray()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Convert a JsonValue into a JsonArray.
|
||||||
JsonArray(JsonValue value)
|
JsonArray(JsonValue value)
|
||||||
: JsonValue(value)
|
: JsonValue(value)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Tell if the array is valid.
|
||||||
bool success()
|
bool success()
|
||||||
{
|
{
|
||||||
return isArray();
|
return isArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the JsonValue at specified index.
|
||||||
JsonValue operator[](int index)
|
JsonValue operator[](int index)
|
||||||
{
|
{
|
||||||
return JsonValue::operator[](index);
|
return JsonValue::operator[](index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the size of the array.
|
||||||
int size()
|
int size()
|
||||||
{
|
{
|
||||||
return isArray() ? childrenCount() : 0;
|
return isArray() ? childrenCount() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get an iterator pointing to the beginning of the array.
|
||||||
JsonArrayIterator begin()
|
JsonArrayIterator begin()
|
||||||
{
|
{
|
||||||
return isArray() ? firstChild() : null();
|
return isArray() ? firstChild() : null();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Gets an iterator pointing to the end of the array.
|
||||||
JsonArrayIterator end()
|
JsonArrayIterator end()
|
||||||
{
|
{
|
||||||
return isArray() ? nextSibling() : null();
|
return isArray() ? nextSibling() : null();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Obsolete. Use size() instead.
|
||||||
DEPRECATED int getLength()
|
DEPRECATED int getLength()
|
||||||
{
|
{
|
||||||
return size();
|
return size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Obsolete. Use operator[] instead.
|
||||||
DEPRECATED JsonArray getArray(int index)
|
DEPRECATED JsonArray getArray(int index)
|
||||||
{
|
{
|
||||||
return operator[](index);
|
return operator[](index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Obsolete. Use operator[] instead.
|
||||||
DEPRECATED bool getBool(int index)
|
DEPRECATED bool getBool(int index)
|
||||||
{
|
{
|
||||||
return operator[](index);
|
return operator[](index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Obsolete. Use operator[] instead.
|
||||||
DEPRECATED double getDouble(int index)
|
DEPRECATED double getDouble(int index)
|
||||||
{
|
{
|
||||||
return operator[](index);
|
return operator[](index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Obsolete. Use operator[] instead.
|
||||||
DEPRECATED JsonObject getHashTable(int index);
|
DEPRECATED JsonObject getHashTable(int index);
|
||||||
|
|
||||||
|
// Obsolete. Use operator[] instead.
|
||||||
DEPRECATED long getLong(int index)
|
DEPRECATED long getLong(int index)
|
||||||
{
|
{
|
||||||
return operator[](index);
|
return operator[](index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Obsolete. Use operator[] instead.
|
||||||
DEPRECATED char* getString(int index)
|
DEPRECATED char* getString(int index)
|
||||||
{
|
{
|
||||||
return operator[](index);
|
return operator[](index);
|
||||||
|
Reference in New Issue
Block a user