XII Release 0.1.0
Loading...
Searching...
No Matches
xiiStatus Struct Reference

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
 

Detailed Description

A xiiResult with an additional message for the reason of failure.

Member Function Documentation

◆ AssertSuccess()

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.

◆ LogFailure()

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.


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