JsonNodeWrapper.hpp 520 B

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