PxCrypt
v0.2.2
Encrypt data within an image
Loading...
Searching...
No Matches
artwork_error.h
1
#ifndef ARTWORK_ERROR_H
2
#define ARTWORK_ERROR_H
3
4
// Qt Includes
5
#include <QString>
6
#include <QHash>
7
8
using namespace
Qt::Literals::StringLiterals
;
9
10
namespace
PxCryptPrivate
11
{
12
13
class
ArtworkError
14
{
15
//-Class Enums-------------------------------------------------------------
16
public
:
17
enum
Type
18
{
19
NoError,
20
NotMagic,
21
WrongCodec,
22
DataStreamError,
23
IntegrityError
24
};
25
26
//-Class Variables-------------------------------------------------------------
27
private
:
28
static
inline
const
QHash<Type, QString>
ERR_STRINGS{
29
{NoError, u
""
_s},
30
{NotMagic, u
"Image is not a magic image (missing magic number)."
_s},
31
{WrongCodec, u
"Image created with a different codec than specified (mismatched rendition)."
_s},
32
{DataStreamError, u
"An error occurred while streaming data from/to the canvas."
_s},
33
{IntegrityError, u
"A data integrity check failed while reading data."
_s}
34
};
35
36
//-Instance Variables-------------------------------------------------------------
37
private
:
38
Type mType;
39
QString
mDetails;
40
41
//-Constructor-------------------------------------------------------------
42
public
:
43
ArtworkError(Type t = NoError,
const
QString
& d = {});
44
45
//-Instance Functions-------------------------------------------------------------
46
public
:
47
bool
isValid()
const
;
48
Type type()
const
;
49
QString
details()
const
;
50
51
//-Operators-------------------------------------------------------------
52
public
:
53
operator
bool()
const
{
return
isValid(); }
54
};
55
56
}
57
58
#endif
// ARTWORK_ERROR_H
QHash
QString
Qt::Literals::StringLiterals
lib
src
art_io
artwork_error.h
Generated by
1.10.0