JsonNodeWrapper.hpp 594 B

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright Benoit Blanchon 2014
  2. // MIT License
  3. //
  4. // Arduino JSON library
  5. // https://github.com/bblanchon/ArduinoJson
  6. #pragma once
  7. #include "../ForwardDeclarations.hpp"
  8. #include "JsonNode.hpp"
  9. namespace ArduinoJson {
  10. namespace Internals {
  11. class JsonNodeWrapper {
  12. friend class JsonValue;
  13. public:
  14. JsonNodeWrapper() : _node(0) {}
  15. explicit JsonNodeWrapper(JsonNode *node) : _node(node) {}
  16. protected:
  17. void duplicate(const JsonNodeWrapper &other) {
  18. if (!_node) {
  19. _node = other._node;
  20. } else {
  21. _node->duplicate(other._node);
  22. }
  23. }
  24. JsonNode *_node;
  25. };
  26. }
  27. }