Files
ArduinoJson/JsonParser/JsonValue.h

52 lines
958 B
C
Raw Normal View History

/*
* Arduino JSON library
* Benoit Blanchon 2014 - MIT License
*/
#pragma once
2014-07-18 15:43:20 +02:00
#include "JsonToken.h"
#ifndef ARDUINO_JSON_NO_DEPRECATED_WARNING
#ifdef __GNUC__
#define DEPRECATED __attribute__((deprecated))
#elif defined(_MSC_VER)
#define DEPRECATED __declspec(deprecated)
#endif
#else
#define DEPRECATED
#endif
namespace ArduinoJson
{
namespace Parser
{
class JsonValue : protected JsonToken
{
2014-07-18 15:43:20 +02:00
public:
JsonValue()
{
}
2014-07-19 12:44:27 +02:00
JsonValue(JsonToken token)
: JsonToken(token)
{
}
bool success()
{
2014-07-19 12:44:27 +02:00
return isValid();
2014-07-18 15:43:20 +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);
};
}
}