JsonNodeWrapper.h 528 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include "JsonNode.h"
  3. class JsonValue;
  4. class JsonNodeWrapper
  5. {
  6. friend JsonValue;
  7. public:
  8. JsonNodeWrapper()
  9. : _node(0)
  10. {
  11. }
  12. explicit JsonNodeWrapper(JsonNode* node)
  13. : _node(node)
  14. {
  15. }
  16. protected:
  17. void duplicate(const JsonNodeWrapper& other)
  18. {
  19. if (!_node)
  20. {
  21. _node = other._node;
  22. }
  23. else
  24. {
  25. _node->duplicate(other._node);
  26. }
  27. }
  28. JsonNode* _node;
  29. };