warning.hh 833 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * warning.hh for jsonstroller
  3. *
  4. * Author: isundil <isundill@gmail.com>
  5. **/
  6. #pragma once
  7. #include "jsonException.hh"
  8. class Warning
  9. {
  10. public:
  11. Warning(const Warning &);
  12. Warning(const JsonException &);
  13. ~Warning();
  14. /**
  15. * get exception representing non-blocking error
  16. **/
  17. const JsonException &operator()() const;
  18. /**
  19. * Because of copy, we can't get warning typeinfo
  20. **/
  21. const std::string &getType() const;
  22. /**
  23. * return type of given exception
  24. **/
  25. static std::string getType(const std::exception &);
  26. std::string filename() const;
  27. std::string filename(const std::string &filename);
  28. private:
  29. JsonException what;
  30. std::string type;
  31. std::string _filename;
  32. };