8#ifndef GALAXY_FS_FILEERROR_HPP_
9#define GALAXY_FS_FILEERROR_HPP_
34 FileError(
const std::string& mode,
const std::string& reason,
const std::filesystem::path& path)
noexcept;
44 void log()
const noexcept;
65struct std::formatter<
std::filesystem::path> : std::formatter<std::string>
67 auto format(
const std::filesystem::path& path, format_context& ctx)
const
69 return std::formatter<std::string>::format(path.string(), ctx);
74struct std::formatter<
galaxy::FileError> : std::formatter<std::string>
78 return std::formatter<std::string>::format(std::format(
"Failed to {0} {2} because {1}", fe.
m_mode, fe.
m_reason, fe.
m_path), ctx);
Stores information about a File I/O error.
void log() const noexcept
Prints the file error in a nice format to the console.
std::string m_reason
Reason for file i/o failure.
std::string m_mode
File I/O mode.
~FileError() noexcept
Destructor.
std::filesystem::path m_path
Path error occured on.
FileError() noexcept
Constructor.