jsonObject.hh 976 B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "jsonContainer.hh"
  3. #include "jsonObjectEntry.hh"
  4. #include "jsonException.hh"
  5. class JSonObject: public JSonContainer
  6. {
  7. public:
  8. JSonObject(JSonContainer *parent);
  9. virtual ~JSonObject();
  10. void push(const std::string &key, JSonElement *child);
  11. JSonObject::const_iterator find(const std::string &key) const;
  12. bool contains(const std::string &) const;
  13. virtual JSonElement *firstChild();
  14. virtual const JSonElement *firstChild() const;
  15. const JSonElement* get(const std::string &) const;
  16. virtual std::string stringify() const;
  17. class DoubleKeyException: public JsonException
  18. {
  19. public:
  20. DoubleKeyException(unsigned long long offset, const std::string &key, WrappedBuffer<char> &buf);
  21. };
  22. class NotAKeyException: public JsonException
  23. {
  24. public:
  25. NotAKeyException(unsigned long long offset, WrappedBuffer<char> &buf);
  26. };
  27. };