mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Defined the DEPRECATED macro
This commit is contained in:
		| @@ -9,4 +9,5 @@ | |||||||
| #include "JsonParser/JsonHashTable.cpp" | #include "JsonParser/JsonHashTable.cpp" | ||||||
| #include "JsonParser/JsonObjectBase.cpp" | #include "JsonParser/JsonObjectBase.cpp" | ||||||
| #include "JsonParser/JsonParserBase.cpp" | #include "JsonParser/JsonParserBase.cpp" | ||||||
|  | #include "JsonParser/JsonValue.cpp" | ||||||
| #include "JsonParser/jsmn.cpp" | #include "JsonParser/jsmn.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]; |     return (JsonHashTable) (*this)[index]; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -8,8 +8,6 @@ | |||||||
| #include "JsonObjectBase.h" | #include "JsonObjectBase.h" | ||||||
| #include "JsonValue.h" | #include "JsonValue.h" | ||||||
|  |  | ||||||
| #define DEPRECATED |  | ||||||
|  |  | ||||||
| namespace ArduinoJson | namespace ArduinoJson | ||||||
| { | { | ||||||
|     namespace Parser |     namespace Parser | ||||||
| @@ -37,29 +35,29 @@ namespace ArduinoJson | |||||||
|  |  | ||||||
|             JsonValue operator[](int index); |             JsonValue operator[](int index); | ||||||
|                        |                        | ||||||
|             JsonArray getArray(int index) DEPRECATED |             DEPRECATED JsonArray getArray(int index) | ||||||
|             { |             { | ||||||
|                 return (JsonArray) (*this)[index]; |                 return (JsonArray) (*this)[index]; | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             bool getBool(int index) DEPRECATED |             DEPRECATED bool getBool(int index) | ||||||
|             { |             { | ||||||
|                 return (bool) (*this)[index]; |                 return (bool) (*this)[index]; | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             double getDouble(int index) DEPRECATED |             DEPRECATED double getDouble(int index) | ||||||
|             { |             { | ||||||
|                 return (double) (*this)[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]; |                 return (long) (*this)[index]; | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             char* getString(int index) DEPRECATED |             DEPRECATED char* getString(int index) | ||||||
|             { |             { | ||||||
|                 return (char*) (*this)[index]; |                 return (char*) (*this)[index]; | ||||||
|             } |             } | ||||||
|   | |||||||
| @@ -43,7 +43,7 @@ JsonValue JsonHashTable::operator [](const char* desiredKey) | |||||||
|     return JsonValue(); |     return JsonValue(); | ||||||
| } | } | ||||||
|  |  | ||||||
| JsonArray JsonHashTable::getArray(const char* key) DEPRECATED | DEPRECATED JsonArray JsonHashTable::getArray(const char* key) | ||||||
| { | { | ||||||
|     return (JsonArray) (*this)[key]; |     return (JsonArray) (*this)[key]; | ||||||
| } | } | ||||||
| @@ -8,8 +8,6 @@ | |||||||
| #include "JsonObjectBase.h" | #include "JsonObjectBase.h" | ||||||
| #include "JsonValue.h" | #include "JsonValue.h" | ||||||
|  |  | ||||||
| #define DEPRECATED |  | ||||||
|  |  | ||||||
| namespace ArduinoJson | namespace ArduinoJson | ||||||
| { | { | ||||||
|     namespace Parser |     namespace Parser | ||||||
| @@ -37,29 +35,29 @@ namespace ArduinoJson | |||||||
|                 return (*this)[key].success(); |                 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]; |                 return (bool) (*this)[key]; | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             double getDouble(const char* key) DEPRECATED |             DEPRECATED double getDouble(const char* key) | ||||||
|             { |             { | ||||||
|                 return (double) (*this)[key]; |                 return (double) (*this)[key]; | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             JsonHashTable getHashTable(const char* key) DEPRECATED |             DEPRECATED JsonHashTable getHashTable(const char* key) | ||||||
|             { |             { | ||||||
|                 return (JsonHashTable) (*this)[key]; |                 return (JsonHashTable) (*this)[key]; | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             long getLong(const char* key) DEPRECATED |             DEPRECATED long getLong(const char* key) | ||||||
|             { |             { | ||||||
|                 return (long) (*this)[key]; |                 return (long) (*this)[key]; | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             char* getString(const char* key) DEPRECATED |             DEPRECATED char* getString(const char* key) | ||||||
|             { |             { | ||||||
|                 return (char*) (*this)[key]; |                 return (char*) (*this)[key]; | ||||||
|             } |             } | ||||||
|   | |||||||
| @@ -7,6 +7,14 @@ | |||||||
|  |  | ||||||
| #include "jsmn.h" | #include "jsmn.h" | ||||||
|  |  | ||||||
|  | #ifdef __GNUC__ | ||||||
|  | #define DEPRECATED __attribute__((deprecated)) | ||||||
|  | #elif defined(_MSC_VER) | ||||||
|  | #define DEPRECATED __declspec(deprecated) | ||||||
|  | #else | ||||||
|  | #define DEPRECATED | ||||||
|  | #endif | ||||||
|  |  | ||||||
| namespace ArduinoJson | namespace ArduinoJson | ||||||
| { | { | ||||||
|     namespace Parser |     namespace Parser | ||||||
|   | |||||||
| @@ -18,11 +18,7 @@ namespace ArduinoJson | |||||||
|  |  | ||||||
|         class JsonValue : public JsonObjectBase |         class JsonValue : public JsonObjectBase | ||||||
|         { |         { | ||||||
|             friend JsonArray; |  | ||||||
|             friend JsonHashTable; |  | ||||||
|  |  | ||||||
|         public: |         public: | ||||||
|  |  | ||||||
|             JsonValue() {} |             JsonValue() {} | ||||||
|  |  | ||||||
|             JsonValue(char* json, jsmntok_t* tokens) |             JsonValue(char* json, jsmntok_t* tokens) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user