Refactoring...

This commit is contained in:
Benoit Blanchon
2014-08-26 10:13:49 +02:00
parent 3ae7327687
commit f127ef6019
6 changed files with 41 additions and 22 deletions

View File

@ -0,0 +1,29 @@
/*
* Arduino JSON library
* Benoit Blanchon 2014 - MIT License
*/
#include "JsonPrintable.h"
#include "JsonPrettyPrint.h"
#include "StringBuilder.h"
using namespace ArduinoJson::Generator;
using namespace ArduinoJson::Internals;
size_t JsonPrintable::printTo(char* buffer, size_t bufferSize)
{
StringBuilder sb(buffer, bufferSize);
return printTo(sb);
}
size_t JsonPrintable::prettyPrintTo(IndentedPrint& p) const
{
JsonPrettyPrint prettyPrint(p);
return printTo(prettyPrint);
}
size_t JsonPrintable::prettyPrintTo(Print& p) const
{
IndentedPrint indentedPrint(p);
return printTo(indentedPrint);
}