jsonObjectEntry.cpp 547 B

12345678910111213141516171819202122232425262728293031
  1. #include "jsonObjectEntry.hh"
  2. #include "jsonObject.hh"
  3. JSonObjectEntry::JSonObjectEntry(JSonObject *parent, const std::string &k, JSonElement *v): JSonElement(parent), key(k), value(v)
  4. { }
  5. JSonObjectEntry::~JSonObjectEntry()
  6. {
  7. delete value;
  8. }
  9. bool JSonObjectEntry::operator==(const std::string &k) const
  10. {
  11. return key == k;
  12. }
  13. JSonElement *JSonObjectEntry::operator*()
  14. {
  15. return value;
  16. }
  17. const JSonElement *JSonObjectEntry::operator*() const
  18. {
  19. return value;
  20. }
  21. std::string JSonObjectEntry::stringify() const
  22. {
  23. return key;
  24. }