JsonPrintable.cpp 651 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Arduino JSON library
  3. * Benoit Blanchon 2014 - MIT License
  4. */
  5. #include "JsonPrintable.h"
  6. #include "JsonPrettyPrint.h"
  7. #include "StringBuilder.h"
  8. using namespace ArduinoJson::Generator;
  9. using namespace ArduinoJson::Internals;
  10. size_t JsonPrintable::printTo(char* buffer, size_t bufferSize)
  11. {
  12. StringBuilder sb(buffer, bufferSize);
  13. return printTo(sb);
  14. }
  15. size_t JsonPrintable::prettyPrintTo(IndentedPrint& p) const
  16. {
  17. JsonPrettyPrint prettyPrint(p);
  18. return printTo(prettyPrint);
  19. }
  20. size_t JsonPrintable::prettyPrintTo(Print& p) const
  21. {
  22. IndentedPrint indentedPrint(p);
  23. return printTo(indentedPrint);
  24. }