QEloquent
1.1.0
Qt most flexible ORM.
Loading...
Searching...
No Matches
error.h
1
#ifndef QELOQUENT_ERROR_H
2
#define QELOQUENT_ERROR_H
3
4
#include <QEloquent/global.h>
5
6
#include <QSharedDataPointer>
7
#include <QSqlError>
8
9
class
QSqlQuery;
10
class
QSqlError;
11
12
namespace
QEloquent {
13
14
class
ErrorData;
15
class
QELOQUENT_EXPORT
Error
16
{
17
public
:
18
enum
ErrorType {
19
NoError,
20
NotFoundError,
21
DatabaseError
22
};
23
24
Error
();
25
Error
(ErrorType error,
const
QString &text = QString(),
const
QSqlError &sqlError = QSqlError());
26
Error
(
const
Error
&);
27
Error
(
Error
&&);
28
Error
&operator=(
const
Error
&);
29
Error
&operator=(
Error
&&);
30
~Error
();
31
32
QString text()
const
;
33
QSqlError sqlError()
const
;
34
ErrorType type()
const
;
35
36
static
Error
fromSqlQuery(
const
QSqlQuery &query);
37
static
Error
fromSqlError(
const
QSqlError &error);
38
39
private
:
40
Error
(ErrorData *data);
41
42
QSharedDataPointer<ErrorData> data;
43
};
44
45
}
// namespace QEloquent
46
47
#ifndef QT_NO_DEBUG_STREAM
48
Q_SQL_EXPORT QDebug operator<<(QDebug,
const
QEloquent::Error
&);
49
#endif
50
51
#endif
// QELOQUENT_ERROR_H
QEloquent::Error
Represents an error in a database operation.
Definition
error.h:16
src
query
error.h
Generated by
1.9.8