WARNING: USE THIS SOFTWARE AT YOUR OWN RISK! THIS IS EXPERIMENTAL SOFTWARE NOT INTENDED FOR PRODUCTION USE! Zuble is currently an early stage prototype. As such Zuble is minimally tested and inherently unstable. It is provided for experimental, development, and demonstration purposes only. Zuble QML Types   |  Zuble C++ Classes   |  Zuble Overview
Zuble  0.1
Zuble Framework C++/QML extension API
ZsqlError.h
Go to the documentation of this file.
1 /*
2  * Zuble - A run-time system for QML/Javascript applications
3  * Copyright (C) 2013, 2014 Bob Dinitto
4  *
5  * ZsqlError.h
6  *
7  * Created on: 06-Aug, 2014
8  * Author: Bob Dinitto bob@ninzo.com
9  *
10  * Zuble is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 #ifndef ZSQLERROR_H
27 #define ZSQLERROR_H
28 
29 #include <QObject>
30 #include <QSqlError>
31 #include "zblcore_global.h"
32 
33 namespace Zbl
34 {
35 
40 class ZsqlError : public QObject
41 {
42  Q_OBJECT
43 public:
44  explicit ZsqlError(QObject *parent = 0);
45 
51  Q_PROPERTY(bool valid READ isValid)
52 
53 
59  Q_PROPERTY(int number READ getErrorNumber)
60 
67  Q_PROPERTY(QString text READ getText)
68 
74  Q_PROPERTY(QString driverText READ getDriverText)
75 
81  Q_PROPERTY(QString databaseText READ getDatabaseText)
82 
88  Q_PROPERTY(QString errorType READ getErrorType)
89 
97  Q_INVOKABLE bool equals(QObject* other);
98 
99 
100  QString getText();
101  QString getDriverText();
102  QString getDatabaseText();
103  QString getErrorType();
104  int getErrorNumber();
105  bool isValid();
106 
107  ZsqlError& operator=(const ZsqlError& other);
108  ZsqlError& operator=(const QSqlError& sqlError);
109 
110  bool operator==(const ZsqlError& other) const;
111  bool operator==(const QSqlError& other) const;
112 
113 signals:
114 
115 public slots:
116 
117 
118 private:
119 
120  QSqlError m_error;
121 
122 };
123 
124 } // Zbl
125 
126 #endif // ZSQLERROR_H
QString text
Returns both database and driver error message text concatenated into a single string.
Definition: ZsqlError.h:67
int getErrorNumber()
Definition: ZsqlError.cpp:71
bool isValid()
Definition: ZsqlError.cpp:77
int number
Returns both database and driver error message text concatenated into a single string.
Definition: ZsqlError.h:59
QString driverText
Returns driver error message text.
Definition: ZsqlError.h:74
QString getText()
Definition: ZsqlError.cpp:35
QString errorType
Returns database error type.
Definition: ZsqlError.h:88
bool valid
Returns true if an error is set, false otherwise.
Definition: ZsqlError.h:51
Definition: ZAndGate.cpp:6
Q_INVOKABLE bool equals(QObject *other)
Returns true if specified object is a ZsqlError object with the same value as this object...
Definition: ZsqlError.cpp:105
QString databaseText
Returns database error message text.
Definition: ZsqlError.h:81
QSqlError m_error
Definition: ZsqlError.h:120
QString getDatabaseText()
Definition: ZsqlError.cpp:45
ZsqlError(QObject *parent=0)
Definition: ZsqlError.cpp:30
QString getErrorType()
Definition: ZsqlError.cpp:50
QString getDriverText()
Definition: ZsqlError.cpp:40
A Javascript wrapper for QSqlError objects. (database sprocket)
Definition: ZsqlError.h:40