16 #ifndef IOEXCEPTION_HPP
17 #define IOEXCEPTION_HPP
19 #include "Athena/Exception.hpp"
42 inline IOException(
const std::string&
message,
const std::string& file,
const std::string&
function,
const int line) :
45 m_exceptionName =
"IOException";
53 #define THROW_IO_EXCEPTION(args, ...) \
55 if (atGetExceptionHandler()) {atGetExceptionHandler()(__FILE__, AT_PRETTY_FUNCTION, __LINE__, __VA_ARGS__); return; \
57 std::string msg = Athena::utility::sprintf(args, __VA_ARGS__);
64 #elif defined(__GNUC__)
65 #define THROW_IO_EXCEPTION(args...) \
67 if (atGetExceptionHandler()) {atGetExceptionHandler()(__FILE__, AT_PRETTY_FUNCTION, __LINE__, args); return; \
68 } else { std::string msg = Athena::utility::sprintf(args); \
69 throw Athena::error::IOException(msg, __FILE__, AT_PRETTY_FUNCTION, __LINE__); \
75 #define THROW_IO_EXCEPTION_RETURN(ret, args, ...) \
77 if (atGetExceptionHandler()) {atGetExceptionHandler()(__FILE__, AT_PRETTY_FUNCTION, __LINE__, __VA_ARGS__); return ret; \
79 std::string msg = Athena::utility::sprintf(args, __VA_ARGS__);
87 #elif defined(__GNUC__)
88 #define THROW_IO_EXCEPTION_RETURN(ret, args...) \
90 if (atGetExceptionHandler()) {atGetExceptionHandler()(__FILE__, AT_PRETTY_FUNCTION, __LINE__, args); return ret; \
91 } else { std::string msg = Athena::utility::sprintf(args); \
92 throw Athena::error::IOException(msg, __FILE__, AT_PRETTY_FUNCTION, __LINE__); \
97 #endif // IOEXCEPTION_HPP
IOException(const std::string &message, const std::string &file, const std::string &function, const int line)
The constructor for an IOException.
std::string message() const
Returns the Error message of the exception.
An excpeption thrown on inappropriate IO calls.
The baseclass for all Exceptions.