mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			31 lines
		
	
	
		
			582 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			582 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Arduino JSON library
 | |
|  * Benoit Blanchon 2014 - MIT License
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include "Print.h"
 | |
| 
 | |
| namespace ArduinoJson
 | |
| {
 | |
|     namespace Generator
 | |
|     {
 | |
|         class StringBuilder : public Print
 | |
|         {
 | |
|         public:
 | |
|             StringBuilder(char* buf, int size)
 | |
|                 : buffer(buf), capacity(size - 1), length(0)
 | |
|             {
 | |
|                 buffer[0] = 0;
 | |
|             }
 | |
| 
 | |
|             virtual size_t write(uint8_t c);
 | |
| 
 | |
|         private:
 | |
|             char* buffer;
 | |
|             int capacity;
 | |
|             int length;
 | |
|         };
 | |
|     }
 | |
| } |