galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
FileError.cpp
Go to the documentation of this file.
1
7
9
10#include "FileError.hpp"
11
12namespace galaxy
13{
15 {
16 }
17
18 FileError::FileError(const std::string& mode, const std::string& reason, const std::filesystem::path& path) noexcept
19 : m_mode {mode}
20 , m_reason {reason}
21 , m_path {path}
22 {
23 }
24
26 {
27 }
28
29 void FileError::log() const noexcept
30 {
31 GALAXY_LOG(GALAXY_ERROR, "Failed to {0} {2} because {1}", m_mode, m_reason, m_path);
32 }
33} // namespace galaxy
#define GALAXY_LOG(level, msg,...)
Definition Log.hpp:28
#define GALAXY_ERROR
Definition Log.hpp:24
void log() const noexcept
Prints the file error in a nice format to the console.
Definition FileError.cpp:29
std::string m_reason
Reason for file i/o failure.
Definition FileError.hpp:55
std::string m_mode
File I/O mode.
Definition FileError.hpp:50
~FileError() noexcept
Destructor.
Definition FileError.cpp:25
std::filesystem::path m_path
Path error occured on.
Definition FileError.hpp:60
FileError() noexcept
Constructor.
Definition FileError.cpp:14
Timer.hpp galaxy.
Definition Timer.cpp:18