EscapedString.h 617 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Arduino JSON library
  3. * Benoit Blanchon 2014 - MIT License
  4. */
  5. #pragma once
  6. #include "Print.h"
  7. #include <string.h> // for strcmp
  8. namespace ArduinoJson
  9. {
  10. namespace Internals
  11. {
  12. class EscapedString
  13. {
  14. public:
  15. void set(const char* s)
  16. {
  17. rawString = s;
  18. }
  19. size_t printTo(Print&) const;
  20. bool equals(char const* s)
  21. {
  22. return strcmp(s, rawString) == 0;
  23. }
  24. private:
  25. const char* rawString;
  26. };
  27. }
  28. }