![]() |
XII Release 0.1.0
|
A xiiResult with an additional message for the reason of failure. More...
#include <Status.h>
Public Member Functions | |
xiiStatus (const char *szError) | |
xiiStatus (xiiResult r, xiiStringView sError) | |
xiiStatus (xiiStringView sError) | |
XII_ALWAYS_INLINE | xiiStatus (xiiResult r) |
xiiStatus (const xiiFormatString &fmt) | |
XII_ALWAYS_INLINE bool | Succeeded () const |
XII_ALWAYS_INLINE bool | Failed () const |
XII_ALWAYS_INLINE void | IgnoreResult () |
Used to silence compiler warnings, when success or failure doesn't matter. | |
bool | LogFailure (xiiLogInterface *pLog=nullptr) |
If the state is XII_FAILURE, the message is written to the given log (or the currently active thread-local log). | |
void | AssertSuccess (const char *szMsg=nullptr) const |
Asserts that the function succeeded. In case of failure, the program will terminate. | |
Public Attributes | |
xiiResult | m_Result |
xiiString | m_sMessage |
A xiiResult with an additional message for the reason of failure.
void xiiStatus::AssertSuccess | ( | const char * | szMsg = nullptr | ) | const |
Asserts that the function succeeded. In case of failure, the program will terminate.
If msg is given, this will be the assert message. Additionally m_sMessage will be included as a detailed message.
bool xiiStatus::LogFailure | ( | xiiLogInterface * | pLog = nullptr | ) |
If the state is XII_FAILURE, the message is written to the given log (or the currently active thread-local log).
The return value is the same as 'Failed()' but isn't marked as [[nodiscard]], ie returns true, if a failure happened.