mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			62 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			62 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Arduino JSON library
 | |
|  * Benoit Blanchon 2014 - MIT License
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #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 JsonArray;
 | |
|         class JsonObject;
 | |
| 
 | |
|         class JsonValue
 | |
|         {
 | |
|         public:
 | |
| 
 | |
|             JsonValue(char* json, Internal::JsonToken token)
 | |
|                 : json(json), token(token)
 | |
|             {
 | |
| 
 | |
|             }
 | |
| 
 | |
|             bool success()
 | |
|             {
 | |
|                 return token.isValid();
 | |
|             }
 | |
|             
 | |
|             operator bool();
 | |
|             operator double();
 | |
|             operator long();
 | |
|             operator char*();
 | |
|             operator JsonArray();
 | |
|             operator JsonObject();
 | |
|             JsonValue operator[](int index);
 | |
|             JsonValue operator[](const char*key);
 | |
| 
 | |
|             static JsonValue null()
 | |
|             {
 | |
|                 return JsonValue(0, Internal::JsonToken(0));
 | |
|             }
 | |
| 
 | |
|         private:
 | |
| 
 | |
|             char* json;
 | |
|             Internal::JsonToken token;
 | |
|         };
 | |
|     }
 | |
| } |