mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Added an overload of prettyPrintTo()
This commit is contained in:
		| @@ -10,12 +10,18 @@ | ||||
| using namespace ArduinoJson::Generator; | ||||
| using namespace ArduinoJson::Internals; | ||||
|  | ||||
| size_t JsonPrintable::printTo(char* buffer, size_t bufferSize) | ||||
| size_t JsonPrintable::printTo(char* buffer, size_t bufferSize) const | ||||
| { | ||||
|     StringBuilder sb(buffer, bufferSize); | ||||
|     return printTo(sb); | ||||
| } | ||||
|  | ||||
| size_t JsonPrintable::prettyPrintTo(char* buffer, size_t bufferSize) const | ||||
| { | ||||
|     StringBuilder sb(buffer, bufferSize); | ||||
|     return prettyPrintTo(sb); | ||||
| } | ||||
|  | ||||
| size_t JsonPrintable::prettyPrintTo(IndentedPrint& p) const | ||||
| { | ||||
|     JsonPrettyPrint prettyPrint(p); | ||||
|   | ||||
| @@ -19,10 +19,11 @@ namespace ArduinoJson | ||||
|  | ||||
|             virtual size_t printTo(Print& p) const = 0; | ||||
|  | ||||
|             size_t printTo(char* buffer, size_t bufferSize); | ||||
|             size_t printTo(char* buffer, size_t bufferSize) const; | ||||
|  | ||||
|             size_t prettyPrintTo(IndentedPrint& p) const; | ||||
|             size_t prettyPrintTo(Print& p) const; | ||||
|             size_t prettyPrintTo(char* buffer, size_t bufferSize) const; | ||||
|         }; | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user