tool_exception.inline.h 1010 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef AFUN_TOOL_EXCEPTION_INLINE_H
  2. #define AFUN_TOOL_EXCEPTION_INLINE_H
  3. #ifdef __cplusplus
  4. #include "tool_exception.h"
  5. #ifndef AFUN_TOOL_C
  6. namespace aFuntool {
  7. #endif
  8. aFunException::aFunException(std::string msg) : message{std::move(msg)} {
  9. }
  10. const std::string &aFunException::getMessage() const {
  11. return message;
  12. }
  13. aFuntoolException::aFuntoolException(const std::string &msg) : aFunException{msg} {
  14. }
  15. FileOpenException::FileOpenException(const FilePath &file) : aFuntoolException("File cannot open: " + file) {
  16. }
  17. RegexException::RegexException(const std::string &msg) : aFuntoolException("Regex error: " + msg) {
  18. }
  19. LogFatalError::LogFatalError(const char *msg) : aFuntoolException(msg) {
  20. }
  21. Exit::Exit(int exit_code_) : aFuntoolException("Exit by user"), exit_code{exit_code_} {
  22. }
  23. int Exit::getExitCode() const {
  24. return exit_code;
  25. }
  26. #ifndef AFUN_TOOL_C
  27. }
  28. #endif
  29. #endif
  30. #endif //AFUN_TOOL_EXCEPTION_INLINE_H