101 template <
typename... Args>
102 Exception(std::format_string<Args...> fmt, Args&&... args) {
103 if constexpr (
sizeof...(Args) == 0) {
104 m_what.Reset(std::string(fmt.get()).c_str());
106 const std::string formatted = std::format(fmt, std::forward<Args>(args)...);
107 m_what.Reset(formatted.c_str());
119 template <
typename... Args>
121 const std::string formatted = std::format(fmt, std::forward<Args>(args)...);
122 const std::string full =
"StormByte::" + std::string(component.
name) +
": " + formatted;
123 m_what.Reset(full.c_str());
161 virtual const
char* what() const noexcept;
173 using Exception::Exception;
182 using Exception::Exception;
191 using Exception::Exception;
Thrown when Base64 encode or decode fails.
Definition exception.hxx:189
Owned NUL-terminated buffer, safe to use across a DLL boundary.
Definition cstring.hxx:89
Thrown when deserialization fails.
Definition exception.hxx:171
Base exception type for the suite.
Definition exception.hxx:80
virtual ~Exception() noexcept=default
Destructor.
Exception(const std::string &message)
Constructs from a string.
Exception(std::string &&message)
Constructs from a moved string.
Exception(Exception &&e) noexcept=default
Move constructor.
Exception(Component component, std::format_string< Args... > fmt, Args &&... args)
Constructs with a component prefix and std::format.
Definition exception.hxx:120
Exception(std::format_string< Args... > fmt, Args &&... args)
Constructs with std::format.
Definition exception.hxx:102
Exception(const Exception &e)=default
Copy constructor.
Thrown when an index or range is out of bounds.
Definition exception.hxx:180
Root namespace of the StormByte suite.
Wraps a module name for the component-prefixed Exception constructor.
Definition exception.hxx:63
constexpr Component(std::string_view name) noexcept
Wraps name.
Definition exception.hxx:70
std::string_view name
Module name inserted after StormByte::.
Definition exception.hxx:64
#define STORMBYTE_PUBLIC
Definition visibility.h:52