Reduced size by 300 bytes by reusing the JsonPrettyPrint from v3

This commit is contained in:
Benoit Blanchon
2014-11-08 19:40:07 +01:00
parent d8dbfe6e6d
commit f6133f2d36
10 changed files with 138 additions and 92 deletions

View File

@@ -7,7 +7,8 @@
#pragma once
#include "IndentedPrint.hpp"
#include "PrettyJsonWriter.hpp"
#include "JsonWriter.hpp"
#include "Prettyfier.hpp"
#include "StringBuilder.hpp"
namespace ArduinoJson {
@@ -32,9 +33,8 @@ class JsonPrintable {
}
size_t prettyPrintTo(IndentedPrint &print) const {
PrettyJsonWriter writer(print);
downcast().writeTo(writer);
return writer.bytesWritten();
Prettyfier p(print);
return printTo(p);
}
size_t prettyPrintTo(char *buffer, size_t bufferSize) const {