47#include <system_error>
71 template<
typename Enum>
78 template<
typename Enum>
93 template<Described Enum>
94 class Category final:
public std::error_category {
100 const char*
name() const noexcept override;
124 static constexpr const char*
Name =
"StormByte";
136 return "Unknown StormByte error";
138 return "Unknown StormByte error";
157 return std::error_code(
static_cast<int>(e),
category());
244 const
char*
what() const noexcept;
250 explicit operator
bool() const noexcept;
255 std::error_code m_code;
266 struct is_error_code_enum<
StormByte::Error::Code>: true_type {};
std::error_category backed by StormByte::Error::Domain.
Definition error.hxx:94
const char * name() const noexcept override
Category name (Domain<Enum>::Name).
std::string message(int ev) const override
Message for the enumerator stored in ev.
~Fault() noexcept=default
Destructor.
const char * what() const noexcept
Owned message (category: message).
const std::error_code & code() const noexcept
Held code.
Fault(const Fault &other)=default
Copy constructor.
Fault(Fault &&other) noexcept=default
Move constructor.
Enum that has a StormByte::Error::Domain specialization.
Definition error.hxx:79
Error-code domains and the StormByte::Error::Fault value type.
Code
Suite-level codes that are not module-specific.
Definition error.hxx:114
@ Success
No error.
Definition error.hxx:115
@ Unknown
Unclassified suite error.
Definition error.hxx:116
const Category< Code > & category() noexcept
Process-wide category for StormByte::Error::Code.
STORMBYTE_FORCE_INLINE std::error_code make_error_code(Code e) noexcept
Builds an std::error_code from StormByte::Error::Code.
Definition error.hxx:156
Owned values that cross a DLL without the caller's CRT.
Root namespace of the StormByte suite.
static constexpr const char * Name
Stable category tag.
Definition error.hxx:124
static STORMBYTE_FORCE_INLINE std::string Message(Code e)
Text for one suite enumerator.
Definition error.hxx:131
Description of one error-code enum.
Definition error.hxx:72
#define STORMBYTE_PUBLIC
Definition visibility.h:52