Encapsulates status data types for error handling purpose. The class also exposes methods to query and set the error code.
The error codes use the same values as the standard HRESULT error codes on Windows.
#include <xsi_status.h>
Public Types | |
enum | Code { Undefined = 0xFFFFFFFF, OK = 0, False = 1, Fail = 0x80004005L, InvalidArgument = 0x80070057L, OutOfMemory = 0x8007000EL, AccessDenied = 0x80070005L, Unexpected = 0x8000FFFFL, NotImpl = 0x80004001L, MemberNotFound = 0x80020003L, Abort = 0x80004004L, BadVarType = 0x80020008L } |
Error code enumerator. More... | |
Public Member Functions | |
CStatus (Code in_code=OK) | |
Code | GetCode () const |
bool | Succeeded () const |
void | PutCode (Code in_code) |
CString | GetDescription () const |
CStatus & | operator= (Code in_code) |
bool | operator== (const CStatus &rhs) const |
bool | operator== (Code rhs) const |
bool | operator!= (const CStatus &rhs) const |
bool | operator!= (Code rhs) const |
void | AssertSucceeded (const CString &in_strText=CString()) const |
enum Code |
Constructs a status object from a given error code.
in_code | Error code |
Code GetCode | ( | ) | const |
Returns the underlying error code.
bool Succeeded | ( | ) | const |
Returns true if the status is either OK or False
void PutCode | ( | Code | in_code | ) |
Sets the error code type
in_code | Error code |
CString GetDescription | ( | ) | const |
Gets the status code description.
Reimplemented in CScriptErrorDescriptor.
bool operator== | ( | const CStatus & | rhs | ) | const |
bool operator== | ( | Code | rhs | ) | const |
bool operator!= | ( | const CStatus & | rhs | ) | const |
bool operator!= | ( | Code | rhs | ) | const |
Assert the current status code is OK or False.
in_strText | Optional message logs if the function doesn't assert. |