Defined the DEPRECATED macro

This commit is contained in:
Benoît Blanchon
2014-07-16 13:53:56 +02:00
parent 6a868e46bd
commit 7487b8cbb7
7 changed files with 23 additions and 22 deletions

View File

@ -9,4 +9,5 @@
#include "JsonParser/JsonHashTable.cpp"
#include "JsonParser/JsonObjectBase.cpp"
#include "JsonParser/JsonParserBase.cpp"
#include "JsonParser/JsonValue.cpp"
#include "JsonParser/jsmn.cpp"

View File

@ -31,7 +31,7 @@ JsonValue JsonArray::operator[](int index)
}
JsonHashTable JsonArray::getHashTable(int index) DEPRECATED
DEPRECATED JsonHashTable JsonArray::getHashTable(int index)
{
return (JsonHashTable) (*this)[index];
}

View File

@ -8,8 +8,6 @@
#include "JsonObjectBase.h"
#include "JsonValue.h"
#define DEPRECATED
namespace ArduinoJson
{
namespace Parser
@ -37,29 +35,29 @@ namespace ArduinoJson
JsonValue operator[](int index);
JsonArray getArray(int index) DEPRECATED
DEPRECATED JsonArray getArray(int index)
{
return (JsonArray) (*this)[index];
}
bool getBool(int index) DEPRECATED
DEPRECATED bool getBool(int index)
{
return (bool) (*this)[index];
}
double getDouble(int index) DEPRECATED
DEPRECATED double getDouble(int index)
{
return (double) (*this)[index];
}
JsonHashTable getHashTable(int index) DEPRECATED;
DEPRECATED JsonHashTable getHashTable(int index);
long getLong(int index) DEPRECATED
DEPRECATED long getLong(int index)
{
return (long) (*this)[index];
}
char* getString(int index) DEPRECATED
DEPRECATED char* getString(int index)
{
return (char*) (*this)[index];
}

View File

@ -43,7 +43,7 @@ JsonValue JsonHashTable::operator [](const char* desiredKey)
return JsonValue();
}
JsonArray JsonHashTable::getArray(const char* key) DEPRECATED
DEPRECATED JsonArray JsonHashTable::getArray(const char* key)
{
return (JsonArray) (*this)[key];
}

View File

@ -8,8 +8,6 @@
#include "JsonObjectBase.h"
#include "JsonValue.h"
#define DEPRECATED
namespace ArduinoJson
{
namespace Parser
@ -37,29 +35,29 @@ namespace ArduinoJson
return (*this)[key].success();
}
JsonArray getArray(const char* key) DEPRECATED;
DEPRECATED JsonArray getArray(const char* key);
bool getBool(const char* key) DEPRECATED
DEPRECATED bool getBool(const char* key)
{
return (bool) (*this)[key];
}
double getDouble(const char* key) DEPRECATED
DEPRECATED double getDouble(const char* key)
{
return (double) (*this)[key];
}
JsonHashTable getHashTable(const char* key) DEPRECATED
DEPRECATED JsonHashTable getHashTable(const char* key)
{
return (JsonHashTable) (*this)[key];
}
long getLong(const char* key) DEPRECATED
DEPRECATED long getLong(const char* key)
{
return (long) (*this)[key];
}
char* getString(const char* key) DEPRECATED
DEPRECATED char* getString(const char* key)
{
return (char*) (*this)[key];
}

View File

@ -7,6 +7,14 @@
#include "jsmn.h"
#ifdef __GNUC__
#define DEPRECATED __attribute__((deprecated))
#elif defined(_MSC_VER)
#define DEPRECATED __declspec(deprecated)
#else
#define DEPRECATED
#endif
namespace ArduinoJson
{
namespace Parser

View File

@ -18,11 +18,7 @@ namespace ArduinoJson
class JsonValue : public JsonObjectBase
{
friend JsonArray;
friend JsonHashTable;
public:
JsonValue() {}
JsonValue(char* json, jsmntok_t* tokens)