mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Renamed and moved internal files
This commit is contained in:
		
							
								
								
									
										33
									
								
								src/ArduinoJson/Document/StaticJsonDocument.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								src/ArduinoJson/Document/StaticJsonDocument.hpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,33 @@ | ||||
| // ArduinoJson - arduinojson.org | ||||
| // Copyright Benoit Blanchon 2014-2018 | ||||
| // MIT License | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include "JsonDocument.hpp" | ||||
|  | ||||
| namespace ARDUINOJSON_NAMESPACE { | ||||
|  | ||||
| template <size_t CAPACITY> | ||||
| class StaticJsonDocument : public JsonDocument { | ||||
|   static const size_t ACTUAL_CAPACITY = | ||||
|       AddPadding<Max<1, CAPACITY>::value>::value; | ||||
|  | ||||
|  public: | ||||
|   StaticJsonDocument() : JsonDocument(_buffer, ACTUAL_CAPACITY) {} | ||||
|  | ||||
|   StaticJsonDocument(const JsonDocument& src) | ||||
|       : JsonDocument(_buffer, ACTUAL_CAPACITY) { | ||||
|     copy(src); | ||||
|   } | ||||
|  | ||||
|   StaticJsonDocument operator=(const JsonDocument& src) { | ||||
|     copy(src); | ||||
|     return *this; | ||||
|   } | ||||
|  | ||||
|  private: | ||||
|   char _buffer[ACTUAL_CAPACITY]; | ||||
| }; | ||||
|  | ||||
| }  // namespace ARDUINOJSON_NAMESPACE | ||||
		Reference in New Issue
	
	Block a user