2014-07-16 13:26:11 +02:00
|
|
|
/*
|
|
|
|
* Arduino JSON library
|
|
|
|
* Benoit Blanchon 2014 - MIT License
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2014-07-18 15:43:20 +02:00
|
|
|
#include "JsonToken.h"
|
2014-07-17 13:27:40 +02:00
|
|
|
|
|
|
|
#ifndef ARDUINO_JSON_NO_DEPRECATED_WARNING
|
2014-07-17 13:12:12 +02:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#define DEPRECATED __attribute__((deprecated))
|
|
|
|
#elif defined(_MSC_VER)
|
|
|
|
#define DEPRECATED __declspec(deprecated)
|
2014-07-17 13:27:40 +02:00
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#define DEPRECATED
|
2014-07-17 13:12:12 +02:00
|
|
|
#endif
|
2014-07-16 13:41:00 +02:00
|
|
|
|
2014-07-16 13:26:11 +02:00
|
|
|
namespace ArduinoJson
|
|
|
|
{
|
|
|
|
namespace Parser
|
|
|
|
{
|
2014-07-19 14:41:29 +02:00
|
|
|
class JsonValue : protected JsonToken
|
2014-07-16 13:26:11 +02:00
|
|
|
{
|
2014-07-18 15:43:20 +02:00
|
|
|
public:
|
2014-07-17 13:12:12 +02:00
|
|
|
|
2014-07-19 14:41:29 +02:00
|
|
|
JsonValue()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-07-19 12:44:27 +02:00
|
|
|
JsonValue(JsonToken token)
|
|
|
|
: JsonToken(token)
|
|
|
|
{
|
|
|
|
|
2014-07-17 13:12:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool success()
|
|
|
|
{
|
2014-07-19 12:44:27 +02:00
|
|
|
return isValid();
|
2014-07-18 15:43:20 +02:00
|
|
|
}
|
|
|
|
|
2014-07-16 13:26:11 +02:00
|
|
|
operator bool();
|
|
|
|
operator double();
|
|
|
|
operator long();
|
|
|
|
operator char*();
|
2014-07-18 15:43:20 +02:00
|
|
|
JsonValue operator[](int index);
|
|
|
|
JsonValue operator[](const char*key);
|
2014-07-16 13:26:11 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|