forked from bblanchon/ArduinoJson
Added an printTo(char[N]) and prettyPrintTo(char[N]) (issue #292)
This commit is contained in:
1 parent
1f3e227a8b
commit
432476c98a
7 files changed
+31
-12
No files matched your search
@@ -50,6 +50,11 @@ class JsonPrintable {
|
||||
return printTo(sb);
|
||||
}
|
||||
|
||||
template <size_t N>
|
||||
size_t printTo(char (&buffer)[N]) const {
|
||||
return printTo(buffer, N);
|
||||
}
|
||||
|
||||
template <typename TString>
|
||||
typename TypeTraits::EnableIf<StringFuncs<TString>::has_append, size_t>::type
|
||||
printTo(TString &str) const {
|
||||
@@ -67,6 +72,11 @@ class JsonPrintable {
|
||||
return prettyPrintTo(sb);
|
||||
}
|
||||
|
||||
template <size_t N>
|
||||
size_t prettyPrintTo(char (&buffer)[N]) const {
|
||||
return prettyPrintTo(buffer, N);
|
||||
}
|
||||
|
||||
size_t prettyPrintTo(Print &print) const {
|
||||
IndentedPrint indentedPrint = IndentedPrint(print);
|
||||
return prettyPrintTo(indentedPrint);
|
||||
|
||||
Reference in new issue
Block a user