diff options
author | Mark Brand <mabrand@mabrand.nl> | 2015-11-23 12:19:25 +0100 |
---|---|---|
committer | Mark Brand <mabrand@mabrand.nl> | 2015-11-27 12:15:15 +0000 |
commit | d6ecdb434410ffda64058cdb51483786f5af9932 (patch) | |
tree | 4ce01725938a7d19b6bb3313492be0cac282d626 /src/sql/drivers/mysql/qsql_mysql.cpp | |
parent | 6333edfdf3a682dfa8f54fe021f9aa55d6c91049 (diff) |
qsql: move Q<driver>Result out of header
Leaf result classes do not need to be exposed in the headers. The
implementations were inconsistent on this point.
Change-Id: I5bd41ae9e77b932f6232218a014400a59f2ef5a0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/sql/drivers/mysql/qsql_mysql.cpp')
-rw-r--r-- | src/sql/drivers/mysql/qsql_mysql.cpp | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp index 96bdcc42fa..739d605911 100644 --- a/src/sql/drivers/mysql/qsql_mysql.cpp +++ b/src/sql/drivers/mysql/qsql_mysql.cpp @@ -33,7 +33,6 @@ #include "qsql_mysql_p.h" -#include <QtSql/private/qsqldriver_p.h> #include <qcoreapplication.h> #include <qvariant.h> #include <qdatetime.h> @@ -46,8 +45,9 @@ #include <qtextcodec.h> #include <qvector.h> #include <qfile.h> - #include <qdebug.h> +#include <QtSql/private/qsqldriver_p.h> +#include <QtSql/private/qsqlresult_p.h> #ifdef Q_OS_WIN32 // comment the next line out if you want to use MySQL/embedded on Win32 systems. @@ -156,6 +156,41 @@ static inline QVariant qDateTimeFromString(QString &val) #endif } +class QMYSQLResultPrivate; + +class QMYSQLResult : public QSqlResult +{ + friend class QMYSQLDriver; + friend class QMYSQLResultPrivate; +public: + explicit QMYSQLResult(const QMYSQLDriver *db); + ~QMYSQLResult(); + + QVariant handle() const Q_DECL_OVERRIDE; +protected: + void cleanup(); + bool fetch(int i) Q_DECL_OVERRIDE; + bool fetchNext() Q_DECL_OVERRIDE; + bool fetchLast() Q_DECL_OVERRIDE; + bool fetchFirst() Q_DECL_OVERRIDE; + QVariant data(int field) Q_DECL_OVERRIDE; + bool isNull(int field) Q_DECL_OVERRIDE; + bool reset (const QString& query) Q_DECL_OVERRIDE; + int size() Q_DECL_OVERRIDE; + int numRowsAffected() Q_DECL_OVERRIDE; + QVariant lastInsertId() const Q_DECL_OVERRIDE; + QSqlRecord record() const Q_DECL_OVERRIDE; + void virtual_hook(int id, void *data) Q_DECL_OVERRIDE; + bool nextResult() Q_DECL_OVERRIDE; + +#if MYSQL_VERSION_ID >= 40108 + bool prepare(const QString &stmt) Q_DECL_OVERRIDE; + bool exec() Q_DECL_OVERRIDE; +#endif +private: + QMYSQLResultPrivate *d; +}; + class QMYSQLResultPrivate : public QObject { Q_OBJECT |