![]() |
ezEngine
Release 25.03
|
An ezResult with an additional message for the reason of failure. More...
#include <Status.h>
Public Member Functions | |
ezStatus (const char *szError) | |
ezStatus (ezResult r, ezStringView sError) | |
ezStatus (ezStringView sError) | |
EZ_ALWAYS_INLINE | ezStatus (ezResult r) |
ezStatus (const ezFormatString &fmt) | |
EZ_ALWAYS_INLINE bool | Succeeded () const |
EZ_ALWAYS_INLINE bool | Failed () const |
EZ_ALWAYS_INLINE void | IgnoreResult () |
Used to silence compiler warnings, when success or failure doesn't matter. | |
bool | LogFailure (ezLogInterface *pLog=nullptr) |
If the state is EZ_FAILURE, the message is written to the given log (or the currently active thread-local log). More... | |
void | AssertSuccess (const char *szMsg=nullptr) const |
Asserts that the function succeeded. In case of failure, the program will terminate. More... | |
Public Attributes | |
ezResult | m_Result |
ezString | m_sMessage |
An ezResult with an additional message for the reason of failure.
void ezStatus::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 ezStatus::LogFailure | ( | ezLogInterface * | pLog = nullptr | ) |
If the state is EZ_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.