![]() |
Plasma Engine
2.0
|
An plResult with an additional message for the reason of failure. More...
#include <Status.h>
Public Member Functions | |
plStatus (const char *szError) | |
plStatus (plResult r, plStringView sError) | |
plStatus (plStringView sError) | |
PL_ALWAYS_INLINE | plStatus (plResult r) |
plStatus (const plFormatString &fmt) | |
PL_ALWAYS_INLINE bool | Succeeded () const |
PL_ALWAYS_INLINE bool | Failed () const |
PL_ALWAYS_INLINE void | IgnoreResult () |
Used to silence compiler warnings, when success or failure doesn't matter. | |
bool | LogFailure (plLogInterface *pLog=nullptr) |
If the state is PL_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 | |
plResult | m_Result |
plString | m_sMessage |
An plResult with an additional message for the reason of failure.
void plStatus::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 plStatus::LogFailure | ( | plLogInterface * | pLog = nullptr | ) |
If the state is PL_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.