mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-11-01 08:48:30 +01:00 
			
		
		
		
	Merged the two StringBuilder classes into one
This commit is contained in:
		| @@ -4,20 +4,22 @@ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include "../Memory/MemoryPool.hpp" | ||||
| #include "../Memory/StringBuilder.hpp" | ||||
|  | ||||
| namespace ARDUINOJSON_NAMESPACE { | ||||
|  | ||||
| template <typename TMemoryPool> | ||||
| class StringCopier { | ||||
|  public: | ||||
|   StringCopier(TMemoryPool& memoryPool) : _memoryPool(&memoryPool) {} | ||||
|   typedef ARDUINOJSON_NAMESPACE::StringBuilder StringBuilder; | ||||
|  | ||||
|   typedef typename TMemoryPool::StringBuilder StringBuilder; | ||||
|   StringCopier(MemoryPool* memoryPool) : _memoryPool(memoryPool) {} | ||||
|  | ||||
|   StringBuilder startString() { | ||||
|     return _memoryPool->startString(); | ||||
|     return StringBuilder(_memoryPool); | ||||
|   } | ||||
|  | ||||
|  private: | ||||
|   TMemoryPool* _memoryPool; | ||||
|   MemoryPool* _memoryPool; | ||||
| }; | ||||
| }  // namespace ARDUINOJSON_NAMESPACE | ||||
|   | ||||
		Reference in New Issue
	
	Block a user