class ErrorCode
Required header: <Eclog/Error.h>
The ErrorCode class represents an error code, which can be compared to success (See Success) or a named constant in the error code enumeration (See ErrorCodeEnum). An error code also holds an error object (See Error), which can provide structured error information like an exception.
Name | Description |
---|---|
(constructor) | Constructor. |
destructor | Destructor. |
operator= | Copy assignment. |
operator bool | Checks if the error code is not equal to success. |
operator! | Checks if the error code is equal to success. |
operator== | Compares the error code with another error code or a named constant. |
operator!= | Compares the error code with another error code or a named constant. |
message | Gets the error message. |
error | Gets the error object. |
Name | Description |
---|---|
operator== | Compares a named constant with an error code. |
operator!= | Compares a named constant with an error code. |
operator<< | Insert error message into stream. |
ErrorCode(); (1)
ErrorCode(const ErrorCode& other); (2)
Constructs an ErrorCode.
(1) Default constructor. Constructs an error code equal to success (See Success).
(2) Copy constructor.
ErrorCode&
other Another error code.
~ErrorCode();
Destroys the ErrorCode.
ErrorCode& operator=(const ErrorCode& other);
Copy assignment.
ErrorCode&
other Another error code.
ErrorCode&
Reference to *this
.
operator BoolType() const;
Checks if the error code is not equal to success (See Success).
BoolType
true if the error code is not equal to success, false otherwise.
bool operator!() const;
Checks if the error code is equal to success (See Success).
BoolType
true if the error code is equal to success, false otherwise.
bool operator==(const ErrorCode& other) const;
bool operator!=(const ErrorCode& other) const;
bool operator==(ErrorCodeEnum e) const;
bool operator!=(ErrorCodeEnum e) const;
bool operator==(Success) const;
bool operator!=(Success) const;
Compares the error code with another error code or a named constant.
ErrorCode&
other Another error code to compare.
ErrorCodeEnum e Named constant to compare.
Success Success to compare.
bool
true if the corresponding comparison holds, false otherwise.
const char* message() const;
Gets the error message.
const char*
The error message.
const Error& error() const;
Gets the error object.
const
Error&
Reference to the error object.
bool operator==(Success a, const ErrorCode& b);
bool operator!=(Success a, const ErrorCode& b);
bool operator==(ErrorCodeEnum a, const ErrorCode& b);
bool operator!=(ErrorCodeEnum a, const ErrorCode& b);
Compares a named constant with an error code.
Success a Success to compare.
ErrorCodeEnum a Named constant to compare.
const
ErrorCode&
b Error code to compare.
bool
true if the corresponding comparison holds, false otherwise.
std::ostream& operator<<(std::ostream& stream, const ErrorCode& ec);
Insert error message into stream.
std::ostream&
stream The stream where characters are inserted.
const
ErrorCode&
ec Error code to get the error message from.
std::ostream&
The same as parameter stream.