Files
ArduinoJson/JsonParser/JsonArray.h

67 lines
1.4 KiB
C
Raw Normal View History

2014-07-03 13:58:08 +02:00
/*
* Arduino JSON library
* Benoit Blanchon 2014 - MIT License
*/
2014-01-11 15:05:35 +01:00
2014-07-03 13:58:08 +02:00
#pragma once
2014-01-11 15:05:35 +01:00
#include "JsonObjectBase.h"
#include "JsonValue.h"
#define DEPRECATED
2014-01-11 15:05:35 +01:00
2014-07-03 14:00:51 +02:00
namespace ArduinoJson
2014-01-11 15:05:35 +01:00
{
2014-07-03 14:00:51 +02:00
namespace Parser
{
class JsonHashTable;
class JsonArray : public JsonObjectBase
{
2014-07-14 13:17:30 +02:00
friend class JsonParserBase;
friend class JsonValue;
2014-01-11 15:05:35 +01:00
2014-07-03 14:00:51 +02:00
public:
2014-01-11 15:05:35 +01:00
2014-07-03 14:00:51 +02:00
JsonArray() {}
2014-01-11 15:05:35 +01:00
2014-07-03 14:00:51 +02:00
int getLength()
{
return tokens != 0 ? tokens[0].size : 0;
}
2014-01-11 15:05:35 +01:00
JsonValue operator[](int index);
JsonArray getArray(int index) DEPRECATED
{
return (JsonArray) (*this)[index];
}
bool getBool(int index) DEPRECATED
{
return (bool) (*this)[index];
}
double getDouble(int index) DEPRECATED
{
return (double) (*this)[index];
}
JsonHashTable getHashTable(int index) DEPRECATED;
long getLong(int index) DEPRECATED
{
return (long) (*this)[index];
}
char* getString(int index) DEPRECATED
{
return (char*) (*this)[index];
}
2014-07-03 14:00:51 +02:00
private:
2014-01-11 15:05:35 +01:00
2014-07-03 14:00:51 +02:00
JsonArray(char* json, jsmntok_t* tokens);
};
}
}