warning.cpp 684 B

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * warning.cpp for jsonstroller
  3. *
  4. * Author: isundil <isundill@gmail.com>
  5. **/
  6. #include <typeinfo>
  7. #include "warning.hh"
  8. Warning::Warning(const JsonException &w): what(w)
  9. {
  10. type = Warning::getType(w);
  11. }
  12. Warning::Warning(const Warning &w): what(w.what), type(w.type), _filename(w._filename)
  13. { }
  14. Warning::~Warning()
  15. { }
  16. const JsonException &Warning::operator()() const
  17. { return what; }
  18. const std::string &Warning::getType() const
  19. { return type; }
  20. std::string Warning::getType(const std::exception &w)
  21. { return typeid(w).name(); }
  22. std::string Warning::filename() const
  23. { return _filename; }
  24. std::string Warning::filename(const std::string &f)
  25. { return _filename = f; }