Qx v0.5.8
Qt Extensions Library
|
The GenericError class is multi-purpose container for storing error information. More...
#include <qx/core/qx-genericerror.h>
Public Member Functions | |
GenericError () | |
GenericError (Severity severity, quint32 value, const QString &primary, const QString &secondary={}, const QString &details={}, const QString &caption={}) | |
QString | caption () const |
QString | details () const |
bool | isValid () const |
bool | operator!= (const GenericError &other) const =default |
bool | operator== (const GenericError &other) const =default |
QString | primary () const |
QString | secondary () const |
GenericError & | setCaption (const QString &caption) |
GenericError & | setDetails (const QString &details) |
GenericError & | setPrimary (const QString &primary) |
GenericError & | setSecondary (const QString &secondary) |
GenericError & | setSeverity (Severity sv) |
Severity | severity () const |
quint32 | value () const |
GenericError | withSeverity (Severity sv) |
Public Member Functions inherited from Qx::AbstractError<"Qx::GenericError", 999 > | |
operator bool () const | |
bool | operator!= (const AbstractError &other) const=default |
bool | operator== (const AbstractError &other) const=default |
Additional Inherited Members | |
Static Public Attributes inherited from Qx::AbstractError<"Qx::GenericError", 999 > | |
static constexpr quint16 | TYPE_CODE |
static constexpr QLatin1StringView | TYPE_NAME |
Protected Member Functions inherited from Qx::IError | |
IError ()=default | |
bool | operator!= (const IError &other) const =default |
bool | operator== (const IError &other) const =default |
This class holds no association with any particular procedure, operation, or state, and instead acts as a simple implementation of the Error interface that allows for setting its underlying fields directly.
More application specific derivations of AbstractError should be preferred, but this class is useful in situations where the need for encapsulating error info is basic and sporadic.
Qx::GenericError::GenericError | ( | ) |
Constructs an invalid generic error.
Qx::GenericError::GenericError | ( | Severity | severity, |
quint32 | value, | ||
const QString & | primary, | ||
const QString & | secondary = {}, | ||
const QString & | details = {}, | ||
const QString & | caption = {} ) |
Constructs a generic error with the given severity, value and primary info, as well as the optional secondary info, details and caption.
QString Qx::GenericError::caption | ( | ) | const |
Returns the generic error's caption.
QString Qx::GenericError::details | ( | ) | const |
Returns the generic error's details.
bool Qx::GenericError::isValid | ( | ) | const |
Returns true
if the generic error is valid; otherwise returns false
.
|
default |
Returns true
if this error is not the same as other; otherwise, returns false.
|
default |
Returns true
if this error is the same as other; otherwise, returns false.
QString Qx::GenericError::primary | ( | ) | const |
Returns the generic error's primary information.
QString Qx::GenericError::secondary | ( | ) | const |
Returns the generic error's secondary information.
GenericError & Qx::GenericError::setCaption | ( | const QString & | caption | ) |
Sets the generic error's caption to caption and returns a reference to the error.
GenericError & Qx::GenericError::setDetails | ( | const QString & | details | ) |
Sets the generic error's details to details and returns a reference to the error.
GenericError & Qx::GenericError::setPrimary | ( | const QString & | primary | ) |
Sets the generic error's primary information to primary and returns a reference to the error.
GenericError & Qx::GenericError::setSecondary | ( | const QString & | secondary | ) |
Sets the generic error's secondary information to secondary and returns a reference to the error.
GenericError & Qx::GenericError::setSeverity | ( | Severity | sv | ) |
Sets the generic error's severity to sv and returns a reference to the error.
Severity Qx::GenericError::severity | ( | ) | const |
Returns the generic error's severity.
quint32 Qx::GenericError::value | ( | ) | const |
Returns the generic error's value
GenericError Qx::GenericError::withSeverity | ( | Severity | sv | ) |
Returns a copy of the generic error with a severity of sv.