41 :
_msg(std::move(ex._msg))
47 [[nodiscard]]
const char*
what() const noexcept
override
55 template<
typename... Args>
66 ::strncpy_s(
_msg.get(),
BUF_SIZE, message, strlen(message));
78 template<
typename... Args>
79 T
Function(
const char* mangled_name,
const char* func,
const char* format, Args&&... args)
81 formatMessage(
demangle(mangled_name).append(
"::").append(func).append(
"() ").append(format).c_str(), args...);
82 return *
dynamic_cast<T*
>(
this);
88 T
Function(
const char* mangled_name,
const char* func,
const char* message)
90 formatMessage(
demangle(mangled_name).append(
"::").append(func).append(
"() ").append(message).c_str());
91 return *
dynamic_cast<T*
>(
this);
132 template<typename... Args>
133 explicit
Exception(const
char* format, Args&&... args) noexcept
136 formatMessage(format, args...);
Exception implementation inherited from std::exception.
Definition Exception.h:18
ExceptionBase(const ExceptionBase &ex) noexcept
Copy constructor.
Definition Exception.h:28
const char * what() const noexcept override
Overloaded from base class 'std::exception'.
Definition Exception.h:47
void formatMessage(const char *format, Args... args) noexcept
Formats the exception message according sprintf().
Definition Exception.h:56
T Function(const char *mangled_name, const char *func, const char *message)
Formatting function with a class type_info and passing the message without formatting.
Definition Exception.h:88
T Function(const char *mangled_name, const char *func, const char *format, Args &&... args)
Formatting function with a class type_info and formatting the message.
Definition Exception.h:79
ExceptionBase() noexcept
Default Constructor.
Definition Exception.h:23
@ BUF_SIZE
Definition Exception.h:104
ExceptionBase(const ExceptionBase &&ex) noexcept
Move constructor.
Definition Exception.h:40
void formatMessage(const char *message) noexcept
Formats the exception message when no arguments are given.
Definition Exception.h:63
std::unique_ptr< char > _msg
Pointer to message string.
Definition Exception.h:98
Exception implementation for system calls failing within a wrapper class.
Definition Exception.h:147
ExceptionSystemCall(const char *syscall, int error, const char *mangled_name, const char *func)
Formatting Constructor with a class type_info, function and error value.
Exception implementation.
Definition Exception.h:112
Exception() noexcept
Default Constructor.
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10
_MISC_FUNC std::string demangle(const char *name)
Returns the unmangled function name returned by type ID.