tool-exception.inline.h 887 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 aFuntoolException::aFuntoolException(const std::string &msg) : aFunException{msg} {
  8. }
  9. inline FileOpenException::FileOpenException(const FilePath &file) : aFuntoolException("File cannot open: " + file) {
  10. }
  11. inline RegexException::RegexException(const std::string &msg) : aFuntoolException("Regex error: " + msg) {
  12. }
  13. inline LogFatalError::LogFatalError(const char *msg) : aFuntoolException(msg) {
  14. }
  15. inline Exit::Exit(int exit_code_) : aFuntoolException("Exit by user"), exit_code{exit_code_} {
  16. }
  17. inline int Exit::getExitCode() const {
  18. return exit_code;
  19. }
  20. }
  21. #endif //AFUN_TOOL_EXCEPTION_INLINE_H