Qx v0.5.8
Qt Extensions Library
Loading...
Searching...
No Matches
qx-genericerror.h
1#ifndef QX_GENERICERROR_H
2#define QX_GENERICERROR_H
3
4// Shared Lib Support
5#include "qx/core/qx_core_export.h"
6
7// Intra-component Includes
9
10namespace Qx
11{
12
13class QX_CORE_EXPORT GenericError final : public AbstractError<"Qx::GenericError", 999>
14{
15//-Instance Variables------------------------------------------------------------------------------------------
16private:
17 quint32 mValue;
18 Severity mSeverity;
19 QString mCaption;
20 QString mPrimary;
21 QString mSecondary;
22 QString mDetails;
23
24//-Constructor----------------------------------------------------------------------------------------------
25public:
27 GenericError(Severity severity, quint32 value, const QString& primary,
28 const QString& secondary = {}, const QString& details = {}, const QString& caption = {});
29
30//-Instance Functions----------------------------------------------------------------------------------------------
31private:
32 quint32 deriveValue() const override;
33 Severity deriveSeverity() const override;
34 QString deriveCaption() const override;
35 QString derivePrimary() const override;
36 QString deriveSecondary() const override;
37 QString deriveDetails() const override;
38
39public:
40 bool isValid() const;
41 quint32 value() const;
42 Severity severity() const;
43 QString caption() const;
44 QString primary() const;
45 QString secondary() const;
46 QString details() const;
47
48 GenericError& setSeverity(Severity sv);
49 GenericError withSeverity(Severity sv);
50 GenericError& setCaption(const QString& caption);
51 GenericError& setPrimary(const QString& primary);
52 GenericError& setSecondary(const QString& secondary);
53 GenericError& setDetails(const QString& details);
54
55//-Operators-------------------------------------------------------------------------------------------------------
56public:
57 bool operator==(const GenericError& other) const = default;
58 bool operator!=(const GenericError& other) const = default;
59
60};
61
62}
63
64#endif // QX_GENERICERROR_H
The AbstractError template class completes the Error interface and acts as the base class from which ...
Definition qx-abstracterror.h:86
The GenericError class is multi-purpose container for storing error information.
Definition qx-genericerror.h:14
bool operator!=(const GenericError &other) const =default
bool operator==(const GenericError &other) const =default
The Qx namespace is the main namespace through which all non-global functionality of the Qx library i...
Definition qx-processwaiter.cpp:5
Severity
Definition qx-global.h:11
The qx-abstracterror.h header file provides access to the base class from which custom error types sh...