jsonObjectEntry.hh 765 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * jsonObjectEntry.hh for jsonstroller
  3. *
  4. * Author: isundil <isundill@gmail.com>
  5. **/
  6. #pragma once
  7. #include "jsonElement.hh"
  8. class JSonObject;
  9. class JSonObjectEntry: public JSonElement
  10. {
  11. public:
  12. JSonObjectEntry(JSonObject*, const std::string &key, JSonElement *item);
  13. virtual ~JSonObjectEntry();
  14. std::string stringify() const;
  15. bool operator==(const std::string &) const;
  16. /**
  17. * Get associated value
  18. **/
  19. const JSonElement *operator*() const;
  20. JSonElement *operator*();
  21. /**
  22. * check if key or value match search pattern
  23. **/
  24. bool match(const std::string &) const;
  25. protected:
  26. const std::string key;
  27. JSonElement * const value;
  28. };