forked from bblanchon/ArduinoJson
-
Notifications
You must be signed in to change notification settings - Fork 2
/
JsonParser.h
35 lines (31 loc) · 893 Bytes
/
JsonParser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* Arduino JSON library
* Benoit Blanchon 2014 - MIT License
*/
#pragma once
#include "JsonParserBase.h"
namespace ArduinoJson
{
namespace Parser
{
// The JSON parser.
//
// You need to specifiy the number of token to be allocated for that parser.
//
// CAUTION: JsonArray, JsonObject and JsonValue contain pointers to tokens of the
// JsonParser, so they need the JsonParser to be in memory to work.
// As a result, you must not create JsonArray, JsonObject or JsonValue that have a
// longer life that the JsonParser.
template <int MAX_TOKENS>
class JsonParser : public JsonParserBase
{
public:
JsonParser()
: JsonParserBase(_tokens, MAX_TOKENS)
{
}
private:
jsmntok_t _tokens[MAX_TOKENS];
};
}
}