diff --git a/JsonParser.cpp b/JsonParser.cpp index 1df6f53a..ce4cb5ac 100644 --- a/JsonParser.cpp +++ b/JsonParser.cpp @@ -9,4 +9,5 @@ #include "JsonParser/JsonHashTable.cpp" #include "JsonParser/JsonObjectBase.cpp" #include "JsonParser/JsonParserBase.cpp" +#include "JsonParser/JsonValue.cpp" #include "JsonParser/jsmn.cpp" \ No newline at end of file diff --git a/JsonParser/JsonArray.cpp b/JsonParser/JsonArray.cpp index c4d99ef4..fa5859d7 100644 --- a/JsonParser/JsonArray.cpp +++ b/JsonParser/JsonArray.cpp @@ -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]; } diff --git a/JsonParser/JsonArray.h b/JsonParser/JsonArray.h index 6712ea5f..e3c7cb15 100644 --- a/JsonParser/JsonArray.h +++ b/JsonParser/JsonArray.h @@ -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]; } diff --git a/JsonParser/JsonHashTable.cpp b/JsonParser/JsonHashTable.cpp index 748cc9a6..eff4a1a9 100644 --- a/JsonParser/JsonHashTable.cpp +++ b/JsonParser/JsonHashTable.cpp @@ -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]; } \ No newline at end of file diff --git a/JsonParser/JsonHashTable.h b/JsonParser/JsonHashTable.h index 6873b0c4..e5351573 100644 --- a/JsonParser/JsonHashTable.h +++ b/JsonParser/JsonHashTable.h @@ -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]; } diff --git a/JsonParser/JsonObjectBase.h b/JsonParser/JsonObjectBase.h index 9599b430..d5362c87 100644 --- a/JsonParser/JsonObjectBase.h +++ b/JsonParser/JsonObjectBase.h @@ -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 diff --git a/JsonParser/JsonValue.h b/JsonParser/JsonValue.h index d5606ddc..3f5ac546 100644 --- a/JsonParser/JsonValue.h +++ b/JsonParser/JsonValue.h @@ -18,11 +18,7 @@ namespace ArduinoJson class JsonValue : public JsonObjectBase { - friend JsonArray; - friend JsonHashTable; - public: - JsonValue() {} JsonValue(char* json, jsmntok_t* tokens)