mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Add documentation to most public symbols
This commit is contained in:
		| @@ -37,6 +37,8 @@ class AllocatorOwner { | ||||
|   TAllocator _allocator; | ||||
| }; | ||||
|  | ||||
| // A JsonDocument that uses the provided allocator to allocate its memory pool. | ||||
| // https://arduinojson.org/v6/api/basicjsondocument/ | ||||
| template <typename TAllocator> | ||||
| class BasicJsonDocument : AllocatorOwner<TAllocator>, public JsonDocument { | ||||
|  public: | ||||
| @@ -104,6 +106,8 @@ class BasicJsonDocument : AllocatorOwner<TAllocator>, public JsonDocument { | ||||
|     return *this; | ||||
|   } | ||||
|  | ||||
|   // Reduces the capacity of the memory pool to match the current usage. | ||||
|   // https://arduinojson.org/v6/api/basicjsondocument/shrinktofit/ | ||||
|   void shrinkToFit() { | ||||
|     ptrdiff_t bytes_reclaimed = _pool.squash(); | ||||
|     if (bytes_reclaimed == 0) | ||||
| @@ -119,6 +123,8 @@ class BasicJsonDocument : AllocatorOwner<TAllocator>, public JsonDocument { | ||||
|     _data.movePointers(ptr_offset, ptr_offset - bytes_reclaimed); | ||||
|   } | ||||
|  | ||||
|   // Reclaims the memory leaked when removing and replacing values. | ||||
|   // https://arduinojson.org/v6/api/jsondocument/garbagecollect/ | ||||
|   bool garbageCollect() { | ||||
|     // make a temporary clone and move assign | ||||
|     BasicJsonDocument tmp(*this); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user