JsonObject.h 444 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. class JsonValue;
  3. struct JsonNode;
  4. class JsonObject
  5. {
  6. friend JsonValue;
  7. public:
  8. JsonObject()
  9. : _node(0)
  10. {
  11. }
  12. JsonObject(JsonNode* node)
  13. : _node(node)
  14. {
  15. }
  16. size_t size();
  17. JsonValue operator[](const char* key);
  18. bool operator==(const JsonObject& other) const;
  19. private:
  20. JsonNode* _node;
  21. JsonNode* getOrCreateNodeAt(char const* key);
  22. };