DummyPrint.hpp 441 B

12345678910111213141516171819202122232425
  1. // Copyright Benoit Blanchon 2014-2017
  2. // MIT License
  3. //
  4. // Arduino JSON library
  5. // https://bblanchon.github.io/ArduinoJson/
  6. // If you like this project, please add a star!
  7. #pragma once
  8. namespace ArduinoJson {
  9. namespace Internals {
  10. // A dummy Print implementation used in JsonPrintable::measureLength()
  11. class DummyPrint {
  12. public:
  13. size_t print(char) {
  14. return 1;
  15. }
  16. size_t print(const char* s) {
  17. return strlen(s);
  18. }
  19. };
  20. }
  21. }