forked from bblanchon/ArduinoJson
Added an overload of prettyPrintTo()
This commit is contained in:
@ -10,12 +10,18 @@
|
|||||||
using namespace ArduinoJson::Generator;
|
using namespace ArduinoJson::Generator;
|
||||||
using namespace ArduinoJson::Internals;
|
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);
|
StringBuilder sb(buffer, bufferSize);
|
||||||
return printTo(sb);
|
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
|
size_t JsonPrintable::prettyPrintTo(IndentedPrint& p) const
|
||||||
{
|
{
|
||||||
JsonPrettyPrint prettyPrint(p);
|
JsonPrettyPrint prettyPrint(p);
|
||||||
|
@ -19,10 +19,11 @@ namespace ArduinoJson
|
|||||||
|
|
||||||
virtual size_t printTo(Print& p) const = 0;
|
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(IndentedPrint& p) const;
|
||||||
size_t prettyPrintTo(Print& p) const;
|
size_t prettyPrintTo(Print& p) const;
|
||||||
|
size_t prettyPrintTo(char* buffer, size_t bufferSize) const;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user