jsonObject.hh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * jsonObject.hh for jsonstroller
  3. *
  4. * Author: isundil <isundill@gmail.com>
  5. **/
  6. #pragma once
  7. #include "config.h"
  8. #include "jsonContainer.hh"
  9. #include "jsonObjectEntry.hh"
  10. #include "jsonException.hh"
  11. class JSonObject: public JSonContainer
  12. {
  13. public:
  14. JSonObject(JSonContainer *parent);
  15. virtual ~JSonObject();
  16. void push(const std::string &key, JSonElement *child);
  17. JSonObject::const_iterator find(const std::string &key) const;
  18. bool erase(const std::string &);
  19. bool contains(const std::string &) const;
  20. virtual JSonElement *firstChild();
  21. virtual const JSonElement *firstChild() const;
  22. const JSonElement* get(const std::string &) const;
  23. virtual std::string stringify() const;
  24. class DoubleKeyException: public JsonException
  25. {
  26. public:
  27. DoubleKeyException(unsigned long long offset, const std::string &key, LinearHistory &buf);
  28. };
  29. class NotAKeyException: public JsonException
  30. {
  31. public:
  32. NotAKeyException(unsigned long long offset, LinearHistory &buf);
  33. };
  34. };