ezEngine  Release 25.03
ezStatus Struct Reference

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
 

Detailed Description

An ezResult with an additional message for the reason of failure.

Member Function Documentation

◆ AssertSuccess()

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.

◆ LogFailure()

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.


The documentation for this struct was generated from the following files: