mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-17 20:42:24 +02:00
48 lines
875 B
C++
48 lines
875 B
C++
/*
|
|
* Arduino JSON library
|
|
* Benoit Blanchon 2014 - MIT License
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "jsmn.h"
|
|
|
|
namespace ArduinoJson
|
|
{
|
|
namespace Parser
|
|
{
|
|
class JsonObjectBase
|
|
{
|
|
public:
|
|
|
|
JsonObjectBase()
|
|
{
|
|
makeInvalid();
|
|
}
|
|
|
|
bool success()
|
|
{
|
|
return json != 0 && tokens != 0;
|
|
}
|
|
|
|
protected:
|
|
|
|
JsonObjectBase(char* json, jsmntok_t* tokens)
|
|
{
|
|
this->json = json;
|
|
this->tokens = tokens;
|
|
}
|
|
|
|
void makeInvalid()
|
|
{
|
|
json = 0;
|
|
tokens = 0;
|
|
}
|
|
|
|
static int getNestedTokenCount(jsmntok_t* token);
|
|
|
|
char* json;
|
|
jsmntok_t* tokens;
|
|
};
|
|
}
|
|
} |