mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			44 lines
		
	
	
		
			696 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			696 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Arduino JSON library
 | |
|  * Benoit Blanchon 2014 - MIT License
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include "StringBuilder.h"
 | |
| 
 | |
| class JsonObjectBase
 | |
| {
 | |
| public:
 | |
| 
 | |
| 
 | |
| protected:
 | |
| 
 | |
|     enum ObjectType
 | |
|     {
 | |
|         JSON_STRING,
 | |
|         JSON_NUMBER,
 | |
|         JSON_BOOLEAN,
 | |
|         JSON_OBJECT,
 | |
|     };
 | |
| 
 | |
|     union ObjectValue
 | |
|     {
 | |
|         const char*     string;
 | |
|         double          number;
 | |
|         bool            boolean;
 | |
|         JsonObjectBase* object;
 | |
|     };
 | |
| 
 | |
|     struct ObjectContainer
 | |
|     {
 | |
|         ObjectType type;
 | |
|         ObjectValue value;
 | |
|     };
 | |
| 
 | |
|     void writeObjectTo(ObjectContainer& obj, StringBuilder& sb);
 | |
| 
 | |
|     virtual void writeTo(StringBuilder& sb) = 0;
 | |
| };
 | |
| 
 |