tool-exception.inline.h 860 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef AFUN_TOOL_EXCEPTION_INLINE_H
  2. #define AFUN_TOOL_EXCEPTION_INLINE_H
  3. #include "tool-exception.h"
  4. namespace aFuntool {
  5. inline aFunException::aFunException(std::string msg) : message{std::move(msg)} {
  6. }
  7. inline const char *aFunException::what() {
  8. return message.c_str();
  9. }
  10. inline aFuntoolException::aFuntoolException(const std::string &msg) : aFunException{msg} {
  11. }
  12. inline FileOpenException::FileOpenException(const FilePath &file) : aFuntoolException("File cannot open: " + file) {
  13. }
  14. inline RegexException::RegexException(const std::string &msg) : aFuntoolException("Regex error: " + msg) {
  15. }
  16. inline LogFatalError::LogFatalError(const char *msg) : aFuntoolException(msg) {
  17. }
  18. inline Exit::Exit() : aFuntoolException("Exit by user") {
  19. }
  20. }
  21. #endif //AFUN_TOOL_EXCEPTION_INLINE_H