| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- /*
- * Arduino JSON library
- * Benoit Blanchon 2014 - MIT License
- */
- #pragma once
- #include "JsonObjectBase.h"
- #include "JsonValue.h"
- namespace ArduinoJson
- {
- namespace Parser
- {
- class JsonHashTable;
- class JsonArray : public JsonObjectBase
- {
- friend class JsonParserBase;
- friend class JsonValue;
- public:
- JsonArray() {}
- bool success()
- {
- return JsonObjectBase::success() && tokens->type == JSMN_ARRAY;
- }
- int size()
- {
- return success() ? tokens[0].size : 0;
- }
- JsonValue operator[](int index);
- DEPRECATED int getLength()
- {
- return size();
- }
-
- DEPRECATED JsonArray getArray(int index)
- {
- return (JsonArray) (*this)[index];
- }
- DEPRECATED bool getBool(int index)
- {
- return (bool) (*this)[index];
- }
- DEPRECATED double getDouble(int index)
- {
- return (double) (*this)[index];
- }
- DEPRECATED JsonHashTable getHashTable(int index);
- DEPRECATED long getLong(int index)
- {
- return (long) (*this)[index];
- }
- DEPRECATED char* getString(int index)
- {
- return (char*) (*this)[index];
- }
- private:
- JsonArray(char* json, jsmntok_t* tokens)
- : JsonObjectBase(json, tokens)
- {
- }
- };
- }
- }
|