5#include "qx/core/qx_core_export.h"
16namespace QxErrorPrivate
18 template<
class ErrorAdaptable>
30namespace Qx {
class Error; }
41 static inline const QString DETAILED_INFO_HEADING = u
"Details:\n--------"_s;
48 static constexpr quint16 TYPE_CODE = 0;
66 template<
class ErrorType>
69 mTypeCode(ErrorType::TYPE_CODE),
70 mTypeName(ErrorType::TYPE_NAME)
85 template<class EAble, class EAter = typename AdapterRegistry<EAble>::adapter>
92 quint16 typeCode()
const;
95 quint32 value()
const;
103 bool isValid()
const;
104 bool equivalent(
const Error& other)
const;
105 quint64 code()
const;
117 operator bool()
const;
132#define QX_DECLARE_ERROR_ADAPTATION(Adaptable, Adapter) \
133 static_assert(Qx::error_adaptation<Adaptable, Adapter>, "Adapter must satisfy the 'error_adapter' concept " \
134 "and be constructable from Adaptable."); \
136 struct QxErrorPrivate::adapter_registry<Adaptable> { typedef Adapter adapter; };
The Error class acts as an interface for an extensible variety of error objects.
Definition qx-error.h:38
Error(const EAble &adapted)
Definition qx-error.h:87
bool operator==(const Error &other) const =default
bool operator!=(const Error &other) const =default
Error(const ErrorType &e)
Definition qx-error.h:68
IError defines the baseline inheritance interface for Qx error types.
Definition qx-abstracterror.h:28
virtual QString deriveCaption() const
Definition qx-abstracterror.cpp:102
virtual quint32 deriveValue() const
Definition qx-abstracterror.cpp:78
virtual QString deriveSecondary() const
Definition qx-abstracterror.cpp:124
virtual QString derivePrimary() const
Definition qx-abstracterror.cpp:113
virtual Severity deriveSeverity() const
Definition qx-abstracterror.cpp:87
virtual QString deriveDetails() const
Definition qx-abstracterror.cpp:135
Specifies that two types form a Qx error adaptation.
Definition qx-abstracterror.h:159
Specifies that a type is a Qx error type.
Definition qx-abstracterror.h:148
The Qx namespace is the main namespace through which all non-global functionality of the Qx library i...
Definition qx-processwaiter.cpp:5
QString severityString(Severity sv, bool uc)
Definition qx-global.cpp:51
Severity
Definition qx-global.h:11
The qx-abstracterror.h header file provides access to the base class from which custom error types sh...
QX_CORE_EXPORT QTextStream & operator<<(QTextStream &ts, const Qx::Error &e)
Definition qx-error.cpp:376