mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
		
			520 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			520 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| // Copyright Benoit Blanchon 2014-2015
 | |
| // MIT License
 | |
| //
 | |
| // Arduino JSON library
 | |
| // https://github.com/bblanchon/ArduinoJson
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include "../Arduino/Print.hpp"
 | |
| #include "../Arduino/String.hpp"
 | |
| 
 | |
| namespace ArduinoJson {
 | |
| namespace Internals {
 | |
| 
 | |
| // A Print implementation that allows to write in a String
 | |
| class DynamicStringBuilder : public Print {
 | |
|  public:
 | |
|   DynamicStringBuilder(String &str) : _str(str) {}
 | |
| 
 | |
|   virtual size_t write(uint8_t c) {
 | |
|     _str += c;
 | |
|     return 1;
 | |
|   }
 | |
| 
 | |
|  private:
 | |
|   String &_str;
 | |
| };
 | |
| }
 | |
| }
 |