Moved all JsonParser code in a sub-folder.

This commit is contained in:
Benoit Blanchon
2014-06-24 12:53:22 +02:00
committed by Benoît Blanchon
parent 80e0a51c15
commit 3d8b31b1ec
21 changed files with 147 additions and 105 deletions

42
JsonParser/JsonArray.h Normal file
View File

@ -0,0 +1,42 @@
/*
* malloc-free JSON parser for Arduino
* Benoit Blanchon 2014 - MIT License
*/
#ifndef __JSONARRAY_H
#define __JSONARRAY_H
#include "JsonObjectBase.h"
class JsonHashTable;
class JsonArray : public JsonObjectBase
{
template <int N>
friend class JsonParser;
friend class JsonHashTable;
public:
JsonArray() {}
int getLength()
{
return tokens != 0 ? tokens[0].size : 0;
}
JsonArray getArray(int index);
bool getBool(int index);
double getDouble(int index);
JsonHashTable getHashTable(int index);
long getLong(int index);
char* getString(int index);
private:
JsonArray(char* json, jsmntok_t* tokens);
jsmntok_t* getToken(int index);
};
#endif