mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	* Added DynamicJsonArray and StaticJsonArray * Added DynamicJsonObject and StaticJsonObject * Added DynamicJsonVariant and StaticJsonVariant * Added deserializeJson() * Removed JsonBuffer::parseArray(), parseObject() and parse() * Removed JsonBuffer::createArray() and createObject()
		
			
				
	
	
		
			28 lines
		
	
	
		
			591 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			591 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| // ArduinoJson - arduinojson.org
 | |
| // Copyright Benoit Blanchon 2014-2018
 | |
| // MIT License
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include "DynamicJsonBuffer.hpp"
 | |
| #include "JsonArray.hpp"
 | |
| 
 | |
| namespace ArduinoJson {
 | |
| class DynamicJsonArray : public JsonArray {
 | |
|   DynamicJsonBuffer _buffer;
 | |
| 
 | |
|  public:
 | |
|   DynamicJsonArray() : JsonArray(&_buffer) {}
 | |
|   DynamicJsonArray(size_t capacity)
 | |
|       : JsonArray(&_buffer), _buffer(capacity - sizeof(JsonArray)) {}
 | |
| 
 | |
|   size_t memoryUsage() const {
 | |
|     return _buffer.size() + sizeof(JsonArray);
 | |
|   }
 | |
| 
 | |
|   DynamicJsonBuffer& buffer() {
 | |
|     return _buffer;
 | |
|   }
 | |
| };
 | |
| }  // namespace ArduinoJson
 |