QtJsonSerializer
4.0.0
A library to perform generic seralization and deserialization of QObjects
src
jsonserializer
exception.h
1
#ifndef QTJSONSERIALIZER_EXCEPTION_H
2
#define QTJSONSERIALIZER_EXCEPTION_H
3
4
#include "QtJsonSerializer/qtjsonserializer_global.h"
5
#include <QtCore/qstring.h>
6
#include <QtCore/qsharedpointer.h>
7
#include <QtCore/qstack.h>
8
9
#if !defined(QT_NO_EXCEPTIONS) && QT_CONFIG(future)
10
#include <QtCore/qexception.h>
11
namespace
QtJsonSerializer
{
13
using
ExceptionBase
=
QException
;
14
}
15
#else
16
#include <exception>
17
namespace
QtJsonSerializer
{
19
using
ExceptionBase
= std::exception;
20
}
21
#endif
22
23
namespace
QtJsonSerializer
{
24
25
class
ExceptionPrivate;
27
class
Q_JSONSERIALIZER_EXPORT
Exception
:
public
ExceptionBase
28
{
29
public
:
31
using
PropertyTrace
=
QStack<QPair<QByteArray, QByteArray>
>;
32
34
Exception
(
const
QByteArray
&what);
35
37
const
char
*what() const noexcept final;
38
40
QByteArray
message() const;
42
PropertyTrace
propertyTrace() const;
43
45
virtual
void
raise() const;
47
virtual
ExceptionBase
*clone() const;
48
49
protected:
51
QSharedPointer
<ExceptionPrivate> d;
52
};
53
55
class Q_JSONSERIALIZER_EXPORT
SerializationException
: public
Exception
56
{
57
public
:
59
SerializationException
(
const
QByteArray
&what);
60
61
void
raise
()
const
override
;
62
ExceptionBase
*clone()
const override
;
63
};
64
66
class
Q_JSONSERIALIZER_EXPORT
DeserializationException
:
public
Exception
67
{
68
public
:
70
DeserializationException
(
const
QByteArray
&what);
71
72
void
raise
()
const
override
;
73
ExceptionBase
*clone()
const override
;
74
};
75
76
}
77
78
#endif // QTJSONSERIALIZER_EXCEPTION_H
QtJsonSerializer
The QtJsonSerializer namespace holds all classes of the module.
Definition:
cborserializer.h:7
QtJsonSerializer::ExceptionBase
QException ExceptionBase
The exception base class to use for this module.
Definition:
exception.h:13
QSharedPointer
QStack
QtJsonSerializer::SerializationException
Exception thrown by the serializers if something goes wrong while serializing.
Definition:
exception.h:55
QException
QtJsonSerializer::Exception
Exception thrown by QJsonSerializer if something goes wrong.
Definition:
exception.h:27
QByteArray
QtJsonSerializer::DeserializationException
Exception thrown by the serializers if something goes wrong while deserializing.
Definition:
exception.h:66
Generated on Tue Dec 3 2019 08:44:13 for QtJsonSerializer by
1.8.16