JsonValue.cpp 665 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Arduino JSON library
  3. * Benoit Blanchon 2014 - MIT License
  4. */
  5. #include "EscapedString.h"
  6. #include "JsonValue.h"
  7. using namespace ArduinoJson::Internals;
  8. size_t JsonValue::printBoolTo(const Content& c, Print& p)
  9. {
  10. return p.print(c.asBool ? "true" : "false");
  11. }
  12. size_t JsonValue::printLongTo(const Content& c, Print& p)
  13. {
  14. return p.print(c.asLong);
  15. }
  16. size_t JsonValue::printPrintableTo(const Content& c, Print& p)
  17. {
  18. if (c.asPrintable)
  19. return c.asPrintable->printTo(p);
  20. else
  21. return p.print("null");
  22. }
  23. size_t JsonValue::printStringTo(const Content& c, Print& p)
  24. {
  25. return c.asString.printTo(p);
  26. }