mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-11-01 08:48:30 +01:00 
			
		
		
		
	Add CopiedString and LinkedString
				
					
				
			This commit is contained in:
		| @@ -10,6 +10,8 @@ namespace ARDUINOJSON_NAMESPACE { | ||||
|  | ||||
| class StringCopier { | ||||
|  public: | ||||
|   typedef CopiedString string_type; | ||||
|  | ||||
|   StringCopier(MemoryPool& pool) : _pool(&pool) {} | ||||
|  | ||||
|   void startString() { | ||||
| @@ -17,7 +19,7 @@ class StringCopier { | ||||
|     _size = 0; | ||||
|   } | ||||
|  | ||||
|   const char* save() { | ||||
|   string_type save() { | ||||
|     ARDUINOJSON_ASSERT(_ptr); | ||||
|     return _pool->saveStringFromFreeZone(_size); | ||||
|   } | ||||
| @@ -47,12 +49,10 @@ class StringCopier { | ||||
|     return _ptr != 0; | ||||
|   } | ||||
|  | ||||
|   const char* c_str() { | ||||
|   string_type str() const { | ||||
|     return _ptr; | ||||
|   } | ||||
|  | ||||
|   typedef storage_policies::store_by_copy storage_policy; | ||||
|  | ||||
|  private: | ||||
|   MemoryPool* _pool; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user