FileOperationException.cpp 1007 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-04
  6. * Changed: 2023-02-07
  7. *
  8. * */
  9. #include <ls-std/core/exception/ExceptionMessage.hpp>
  10. #include <ls-std/core/exception/FileOperationException.hpp>
  11. ls::std::core::FileOperationException::FileOperationException() = default;
  12. ls::std::core::FileOperationException::FileOperationException(::std::string _message) : message(::std::move(_message))
  13. {}
  14. ls::std::core::FileOperationException::~FileOperationException() = default;
  15. const char *ls::std::core::FileOperationException::what() const noexcept
  16. {
  17. ::std::string concatenatedMessage = "FileOperationException thrown - ";
  18. if (this->message.empty())
  19. {
  20. concatenatedMessage = concatenatedMessage + "file operation failed!";
  21. }
  22. else
  23. {
  24. concatenatedMessage = concatenatedMessage + this->message;
  25. }
  26. return ExceptionMessage{concatenatedMessage}.toCharacterPointer();
  27. }