From 1ee11474622e7da068fb1cd26f509ed10848a3b5 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 21 Feb 2013 16:54:24 -0800 Subject: Rename the SQL driver header files to _p.h (make private) The drivers were never public API. They were exposed by mistake in public headers. What's more, they have #include'd a private header (qsqlcachedresult_p.h) since at least Qt 4.5.1. That means no one used those headers in Qt 4 (private headers weren't installed then) and it's unlikely anyone did in 5.0. Change-Id: Ie0a47bcf0260ee6bdd3d8494b78fd1eec28a2d6b Reviewed-by: Oswald Buddenhagen Reviewed-by: Friedemann Kleint Reviewed-by: Mark Brand --- src/plugins/sqldrivers/db2/main.cpp | 2 +- src/plugins/sqldrivers/ibase/main.cpp | 2 +- src/plugins/sqldrivers/mysql/main.cpp | 2 +- src/plugins/sqldrivers/oci/main.cpp | 2 +- src/plugins/sqldrivers/odbc/main.cpp | 2 +- src/plugins/sqldrivers/psql/main.cpp | 2 +- src/plugins/sqldrivers/sqlite/smain.cpp | 2 +- src/plugins/sqldrivers/sqlite2/smain.cpp | 2 +- src/plugins/sqldrivers/tds/main.cpp | 2 +- src/sql/drivers/db2/qsql_db2.cpp | 2 +- src/sql/drivers/db2/qsql_db2.h | 127 ------------------------ src/sql/drivers/db2/qsql_db2.pri | 2 +- src/sql/drivers/db2/qsql_db2_p.h | 127 ++++++++++++++++++++++++ src/sql/drivers/ibase/qsql_ibase.cpp | 2 +- src/sql/drivers/ibase/qsql_ibase.h | 108 --------------------- src/sql/drivers/ibase/qsql_ibase.pri | 2 +- src/sql/drivers/ibase/qsql_ibase_p.h | 108 +++++++++++++++++++++ src/sql/drivers/mysql/qsql_mysql.cpp | 2 +- src/sql/drivers/mysql/qsql_mysql.h | 143 --------------------------- src/sql/drivers/mysql/qsql_mysql.pri | 2 +- src/sql/drivers/mysql/qsql_mysql_p.h | 143 +++++++++++++++++++++++++++ src/sql/drivers/oci/qsql_oci.cpp | 2 +- src/sql/drivers/oci/qsql_oci.h | 104 -------------------- src/sql/drivers/oci/qsql_oci.pri | 2 +- src/sql/drivers/oci/qsql_oci_p.h | 104 ++++++++++++++++++++ src/sql/drivers/odbc/qsql_odbc.cpp | 2 +- src/sql/drivers/odbc/qsql_odbc.h | 159 ------------------------------- src/sql/drivers/odbc/qsql_odbc.pri | 2 +- src/sql/drivers/odbc/qsql_odbc_p.h | 159 +++++++++++++++++++++++++++++++ src/sql/drivers/psql/qsql_psql.cpp | 2 +- src/sql/drivers/psql/qsql_psql.h | 159 ------------------------------- src/sql/drivers/psql/qsql_psql.pri | 2 +- src/sql/drivers/psql/qsql_psql_p.h | 159 +++++++++++++++++++++++++++++++ src/sql/drivers/sqlite/qsql_sqlite.cpp | 2 +- src/sql/drivers/sqlite/qsql_sqlite.h | 99 ------------------- src/sql/drivers/sqlite/qsql_sqlite.pri | 2 +- src/sql/drivers/sqlite/qsql_sqlite_p.h | 99 +++++++++++++++++++ src/sql/drivers/sqlite2/qsql_sqlite2.cpp | 2 +- src/sql/drivers/sqlite2/qsql_sqlite2.h | 104 -------------------- src/sql/drivers/sqlite2/qsql_sqlite2.pri | 2 +- src/sql/drivers/sqlite2/qsql_sqlite2_p.h | 104 ++++++++++++++++++++ src/sql/drivers/tds/qsql_tds.cpp | 2 +- src/sql/drivers/tds/qsql_tds.h | 117 ----------------------- src/sql/drivers/tds/qsql_tds.pri | 2 +- src/sql/drivers/tds/qsql_tds_p.h | 117 +++++++++++++++++++++++ src/sql/kernel/qsqldatabase.cpp | 18 ++-- src/tools/uic/qclass_lib_map.h | 18 ---- 47 files changed, 1156 insertions(+), 1174 deletions(-) delete mode 100644 src/sql/drivers/db2/qsql_db2.h create mode 100644 src/sql/drivers/db2/qsql_db2_p.h delete mode 100644 src/sql/drivers/ibase/qsql_ibase.h create mode 100644 src/sql/drivers/ibase/qsql_ibase_p.h delete mode 100644 src/sql/drivers/mysql/qsql_mysql.h create mode 100644 src/sql/drivers/mysql/qsql_mysql_p.h delete mode 100644 src/sql/drivers/oci/qsql_oci.h create mode 100644 src/sql/drivers/oci/qsql_oci_p.h delete mode 100644 src/sql/drivers/odbc/qsql_odbc.h create mode 100644 src/sql/drivers/odbc/qsql_odbc_p.h delete mode 100644 src/sql/drivers/psql/qsql_psql.h create mode 100644 src/sql/drivers/psql/qsql_psql_p.h delete mode 100644 src/sql/drivers/sqlite/qsql_sqlite.h create mode 100644 src/sql/drivers/sqlite/qsql_sqlite_p.h delete mode 100644 src/sql/drivers/sqlite2/qsql_sqlite2.h create mode 100644 src/sql/drivers/sqlite2/qsql_sqlite2_p.h delete mode 100644 src/sql/drivers/tds/qsql_tds.h create mode 100644 src/sql/drivers/tds/qsql_tds_p.h (limited to 'src') diff --git a/src/plugins/sqldrivers/db2/main.cpp b/src/plugins/sqldrivers/db2/main.cpp index abde11b178..6c796beff6 100644 --- a/src/plugins/sqldrivers/db2/main.cpp +++ b/src/plugins/sqldrivers/db2/main.cpp @@ -41,7 +41,7 @@ #include #include -#include "../../../sql/drivers/db2/qsql_db2.h" +#include "../../../sql/drivers/db2/qsql_db2_p.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/sqldrivers/ibase/main.cpp b/src/plugins/sqldrivers/ibase/main.cpp index 1ce663d868..e7d1c38690 100644 --- a/src/plugins/sqldrivers/ibase/main.cpp +++ b/src/plugins/sqldrivers/ibase/main.cpp @@ -41,7 +41,7 @@ #include #include -#include "../../../sql/drivers/ibase/qsql_ibase.h" +#include "../../../sql/drivers/ibase/qsql_ibase_p.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/sqldrivers/mysql/main.cpp b/src/plugins/sqldrivers/mysql/main.cpp index d313152cd7..8aaee6c268 100644 --- a/src/plugins/sqldrivers/mysql/main.cpp +++ b/src/plugins/sqldrivers/mysql/main.cpp @@ -41,7 +41,7 @@ #include #include -#include "../../../sql/drivers/mysql/qsql_mysql.h" +#include "../../../sql/drivers/mysql/qsql_mysql_p.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/sqldrivers/oci/main.cpp b/src/plugins/sqldrivers/oci/main.cpp index fc069df534..f1b0266536 100644 --- a/src/plugins/sqldrivers/oci/main.cpp +++ b/src/plugins/sqldrivers/oci/main.cpp @@ -41,7 +41,7 @@ #include #include -#include "../../../sql/drivers/oci/qsql_oci.h" +#include "../../../sql/drivers/oci/qsql_oci_p.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/sqldrivers/odbc/main.cpp b/src/plugins/sqldrivers/odbc/main.cpp index 215cbf6042..fda5c68fcc 100644 --- a/src/plugins/sqldrivers/odbc/main.cpp +++ b/src/plugins/sqldrivers/odbc/main.cpp @@ -41,7 +41,7 @@ #include #include -#include "../../../sql/drivers/odbc/qsql_odbc.h" +#include "../../../sql/drivers/odbc/qsql_odbc_p.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/sqldrivers/psql/main.cpp b/src/plugins/sqldrivers/psql/main.cpp index b3cba82f3e..3851ba6bfe 100644 --- a/src/plugins/sqldrivers/psql/main.cpp +++ b/src/plugins/sqldrivers/psql/main.cpp @@ -41,7 +41,7 @@ #include #include -#include "../../../sql/drivers/psql/qsql_psql.h" +#include "../../../sql/drivers/psql/qsql_psql_p.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/sqldrivers/sqlite/smain.cpp b/src/plugins/sqldrivers/sqlite/smain.cpp index e52c235c18..1835962331 100644 --- a/src/plugins/sqldrivers/sqlite/smain.cpp +++ b/src/plugins/sqldrivers/sqlite/smain.cpp @@ -41,7 +41,7 @@ #include #include -#include "../../../../src/sql/drivers/sqlite/qsql_sqlite.h" +#include "../../../../src/sql/drivers/sqlite/qsql_sqlite_p.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/sqldrivers/sqlite2/smain.cpp b/src/plugins/sqldrivers/sqlite2/smain.cpp index 38eb8e7fed..e15834a18e 100644 --- a/src/plugins/sqldrivers/sqlite2/smain.cpp +++ b/src/plugins/sqldrivers/sqlite2/smain.cpp @@ -41,7 +41,7 @@ #include #include -#include "../../../../src/sql/drivers/sqlite2/qsql_sqlite2.h" +#include "../../../../src/sql/drivers/sqlite2/qsql_sqlite2_p.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/sqldrivers/tds/main.cpp b/src/plugins/sqldrivers/tds/main.cpp index 9066efa172..1cb04e9e07 100644 --- a/src/plugins/sqldrivers/tds/main.cpp +++ b/src/plugins/sqldrivers/tds/main.cpp @@ -47,7 +47,7 @@ #define _WINSCARD_H_ #include #endif -#include "../../../sql/drivers/tds/qsql_tds.h" +#include "../../../sql/drivers/tds/qsql_tds_p.h" QT_BEGIN_NAMESPACE diff --git a/src/sql/drivers/db2/qsql_db2.cpp b/src/sql/drivers/db2/qsql_db2.cpp index 9406861d4c..50a9af23bc 100644 --- a/src/sql/drivers/db2/qsql_db2.cpp +++ b/src/sql/drivers/db2/qsql_db2.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qsql_db2.h" +#include "qsql_db2_p.h" #include #include #include diff --git a/src/sql/drivers/db2/qsql_db2.h b/src/sql/drivers/db2/qsql_db2.h deleted file mode 100644 index 5d31906096..0000000000 --- a/src/sql/drivers/db2/qsql_db2.h +++ /dev/null @@ -1,127 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSql module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSQL_DB2_H -#define QSQL_DB2_H - -#ifdef QT_PLUGIN -#define Q_EXPORT_SQLDRIVER_DB2 -#else -#define Q_EXPORT_SQLDRIVER_DB2 Q_SQL_EXPORT -#endif - -#include -#include - -QT_BEGIN_NAMESPACE - -#if 0 -#pragma qt_no_master_include -#pragma qt_sync_stop_processing -#endif - -class QDB2Driver; -class QDB2DriverPrivate; -class QDB2ResultPrivate; -class QSqlRecord; - -class QDB2Result : public QSqlResult -{ -public: - QDB2Result(const QDB2Driver* dr, const QDB2DriverPrivate* dp); - ~QDB2Result(); - bool prepare(const QString& query); - bool exec(); - QVariant handle() const; - -protected: - QVariant data(int field); - bool reset (const QString& query); - bool fetch(int i); - bool fetchNext(); - bool fetchFirst(); - bool fetchLast(); - bool isNull(int i); - int size(); - int numRowsAffected(); - QSqlRecord record() const; - void virtual_hook(int id, void *data); - void detachFromResultSet(); - bool nextResult(); - -private: - QDB2ResultPrivate* d; -}; - -class Q_EXPORT_SQLDRIVER_DB2 QDB2Driver : public QSqlDriver -{ - Q_OBJECT -public: - explicit QDB2Driver(QObject* parent = 0); - QDB2Driver(Qt::HANDLE env, Qt::HANDLE con, QObject* parent = 0); - ~QDB2Driver(); - bool hasFeature(DriverFeature) const; - void close(); - QSqlRecord record(const QString& tableName) const; - QStringList tables(QSql::TableType type) const; - QSqlResult *createResult() const; - QSqlIndex primaryIndex(const QString& tablename) const; - bool beginTransaction(); - bool commitTransaction(); - bool rollbackTransaction(); - QString formatValue(const QSqlField &field, bool trimStrings) const; - QVariant handle() const; - bool open(const QString& db, - const QString& user, - const QString& password, - const QString& host, - int port, - const QString& connOpts); - QString escapeIdentifier(const QString &identifier, IdentifierType type) const; - -private: - bool setAutoCommit(bool autoCommit); - QDB2DriverPrivate* d; -}; - -QT_END_NAMESPACE - -#endif // QSQL_DB2_H diff --git a/src/sql/drivers/db2/qsql_db2.pri b/src/sql/drivers/db2/qsql_db2.pri index 963732aaee..c9e65e2c2e 100644 --- a/src/sql/drivers/db2/qsql_db2.pri +++ b/src/sql/drivers/db2/qsql_db2.pri @@ -1,4 +1,4 @@ -HEADERS += $$PWD/qsql_db2.h +HEADERS += $$PWD/qsql_db2_p.h SOURCES += $$PWD/qsql_db2.cpp unix { diff --git a/src/sql/drivers/db2/qsql_db2_p.h b/src/sql/drivers/db2/qsql_db2_p.h new file mode 100644 index 0000000000..5d31906096 --- /dev/null +++ b/src/sql/drivers/db2/qsql_db2_p.h @@ -0,0 +1,127 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSql module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSQL_DB2_H +#define QSQL_DB2_H + +#ifdef QT_PLUGIN +#define Q_EXPORT_SQLDRIVER_DB2 +#else +#define Q_EXPORT_SQLDRIVER_DB2 Q_SQL_EXPORT +#endif + +#include +#include + +QT_BEGIN_NAMESPACE + +#if 0 +#pragma qt_no_master_include +#pragma qt_sync_stop_processing +#endif + +class QDB2Driver; +class QDB2DriverPrivate; +class QDB2ResultPrivate; +class QSqlRecord; + +class QDB2Result : public QSqlResult +{ +public: + QDB2Result(const QDB2Driver* dr, const QDB2DriverPrivate* dp); + ~QDB2Result(); + bool prepare(const QString& query); + bool exec(); + QVariant handle() const; + +protected: + QVariant data(int field); + bool reset (const QString& query); + bool fetch(int i); + bool fetchNext(); + bool fetchFirst(); + bool fetchLast(); + bool isNull(int i); + int size(); + int numRowsAffected(); + QSqlRecord record() const; + void virtual_hook(int id, void *data); + void detachFromResultSet(); + bool nextResult(); + +private: + QDB2ResultPrivate* d; +}; + +class Q_EXPORT_SQLDRIVER_DB2 QDB2Driver : public QSqlDriver +{ + Q_OBJECT +public: + explicit QDB2Driver(QObject* parent = 0); + QDB2Driver(Qt::HANDLE env, Qt::HANDLE con, QObject* parent = 0); + ~QDB2Driver(); + bool hasFeature(DriverFeature) const; + void close(); + QSqlRecord record(const QString& tableName) const; + QStringList tables(QSql::TableType type) const; + QSqlResult *createResult() const; + QSqlIndex primaryIndex(const QString& tablename) const; + bool beginTransaction(); + bool commitTransaction(); + bool rollbackTransaction(); + QString formatValue(const QSqlField &field, bool trimStrings) const; + QVariant handle() const; + bool open(const QString& db, + const QString& user, + const QString& password, + const QString& host, + int port, + const QString& connOpts); + QString escapeIdentifier(const QString &identifier, IdentifierType type) const; + +private: + bool setAutoCommit(bool autoCommit); + QDB2DriverPrivate* d; +}; + +QT_END_NAMESPACE + +#endif // QSQL_DB2_H diff --git a/src/sql/drivers/ibase/qsql_ibase.cpp b/src/sql/drivers/ibase/qsql_ibase.cpp index 7aff6f62fc..abf6a74c3e 100644 --- a/src/sql/drivers/ibase/qsql_ibase.cpp +++ b/src/sql/drivers/ibase/qsql_ibase.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qsql_ibase.h" +#include "qsql_ibase_p.h" #include #include #include diff --git a/src/sql/drivers/ibase/qsql_ibase.h b/src/sql/drivers/ibase/qsql_ibase.h deleted file mode 100644 index 781448b98a..0000000000 --- a/src/sql/drivers/ibase/qsql_ibase.h +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSql module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSQL_IBASE_H -#define QSQL_IBASE_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -#if 0 -#pragma qt_no_master_include -#pragma qt_sync_stop_processing -#endif - -class QIBaseDriverPrivate; -class QIBaseDriver; - -class QIBaseDriver : public QSqlDriver -{ - Q_OBJECT - friend class QIBaseDriverPrivate; - friend class QIBaseResultPrivate; -public: - explicit QIBaseDriver(QObject *parent = 0); - explicit QIBaseDriver(isc_db_handle connection, QObject *parent = 0); - virtual ~QIBaseDriver(); - bool hasFeature(DriverFeature f) const; - bool open(const QString & db, - const QString & user, - const QString & password, - const QString & host, - int port, - const QString & connOpts); - bool open(const QString & db, - const QString & user, - const QString & password, - const QString & host, - int port) { return open (db, user, password, host, port, QString()); } - void close(); - QSqlResult *createResult() const; - bool beginTransaction(); - bool commitTransaction(); - bool rollbackTransaction(); - QStringList tables(QSql::TableType) const; - - QSqlRecord record(const QString& tablename) const; - QSqlIndex primaryIndex(const QString &table) const; - - QString formatValue(const QSqlField &field, bool trimStrings) const; - QVariant handle() const; - - QString escapeIdentifier(const QString &identifier, IdentifierType type) const; - - bool subscribeToNotification(const QString &name); - bool unsubscribeFromNotification(const QString &name); - QStringList subscribedToNotifications() const; - -private Q_SLOTS: - void qHandleEventNotification(void* updatedResultBuffer); - -private: - QIBaseDriverPrivate* d; -}; - -QT_END_NAMESPACE - -#endif // QSQL_IBASE_H diff --git a/src/sql/drivers/ibase/qsql_ibase.pri b/src/sql/drivers/ibase/qsql_ibase.pri index 26017e8727..ef3b68d34e 100644 --- a/src/sql/drivers/ibase/qsql_ibase.pri +++ b/src/sql/drivers/ibase/qsql_ibase.pri @@ -1,4 +1,4 @@ -HEADERS += $$PWD/qsql_ibase.h +HEADERS += $$PWD/qsql_ibase_p.h SOURCES += $$PWD/qsql_ibase.cpp unix { diff --git a/src/sql/drivers/ibase/qsql_ibase_p.h b/src/sql/drivers/ibase/qsql_ibase_p.h new file mode 100644 index 0000000000..781448b98a --- /dev/null +++ b/src/sql/drivers/ibase/qsql_ibase_p.h @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSql module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSQL_IBASE_H +#define QSQL_IBASE_H + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +#if 0 +#pragma qt_no_master_include +#pragma qt_sync_stop_processing +#endif + +class QIBaseDriverPrivate; +class QIBaseDriver; + +class QIBaseDriver : public QSqlDriver +{ + Q_OBJECT + friend class QIBaseDriverPrivate; + friend class QIBaseResultPrivate; +public: + explicit QIBaseDriver(QObject *parent = 0); + explicit QIBaseDriver(isc_db_handle connection, QObject *parent = 0); + virtual ~QIBaseDriver(); + bool hasFeature(DriverFeature f) const; + bool open(const QString & db, + const QString & user, + const QString & password, + const QString & host, + int port, + const QString & connOpts); + bool open(const QString & db, + const QString & user, + const QString & password, + const QString & host, + int port) { return open (db, user, password, host, port, QString()); } + void close(); + QSqlResult *createResult() const; + bool beginTransaction(); + bool commitTransaction(); + bool rollbackTransaction(); + QStringList tables(QSql::TableType) const; + + QSqlRecord record(const QString& tablename) const; + QSqlIndex primaryIndex(const QString &table) const; + + QString formatValue(const QSqlField &field, bool trimStrings) const; + QVariant handle() const; + + QString escapeIdentifier(const QString &identifier, IdentifierType type) const; + + bool subscribeToNotification(const QString &name); + bool unsubscribeFromNotification(const QString &name); + QStringList subscribedToNotifications() const; + +private Q_SLOTS: + void qHandleEventNotification(void* updatedResultBuffer); + +private: + QIBaseDriverPrivate* d; +}; + +QT_END_NAMESPACE + +#endif // QSQL_IBASE_H diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp index b4aa5cd4cc..04ba450d46 100644 --- a/src/sql/drivers/mysql/qsql_mysql.cpp +++ b/src/sql/drivers/mysql/qsql_mysql.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qsql_mysql.h" +#include "qsql_mysql_p.h" #include #include diff --git a/src/sql/drivers/mysql/qsql_mysql.h b/src/sql/drivers/mysql/qsql_mysql.h deleted file mode 100644 index 953216de9a..0000000000 --- a/src/sql/drivers/mysql/qsql_mysql.h +++ /dev/null @@ -1,143 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSql module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSQL_MYSQL_H -#define QSQL_MYSQL_H - -#include -#include - -#if defined (Q_OS_WIN32) -#include -#endif - -#include - -#ifdef QT_PLUGIN -#define Q_EXPORT_SQLDRIVER_MYSQL -#else -#define Q_EXPORT_SQLDRIVER_MYSQL Q_SQL_EXPORT -#endif - -QT_BEGIN_NAMESPACE - -#if 0 -#pragma qt_no_master_include -#pragma qt_sync_stop_processing -#endif - -class QMYSQLDriverPrivate; -class QMYSQLResultPrivate; -class QMYSQLDriver; -class QSqlRecordInfo; - -class QMYSQLResult : public QSqlResult -{ - friend class QMYSQLDriver; - friend class QMYSQLResultPrivate; -public: - explicit QMYSQLResult(const QMYSQLDriver* db); - ~QMYSQLResult(); - - QVariant handle() const; -protected: - void cleanup(); - bool fetch(int i); - bool fetchNext(); - bool fetchLast(); - bool fetchFirst(); - QVariant data(int field); - bool isNull(int field); - bool reset (const QString& query); - int size(); - int numRowsAffected(); - QVariant lastInsertId() const; - QSqlRecord record() const; - void virtual_hook(int id, void *data); - bool nextResult(); - -#if MYSQL_VERSION_ID >= 40108 - bool prepare(const QString& stmt); - bool exec(); -#endif -private: - QMYSQLResultPrivate* d; -}; - -class Q_EXPORT_SQLDRIVER_MYSQL QMYSQLDriver : public QSqlDriver -{ - Q_OBJECT - friend class QMYSQLResult; -public: - explicit QMYSQLDriver(QObject *parent=0); - explicit QMYSQLDriver(MYSQL *con, QObject * parent=0); - ~QMYSQLDriver(); - bool hasFeature(DriverFeature f) const; - bool open(const QString & db, - const QString & user, - const QString & password, - const QString & host, - int port, - const QString& connOpts); - void close(); - QSqlResult *createResult() const; - QStringList tables(QSql::TableType) const; - QSqlIndex primaryIndex(const QString& tablename) const; - QSqlRecord record(const QString& tablename) const; - QString formatValue(const QSqlField &field, - bool trimStrings) const; - QVariant handle() const; - QString escapeIdentifier(const QString &identifier, IdentifierType type) const; - - bool isIdentifierEscaped(const QString &identifier, IdentifierType type) const; - -protected: - bool beginTransaction(); - bool commitTransaction(); - bool rollbackTransaction(); -private: - void init(); - QMYSQLDriverPrivate* d; -}; - -QT_END_NAMESPACE - -#endif // QSQL_MYSQL_H diff --git a/src/sql/drivers/mysql/qsql_mysql.pri b/src/sql/drivers/mysql/qsql_mysql.pri index 0423eb4ed9..50f49ca548 100644 --- a/src/sql/drivers/mysql/qsql_mysql.pri +++ b/src/sql/drivers/mysql/qsql_mysql.pri @@ -1,4 +1,4 @@ -HEADERS += $$PWD/qsql_mysql.h +HEADERS += $$PWD/qsql_mysql_p.h SOURCES += $$PWD/qsql_mysql.cpp !isEmpty(MYSQL_PATH) { diff --git a/src/sql/drivers/mysql/qsql_mysql_p.h b/src/sql/drivers/mysql/qsql_mysql_p.h new file mode 100644 index 0000000000..953216de9a --- /dev/null +++ b/src/sql/drivers/mysql/qsql_mysql_p.h @@ -0,0 +1,143 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSql module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSQL_MYSQL_H +#define QSQL_MYSQL_H + +#include +#include + +#if defined (Q_OS_WIN32) +#include +#endif + +#include + +#ifdef QT_PLUGIN +#define Q_EXPORT_SQLDRIVER_MYSQL +#else +#define Q_EXPORT_SQLDRIVER_MYSQL Q_SQL_EXPORT +#endif + +QT_BEGIN_NAMESPACE + +#if 0 +#pragma qt_no_master_include +#pragma qt_sync_stop_processing +#endif + +class QMYSQLDriverPrivate; +class QMYSQLResultPrivate; +class QMYSQLDriver; +class QSqlRecordInfo; + +class QMYSQLResult : public QSqlResult +{ + friend class QMYSQLDriver; + friend class QMYSQLResultPrivate; +public: + explicit QMYSQLResult(const QMYSQLDriver* db); + ~QMYSQLResult(); + + QVariant handle() const; +protected: + void cleanup(); + bool fetch(int i); + bool fetchNext(); + bool fetchLast(); + bool fetchFirst(); + QVariant data(int field); + bool isNull(int field); + bool reset (const QString& query); + int size(); + int numRowsAffected(); + QVariant lastInsertId() const; + QSqlRecord record() const; + void virtual_hook(int id, void *data); + bool nextResult(); + +#if MYSQL_VERSION_ID >= 40108 + bool prepare(const QString& stmt); + bool exec(); +#endif +private: + QMYSQLResultPrivate* d; +}; + +class Q_EXPORT_SQLDRIVER_MYSQL QMYSQLDriver : public QSqlDriver +{ + Q_OBJECT + friend class QMYSQLResult; +public: + explicit QMYSQLDriver(QObject *parent=0); + explicit QMYSQLDriver(MYSQL *con, QObject * parent=0); + ~QMYSQLDriver(); + bool hasFeature(DriverFeature f) const; + bool open(const QString & db, + const QString & user, + const QString & password, + const QString & host, + int port, + const QString& connOpts); + void close(); + QSqlResult *createResult() const; + QStringList tables(QSql::TableType) const; + QSqlIndex primaryIndex(const QString& tablename) const; + QSqlRecord record(const QString& tablename) const; + QString formatValue(const QSqlField &field, + bool trimStrings) const; + QVariant handle() const; + QString escapeIdentifier(const QString &identifier, IdentifierType type) const; + + bool isIdentifierEscaped(const QString &identifier, IdentifierType type) const; + +protected: + bool beginTransaction(); + bool commitTransaction(); + bool rollbackTransaction(); +private: + void init(); + QMYSQLDriverPrivate* d; +}; + +QT_END_NAMESPACE + +#endif // QSQL_MYSQL_H diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp index db73f8f6ea..8a6161d816 100644 --- a/src/sql/drivers/oci/qsql_oci.cpp +++ b/src/sql/drivers/oci/qsql_oci.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qsql_oci.h" +#include "qsql_oci_p.h" #include #include diff --git a/src/sql/drivers/oci/qsql_oci.h b/src/sql/drivers/oci/qsql_oci.h deleted file mode 100644 index 403de623ce..0000000000 --- a/src/sql/drivers/oci/qsql_oci.h +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSql module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSQL_OCI_H -#define QSQL_OCI_H - -#include -#include - -#ifdef QT_PLUGIN -#define Q_EXPORT_SQLDRIVER_OCI -#else -#define Q_EXPORT_SQLDRIVER_OCI Q_SQL_EXPORT -#endif - -typedef struct OCIEnv OCIEnv; -typedef struct OCISvcCtx OCISvcCtx; - -QT_BEGIN_NAMESPACE - -#if 0 -#pragma qt_no_master_include -#pragma qt_sync_stop_processing -#endif - -class QOCIDriver; -class QOCICols; -struct QOCIDriverPrivate; - -class Q_EXPORT_SQLDRIVER_OCI QOCIDriver : public QSqlDriver -{ - Q_OBJECT - friend struct QOCIResultPrivate; - friend class QOCIPrivate; -public: - explicit QOCIDriver(QObject* parent = 0); - QOCIDriver(OCIEnv* env, OCISvcCtx* ctx, QObject* parent = 0); - ~QOCIDriver(); - bool hasFeature(DriverFeature f) const; - bool open(const QString & db, - const QString & user, - const QString & password, - const QString & host, - int port, - const QString& connOpts); - void close(); - QSqlResult *createResult() const; - QStringList tables(QSql::TableType) const; - QSqlRecord record(const QString& tablename) const; - QSqlIndex primaryIndex(const QString& tablename) const; - QString formatValue(const QSqlField &field, - bool trimStrings) const; - QVariant handle() const; - QString escapeIdentifier(const QString &identifier, IdentifierType) const; - -protected: - bool beginTransaction(); - bool commitTransaction(); - bool rollbackTransaction(); -private: - QOCIDriverPrivate *d; -}; - -QT_END_NAMESPACE - -#endif // QSQL_OCI_H diff --git a/src/sql/drivers/oci/qsql_oci.pri b/src/sql/drivers/oci/qsql_oci.pri index 60ccc4c227..9108dbaa3c 100644 --- a/src/sql/drivers/oci/qsql_oci.pri +++ b/src/sql/drivers/oci/qsql_oci.pri @@ -1,4 +1,4 @@ -HEADERS += $$PWD/qsql_oci.h +HEADERS += $$PWD/qsql_oci_p.h SOURCES += $$PWD/qsql_oci.cpp unix { diff --git a/src/sql/drivers/oci/qsql_oci_p.h b/src/sql/drivers/oci/qsql_oci_p.h new file mode 100644 index 0000000000..403de623ce --- /dev/null +++ b/src/sql/drivers/oci/qsql_oci_p.h @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSql module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSQL_OCI_H +#define QSQL_OCI_H + +#include +#include + +#ifdef QT_PLUGIN +#define Q_EXPORT_SQLDRIVER_OCI +#else +#define Q_EXPORT_SQLDRIVER_OCI Q_SQL_EXPORT +#endif + +typedef struct OCIEnv OCIEnv; +typedef struct OCISvcCtx OCISvcCtx; + +QT_BEGIN_NAMESPACE + +#if 0 +#pragma qt_no_master_include +#pragma qt_sync_stop_processing +#endif + +class QOCIDriver; +class QOCICols; +struct QOCIDriverPrivate; + +class Q_EXPORT_SQLDRIVER_OCI QOCIDriver : public QSqlDriver +{ + Q_OBJECT + friend struct QOCIResultPrivate; + friend class QOCIPrivate; +public: + explicit QOCIDriver(QObject* parent = 0); + QOCIDriver(OCIEnv* env, OCISvcCtx* ctx, QObject* parent = 0); + ~QOCIDriver(); + bool hasFeature(DriverFeature f) const; + bool open(const QString & db, + const QString & user, + const QString & password, + const QString & host, + int port, + const QString& connOpts); + void close(); + QSqlResult *createResult() const; + QStringList tables(QSql::TableType) const; + QSqlRecord record(const QString& tablename) const; + QSqlIndex primaryIndex(const QString& tablename) const; + QString formatValue(const QSqlField &field, + bool trimStrings) const; + QVariant handle() const; + QString escapeIdentifier(const QString &identifier, IdentifierType) const; + +protected: + bool beginTransaction(); + bool commitTransaction(); + bool rollbackTransaction(); +private: + QOCIDriverPrivate *d; +}; + +QT_END_NAMESPACE + +#endif // QSQL_OCI_H diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index 9517d95fc4..a52e3ee451 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qsql_odbc.h" +#include "qsql_odbc_p.h" #include #if defined (Q_OS_WIN32) diff --git a/src/sql/drivers/odbc/qsql_odbc.h b/src/sql/drivers/odbc/qsql_odbc.h deleted file mode 100644 index 26f47e6c74..0000000000 --- a/src/sql/drivers/odbc/qsql_odbc.h +++ /dev/null @@ -1,159 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSql module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSQL_ODBC_H -#define QSQL_ODBC_H - -#include -#include - -#if defined (Q_OS_WIN32) -#include -#endif - -#ifdef QT_PLUGIN -#define Q_EXPORT_SQLDRIVER_ODBC -#else -#define Q_EXPORT_SQLDRIVER_ODBC Q_SQL_EXPORT -#endif - -#ifdef Q_OS_UNIX -#define HAVE_LONG_LONG 1 // force UnixODBC NOT to fall back to a struct for BIGINTs -#endif - -#if defined(Q_CC_BOR) -// workaround for Borland to make sure that SQLBIGINT is defined -# define _MSC_VER 900 -#endif -#include -#if defined(Q_CC_BOR) -# undef _MSC_VER -#endif - -#include - -QT_BEGIN_NAMESPACE - -#if 0 -#pragma qt_no_master_include -#pragma qt_sync_stop_processing -#endif - -class QODBCPrivate; -class QODBCDriverPrivate; -class QODBCDriver; -class QSqlRecordInfo; - -class QODBCResult : public QSqlResult -{ -public: - QODBCResult(const QODBCDriver * db, QODBCDriverPrivate* p); - virtual ~QODBCResult(); - - bool prepare(const QString& query); - bool exec(); - - QVariant handle() const; - virtual void setForwardOnly(bool forward); - -protected: - bool fetchNext(); - bool fetchFirst(); - bool fetchLast(); - bool fetchPrevious(); - bool fetch(int i); - bool reset (const QString& query); - QVariant data(int field); - bool isNull(int field); - int size(); - int numRowsAffected(); - QSqlRecord record() const; - void virtual_hook(int id, void *data); - void detachFromResultSet(); - bool nextResult(); - -private: - QODBCPrivate *d; -}; - -class Q_EXPORT_SQLDRIVER_ODBC QODBCDriver : public QSqlDriver -{ - Q_OBJECT -public: - explicit QODBCDriver(QObject *parent=0); - QODBCDriver(SQLHANDLE env, SQLHANDLE con, QObject * parent=0); - virtual ~QODBCDriver(); - bool hasFeature(DriverFeature f) const; - void close(); - QSqlResult *createResult() const; - QStringList tables(QSql::TableType) const; - QSqlRecord record(const QString& tablename) const; - QSqlIndex primaryIndex(const QString& tablename) const; - QVariant handle() const; - QString formatValue(const QSqlField &field, - bool trimStrings) const; - bool open(const QString& db, - const QString& user, - const QString& password, - const QString& host, - int port, - const QString& connOpts); - - QString escapeIdentifier(const QString &identifier, IdentifierType type) const; - - bool isIdentifierEscaped(const QString &identifier, IdentifierType type) const; - -protected: - bool beginTransaction(); - bool commitTransaction(); - bool rollbackTransaction(); - -private: - void init(); - bool endTrans(); - void cleanup(); - QODBCDriverPrivate* d; - friend class QODBCPrivate; -}; - -QT_END_NAMESPACE - -#endif // QSQL_ODBC_H diff --git a/src/sql/drivers/odbc/qsql_odbc.pri b/src/sql/drivers/odbc/qsql_odbc.pri index 19ff784a04..b206df37c3 100644 --- a/src/sql/drivers/odbc/qsql_odbc.pri +++ b/src/sql/drivers/odbc/qsql_odbc.pri @@ -1,4 +1,4 @@ -HEADERS += $$PWD/qsql_odbc.h +HEADERS += $$PWD/qsql_odbc_p.h SOURCES += $$PWD/qsql_odbc.cpp unix { diff --git a/src/sql/drivers/odbc/qsql_odbc_p.h b/src/sql/drivers/odbc/qsql_odbc_p.h new file mode 100644 index 0000000000..26f47e6c74 --- /dev/null +++ b/src/sql/drivers/odbc/qsql_odbc_p.h @@ -0,0 +1,159 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSql module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSQL_ODBC_H +#define QSQL_ODBC_H + +#include +#include + +#if defined (Q_OS_WIN32) +#include +#endif + +#ifdef QT_PLUGIN +#define Q_EXPORT_SQLDRIVER_ODBC +#else +#define Q_EXPORT_SQLDRIVER_ODBC Q_SQL_EXPORT +#endif + +#ifdef Q_OS_UNIX +#define HAVE_LONG_LONG 1 // force UnixODBC NOT to fall back to a struct for BIGINTs +#endif + +#if defined(Q_CC_BOR) +// workaround for Borland to make sure that SQLBIGINT is defined +# define _MSC_VER 900 +#endif +#include +#if defined(Q_CC_BOR) +# undef _MSC_VER +#endif + +#include + +QT_BEGIN_NAMESPACE + +#if 0 +#pragma qt_no_master_include +#pragma qt_sync_stop_processing +#endif + +class QODBCPrivate; +class QODBCDriverPrivate; +class QODBCDriver; +class QSqlRecordInfo; + +class QODBCResult : public QSqlResult +{ +public: + QODBCResult(const QODBCDriver * db, QODBCDriverPrivate* p); + virtual ~QODBCResult(); + + bool prepare(const QString& query); + bool exec(); + + QVariant handle() const; + virtual void setForwardOnly(bool forward); + +protected: + bool fetchNext(); + bool fetchFirst(); + bool fetchLast(); + bool fetchPrevious(); + bool fetch(int i); + bool reset (const QString& query); + QVariant data(int field); + bool isNull(int field); + int size(); + int numRowsAffected(); + QSqlRecord record() const; + void virtual_hook(int id, void *data); + void detachFromResultSet(); + bool nextResult(); + +private: + QODBCPrivate *d; +}; + +class Q_EXPORT_SQLDRIVER_ODBC QODBCDriver : public QSqlDriver +{ + Q_OBJECT +public: + explicit QODBCDriver(QObject *parent=0); + QODBCDriver(SQLHANDLE env, SQLHANDLE con, QObject * parent=0); + virtual ~QODBCDriver(); + bool hasFeature(DriverFeature f) const; + void close(); + QSqlResult *createResult() const; + QStringList tables(QSql::TableType) const; + QSqlRecord record(const QString& tablename) const; + QSqlIndex primaryIndex(const QString& tablename) const; + QVariant handle() const; + QString formatValue(const QSqlField &field, + bool trimStrings) const; + bool open(const QString& db, + const QString& user, + const QString& password, + const QString& host, + int port, + const QString& connOpts); + + QString escapeIdentifier(const QString &identifier, IdentifierType type) const; + + bool isIdentifierEscaped(const QString &identifier, IdentifierType type) const; + +protected: + bool beginTransaction(); + bool commitTransaction(); + bool rollbackTransaction(); + +private: + void init(); + bool endTrans(); + void cleanup(); + QODBCDriverPrivate* d; + friend class QODBCPrivate; +}; + +QT_END_NAMESPACE + +#endif // QSQL_ODBC_H diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp index 0eadceb1d1..95fcba4172 100644 --- a/src/sql/drivers/psql/qsql_psql.cpp +++ b/src/sql/drivers/psql/qsql_psql.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qsql_psql.h" +#include "qsql_psql_p.h" #include #include diff --git a/src/sql/drivers/psql/qsql_psql.h b/src/sql/drivers/psql/qsql_psql.h deleted file mode 100644 index d5585a45fa..0000000000 --- a/src/sql/drivers/psql/qsql_psql.h +++ /dev/null @@ -1,159 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSql module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSQL_PSQL_H -#define QSQL_PSQL_H - -#include -#include - -#ifdef QT_PLUGIN -#define Q_EXPORT_SQLDRIVER_PSQL -#else -#define Q_EXPORT_SQLDRIVER_PSQL Q_SQL_EXPORT -#endif - -typedef struct pg_conn PGconn; -typedef struct pg_result PGresult; - -QT_BEGIN_NAMESPACE - -#if 0 -#pragma qt_no_master_include -#pragma qt_sync_stop_processing -#endif - -class QPSQLResultPrivate; -class QPSQLDriverPrivate; -class QPSQLDriver; -class QSqlRecordInfo; - -class QPSQLResult : public QSqlResult -{ - friend class QPSQLResultPrivate; -public: - QPSQLResult(const QPSQLDriver* db, const QPSQLDriverPrivate* p); - ~QPSQLResult(); - - QVariant handle() const; - void virtual_hook(int id, void *data); - -protected: - void cleanup(); - bool fetch(int i); - bool fetchFirst(); - bool fetchLast(); - QVariant data(int i); - bool isNull(int field); - bool reset (const QString& query); - int size(); - int numRowsAffected(); - QSqlRecord record() const; - QVariant lastInsertId() const; - bool prepare(const QString& query); - bool exec(); - -private: - QPSQLResultPrivate *d; -}; - -class Q_EXPORT_SQLDRIVER_PSQL QPSQLDriver : public QSqlDriver -{ - Q_OBJECT -public: - enum Protocol { - VersionUnknown = -1, - Version6 = 6, - Version7 = 7, - Version71 = 8, - Version73 = 9, - Version74 = 10, - Version8 = 11, - Version81 = 12, - Version82 = 13, - Version83 = 14, - Version84 = 15, - Version9 = 16, - }; - - explicit QPSQLDriver(QObject *parent=0); - explicit QPSQLDriver(PGconn *conn, QObject *parent=0); - ~QPSQLDriver(); - bool hasFeature(DriverFeature f) const; - bool open(const QString & db, - const QString & user, - const QString & password, - const QString & host, - int port, - const QString& connOpts); - bool isOpen() const; - void close(); - QSqlResult *createResult() const; - QStringList tables(QSql::TableType) const; - QSqlIndex primaryIndex(const QString& tablename) const; - QSqlRecord record(const QString& tablename) const; - - Protocol protocol() const; - QVariant handle() const; - - QString escapeIdentifier(const QString &identifier, IdentifierType type) const; - QString formatValue(const QSqlField &field, bool trimStrings) const; - - bool subscribeToNotification(const QString &name); - bool unsubscribeFromNotification(const QString &name); - QStringList subscribedToNotifications() const; - -protected: - bool beginTransaction(); - bool commitTransaction(); - bool rollbackTransaction(); - -private Q_SLOTS: - void _q_handleNotification(int); - -private: - void init(); - QPSQLDriverPrivate *d; -}; - -QT_END_NAMESPACE - -#endif // QSQL_PSQL_H diff --git a/src/sql/drivers/psql/qsql_psql.pri b/src/sql/drivers/psql/qsql_psql.pri index 9b647d8200..d0ded5e625 100644 --- a/src/sql/drivers/psql/qsql_psql.pri +++ b/src/sql/drivers/psql/qsql_psql.pri @@ -1,4 +1,4 @@ -HEADERS += $$PWD/qsql_psql.h +HEADERS += $$PWD/qsql_psql_p.h SOURCES += $$PWD/qsql_psql.cpp unix|win32-g++* { diff --git a/src/sql/drivers/psql/qsql_psql_p.h b/src/sql/drivers/psql/qsql_psql_p.h new file mode 100644 index 0000000000..d5585a45fa --- /dev/null +++ b/src/sql/drivers/psql/qsql_psql_p.h @@ -0,0 +1,159 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSql module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSQL_PSQL_H +#define QSQL_PSQL_H + +#include +#include + +#ifdef QT_PLUGIN +#define Q_EXPORT_SQLDRIVER_PSQL +#else +#define Q_EXPORT_SQLDRIVER_PSQL Q_SQL_EXPORT +#endif + +typedef struct pg_conn PGconn; +typedef struct pg_result PGresult; + +QT_BEGIN_NAMESPACE + +#if 0 +#pragma qt_no_master_include +#pragma qt_sync_stop_processing +#endif + +class QPSQLResultPrivate; +class QPSQLDriverPrivate; +class QPSQLDriver; +class QSqlRecordInfo; + +class QPSQLResult : public QSqlResult +{ + friend class QPSQLResultPrivate; +public: + QPSQLResult(const QPSQLDriver* db, const QPSQLDriverPrivate* p); + ~QPSQLResult(); + + QVariant handle() const; + void virtual_hook(int id, void *data); + +protected: + void cleanup(); + bool fetch(int i); + bool fetchFirst(); + bool fetchLast(); + QVariant data(int i); + bool isNull(int field); + bool reset (const QString& query); + int size(); + int numRowsAffected(); + QSqlRecord record() const; + QVariant lastInsertId() const; + bool prepare(const QString& query); + bool exec(); + +private: + QPSQLResultPrivate *d; +}; + +class Q_EXPORT_SQLDRIVER_PSQL QPSQLDriver : public QSqlDriver +{ + Q_OBJECT +public: + enum Protocol { + VersionUnknown = -1, + Version6 = 6, + Version7 = 7, + Version71 = 8, + Version73 = 9, + Version74 = 10, + Version8 = 11, + Version81 = 12, + Version82 = 13, + Version83 = 14, + Version84 = 15, + Version9 = 16, + }; + + explicit QPSQLDriver(QObject *parent=0); + explicit QPSQLDriver(PGconn *conn, QObject *parent=0); + ~QPSQLDriver(); + bool hasFeature(DriverFeature f) const; + bool open(const QString & db, + const QString & user, + const QString & password, + const QString & host, + int port, + const QString& connOpts); + bool isOpen() const; + void close(); + QSqlResult *createResult() const; + QStringList tables(QSql::TableType) const; + QSqlIndex primaryIndex(const QString& tablename) const; + QSqlRecord record(const QString& tablename) const; + + Protocol protocol() const; + QVariant handle() const; + + QString escapeIdentifier(const QString &identifier, IdentifierType type) const; + QString formatValue(const QSqlField &field, bool trimStrings) const; + + bool subscribeToNotification(const QString &name); + bool unsubscribeFromNotification(const QString &name); + QStringList subscribedToNotifications() const; + +protected: + bool beginTransaction(); + bool commitTransaction(); + bool rollbackTransaction(); + +private Q_SLOTS: + void _q_handleNotification(int); + +private: + void init(); + QPSQLDriverPrivate *d; +}; + +QT_END_NAMESPACE + +#endif // QSQL_PSQL_H diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp index d884bb7b11..483c640b43 100644 --- a/src/sql/drivers/sqlite/qsql_sqlite.cpp +++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qsql_sqlite.h" +#include "qsql_sqlite_p.h" #include #include diff --git a/src/sql/drivers/sqlite/qsql_sqlite.h b/src/sql/drivers/sqlite/qsql_sqlite.h deleted file mode 100644 index bd034b4d6b..0000000000 --- a/src/sql/drivers/sqlite/qsql_sqlite.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSql module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSQL_SQLITE_H -#define QSQL_SQLITE_H - -#include -#include - -struct sqlite3; - -#ifdef QT_PLUGIN -#define Q_EXPORT_SQLDRIVER_SQLITE -#else -#define Q_EXPORT_SQLDRIVER_SQLITE Q_SQL_EXPORT -#endif - -QT_BEGIN_NAMESPACE - -#if 0 -#pragma qt_no_master_include -#pragma qt_sync_stop_processing -#endif - -class QSQLiteDriverPrivate; -class QSQLiteDriver; - -class Q_EXPORT_SQLDRIVER_SQLITE QSQLiteDriver : public QSqlDriver -{ - Q_OBJECT - friend class QSQLiteResult; -public: - explicit QSQLiteDriver(QObject *parent = 0); - explicit QSQLiteDriver(sqlite3 *connection, QObject *parent = 0); - ~QSQLiteDriver(); - bool hasFeature(DriverFeature f) const; - bool open(const QString & db, - const QString & user, - const QString & password, - const QString & host, - int port, - const QString & connOpts); - void close(); - QSqlResult *createResult() const; - bool beginTransaction(); - bool commitTransaction(); - bool rollbackTransaction(); - QStringList tables(QSql::TableType) const; - - QSqlRecord record(const QString& tablename) const; - QSqlIndex primaryIndex(const QString &table) const; - QVariant handle() const; - QString escapeIdentifier(const QString &identifier, IdentifierType) const; - -private: - QSQLiteDriverPrivate* d; -}; - -QT_END_NAMESPACE - -#endif // QSQL_SQLITE_H diff --git a/src/sql/drivers/sqlite/qsql_sqlite.pri b/src/sql/drivers/sqlite/qsql_sqlite.pri index a2e80d4c74..e323f2eba5 100644 --- a/src/sql/drivers/sqlite/qsql_sqlite.pri +++ b/src/sql/drivers/sqlite/qsql_sqlite.pri @@ -1,4 +1,4 @@ -HEADERS += $$PWD/qsql_sqlite.h +HEADERS += $$PWD/qsql_sqlite_p.h SOURCES += $$PWD/qsql_sqlite.cpp !system-sqlite:!contains(LIBS, .*sqlite3.*) { diff --git a/src/sql/drivers/sqlite/qsql_sqlite_p.h b/src/sql/drivers/sqlite/qsql_sqlite_p.h new file mode 100644 index 0000000000..bd034b4d6b --- /dev/null +++ b/src/sql/drivers/sqlite/qsql_sqlite_p.h @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSql module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSQL_SQLITE_H +#define QSQL_SQLITE_H + +#include +#include + +struct sqlite3; + +#ifdef QT_PLUGIN +#define Q_EXPORT_SQLDRIVER_SQLITE +#else +#define Q_EXPORT_SQLDRIVER_SQLITE Q_SQL_EXPORT +#endif + +QT_BEGIN_NAMESPACE + +#if 0 +#pragma qt_no_master_include +#pragma qt_sync_stop_processing +#endif + +class QSQLiteDriverPrivate; +class QSQLiteDriver; + +class Q_EXPORT_SQLDRIVER_SQLITE QSQLiteDriver : public QSqlDriver +{ + Q_OBJECT + friend class QSQLiteResult; +public: + explicit QSQLiteDriver(QObject *parent = 0); + explicit QSQLiteDriver(sqlite3 *connection, QObject *parent = 0); + ~QSQLiteDriver(); + bool hasFeature(DriverFeature f) const; + bool open(const QString & db, + const QString & user, + const QString & password, + const QString & host, + int port, + const QString & connOpts); + void close(); + QSqlResult *createResult() const; + bool beginTransaction(); + bool commitTransaction(); + bool rollbackTransaction(); + QStringList tables(QSql::TableType) const; + + QSqlRecord record(const QString& tablename) const; + QSqlIndex primaryIndex(const QString &table) const; + QVariant handle() const; + QString escapeIdentifier(const QString &identifier, IdentifierType) const; + +private: + QSQLiteDriverPrivate* d; +}; + +QT_END_NAMESPACE + +#endif // QSQL_SQLITE_H diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2.cpp b/src/sql/drivers/sqlite2/qsql_sqlite2.cpp index 2666cefb72..a85a120973 100644 --- a/src/sql/drivers/sqlite2/qsql_sqlite2.cpp +++ b/src/sql/drivers/sqlite2/qsql_sqlite2.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qsql_sqlite2.h" +#include "qsql_sqlite2_p.h" #include #include diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2.h b/src/sql/drivers/sqlite2/qsql_sqlite2.h deleted file mode 100644 index c6a8c4cf4f..0000000000 --- a/src/sql/drivers/sqlite2/qsql_sqlite2.h +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSql module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSQL_SQLITE2_H -#define QSQL_SQLITE2_H - -#include -#include -#include -#include - -#if defined (Q_OS_WIN32) -# include -#endif - -struct sqlite; - -QT_BEGIN_NAMESPACE - -#if 0 -#pragma qt_no_master_include -#pragma qt_sync_stop_processing -#endif - -class QSQLite2DriverPrivate; -class QSQLite2Driver; - -class QSQLite2Driver : public QSqlDriver -{ - Q_OBJECT - friend class QSQLite2Result; -public: - explicit QSQLite2Driver(QObject *parent = 0); - explicit QSQLite2Driver(sqlite *connection, QObject *parent = 0); - ~QSQLite2Driver(); - bool hasFeature(DriverFeature f) const; - bool open(const QString & db, - const QString & user, - const QString & password, - const QString & host, - int port, - const QString & connOpts); - bool open(const QString & db, - const QString & user, - const QString & password, - const QString & host, - int port) { return open (db, user, password, host, port, QString()); } - void close(); - QSqlResult *createResult() const; - bool beginTransaction(); - bool commitTransaction(); - bool rollbackTransaction(); - QStringList tables(QSql::TableType) const; - - QSqlRecord record(const QString& tablename) const; - QSqlIndex primaryIndex(const QString &table) const; - QVariant handle() const; - QString escapeIdentifier(const QString &identifier, IdentifierType) const; - -private: - QSQLite2DriverPrivate* d; -}; - -QT_END_NAMESPACE - -#endif // QSQL_SQLITE2_H diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2.pri b/src/sql/drivers/sqlite2/qsql_sqlite2.pri index 9a9f6cdf9e..5baba30db0 100644 --- a/src/sql/drivers/sqlite2/qsql_sqlite2.pri +++ b/src/sql/drivers/sqlite2/qsql_sqlite2.pri @@ -1,4 +1,4 @@ -HEADERS += $$PWD/qsql_sqlite2.h +HEADERS += $$PWD/qsql_sqlite2_p.h SOURCES += $$PWD/qsql_sqlite2.cpp !contains(LIBS, .*sqlite.*):LIBS += -lsqlite diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2_p.h b/src/sql/drivers/sqlite2/qsql_sqlite2_p.h new file mode 100644 index 0000000000..c6a8c4cf4f --- /dev/null +++ b/src/sql/drivers/sqlite2/qsql_sqlite2_p.h @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSql module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSQL_SQLITE2_H +#define QSQL_SQLITE2_H + +#include +#include +#include +#include + +#if defined (Q_OS_WIN32) +# include +#endif + +struct sqlite; + +QT_BEGIN_NAMESPACE + +#if 0 +#pragma qt_no_master_include +#pragma qt_sync_stop_processing +#endif + +class QSQLite2DriverPrivate; +class QSQLite2Driver; + +class QSQLite2Driver : public QSqlDriver +{ + Q_OBJECT + friend class QSQLite2Result; +public: + explicit QSQLite2Driver(QObject *parent = 0); + explicit QSQLite2Driver(sqlite *connection, QObject *parent = 0); + ~QSQLite2Driver(); + bool hasFeature(DriverFeature f) const; + bool open(const QString & db, + const QString & user, + const QString & password, + const QString & host, + int port, + const QString & connOpts); + bool open(const QString & db, + const QString & user, + const QString & password, + const QString & host, + int port) { return open (db, user, password, host, port, QString()); } + void close(); + QSqlResult *createResult() const; + bool beginTransaction(); + bool commitTransaction(); + bool rollbackTransaction(); + QStringList tables(QSql::TableType) const; + + QSqlRecord record(const QString& tablename) const; + QSqlIndex primaryIndex(const QString &table) const; + QVariant handle() const; + QString escapeIdentifier(const QString &identifier, IdentifierType) const; + +private: + QSQLite2DriverPrivate* d; +}; + +QT_END_NAMESPACE + +#endif // QSQL_SQLITE2_H diff --git a/src/sql/drivers/tds/qsql_tds.cpp b/src/sql/drivers/tds/qsql_tds.cpp index 22773b8eff..996a1bdd1a 100644 --- a/src/sql/drivers/tds/qsql_tds.cpp +++ b/src/sql/drivers/tds/qsql_tds.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qsql_tds.h" +#include "qsql_tds_p.h" #include #ifdef Q_OS_WIN32 // We assume that MS SQL Server is used. Set Q_USE_SYBASE to force Sybase. diff --git a/src/sql/drivers/tds/qsql_tds.h b/src/sql/drivers/tds/qsql_tds.h deleted file mode 100644 index 2bbdd0e49c..0000000000 --- a/src/sql/drivers/tds/qsql_tds.h +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtSql module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSQL_TDS_H -#define QSQL_TDS_H - -#include -#include - -#ifdef Q_OS_WIN32 -#define WIN32_LEAN_AND_MEAN -#ifndef Q_USE_SYBASE -#define DBNTWIN32 // indicates 32bit windows dblib -#endif -#include -#include -#include -#include -#define CS_PUBLIC -#else -#include -#include -#endif //Q_OS_WIN32 - -#ifdef QT_PLUGIN -#define Q_EXPORT_SQLDRIVER_TDS -#else -#define Q_EXPORT_SQLDRIVER_TDS Q_SQL_EXPORT -#endif - -QT_BEGIN_NAMESPACE - -#if 0 -#pragma qt_no_master_include -#pragma qt_sync_stop_processing -#endif - -class QTDSDriverPrivate; -class QTDSDriver; - -class Q_EXPORT_SQLDRIVER_TDS QTDSDriver : public QSqlDriver -{ - Q_OBJECT - friend class QTDSResult; -public: - explicit QTDSDriver(QObject* parent = 0); - QTDSDriver(LOGINREC* rec, const QString& host, const QString &db, QObject* parent = 0); - ~QTDSDriver(); - bool hasFeature(DriverFeature f) const; - bool open(const QString & db, - const QString & user, - const QString & password, - const QString & host, - int port, - const QString& connOpts); - void close(); - QStringList tables(QSql::TableType) const; - QSqlResult *createResult() const; - QSqlRecord record(const QString& tablename) const; - QSqlIndex primaryIndex(const QString& tablename) const; - - QString formatValue(const QSqlField &field, - bool trimStrings) const; - QVariant handle() const; - - QString escapeIdentifier(const QString &identifier, IdentifierType type) const; - -protected: - bool beginTransaction(); - bool commitTransaction(); - bool rollbackTransaction(); -private: - void init(); - QTDSDriverPrivate *d; -}; - -QT_END_NAMESPACE - -#endif // QSQL_TDS_H diff --git a/src/sql/drivers/tds/qsql_tds.pri b/src/sql/drivers/tds/qsql_tds.pri index 38aab2f3e4..67d037aa6b 100644 --- a/src/sql/drivers/tds/qsql_tds.pri +++ b/src/sql/drivers/tds/qsql_tds.pri @@ -1,4 +1,4 @@ -HEADERS += $$PWD/qsql_tds.h +HEADERS += $$PWD/qsql_tds_p.h SOURCES += $$PWD/qsql_tds.cpp unix|win32-g++*: { diff --git a/src/sql/drivers/tds/qsql_tds_p.h b/src/sql/drivers/tds/qsql_tds_p.h new file mode 100644 index 0000000000..2bbdd0e49c --- /dev/null +++ b/src/sql/drivers/tds/qsql_tds_p.h @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtSql module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSQL_TDS_H +#define QSQL_TDS_H + +#include +#include + +#ifdef Q_OS_WIN32 +#define WIN32_LEAN_AND_MEAN +#ifndef Q_USE_SYBASE +#define DBNTWIN32 // indicates 32bit windows dblib +#endif +#include +#include +#include +#include +#define CS_PUBLIC +#else +#include +#include +#endif //Q_OS_WIN32 + +#ifdef QT_PLUGIN +#define Q_EXPORT_SQLDRIVER_TDS +#else +#define Q_EXPORT_SQLDRIVER_TDS Q_SQL_EXPORT +#endif + +QT_BEGIN_NAMESPACE + +#if 0 +#pragma qt_no_master_include +#pragma qt_sync_stop_processing +#endif + +class QTDSDriverPrivate; +class QTDSDriver; + +class Q_EXPORT_SQLDRIVER_TDS QTDSDriver : public QSqlDriver +{ + Q_OBJECT + friend class QTDSResult; +public: + explicit QTDSDriver(QObject* parent = 0); + QTDSDriver(LOGINREC* rec, const QString& host, const QString &db, QObject* parent = 0); + ~QTDSDriver(); + bool hasFeature(DriverFeature f) const; + bool open(const QString & db, + const QString & user, + const QString & password, + const QString & host, + int port, + const QString& connOpts); + void close(); + QStringList tables(QSql::TableType) const; + QSqlResult *createResult() const; + QSqlRecord record(const QString& tablename) const; + QSqlIndex primaryIndex(const QString& tablename) const; + + QString formatValue(const QSqlField &field, + bool trimStrings) const; + QVariant handle() const; + + QString escapeIdentifier(const QString &identifier, IdentifierType type) const; + +protected: + bool beginTransaction(); + bool commitTransaction(); + bool rollbackTransaction(); +private: + void init(); + QTDSDriverPrivate *d; +}; + +QT_END_NAMESPACE + +#endif // QSQL_TDS_H diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp index 36422f5f62..0ca79fd39f 100644 --- a/src/sql/kernel/qsqldatabase.cpp +++ b/src/sql/kernel/qsqldatabase.cpp @@ -48,31 +48,31 @@ #endif #ifdef QT_SQL_PSQL -#include "../drivers/psql/qsql_psql.h" +#include "../drivers/psql/qsql_psql_p.h" #endif #ifdef QT_SQL_MYSQL -#include "../drivers/mysql/qsql_mysql.h" +#include "../drivers/mysql/qsql_mysql_p.h" #endif #ifdef QT_SQL_ODBC -#include "../drivers/odbc/qsql_odbc.h" +#include "../drivers/odbc/qsql_odbc_p.h" #endif #ifdef QT_SQL_OCI -#include "../drivers/oci/qsql_oci.h" +#include "../drivers/oci/qsql_oci_p.h" #endif #ifdef QT_SQL_TDS // conflicting RETCODE typedef between odbc and freetds #define RETCODE DBRETCODE -#include "../drivers/tds/qsql_tds.h" +#include "../drivers/tds/qsql_tds_p.h" #undef RETCODE #endif #ifdef QT_SQL_DB2 -#include "../drivers/db2/qsql_db2.h" +#include "../drivers/db2/qsql_db2_p.h" #endif #ifdef QT_SQL_SQLITE -#include "../drivers/sqlite/qsql_sqlite.h" +#include "../drivers/sqlite/qsql_sqlite_p.h" #endif #ifdef QT_SQL_SQLITE2 -#include "../drivers/sqlite2/qsql_sqlite2.h" +#include "../drivers/sqlite2/qsql_sqlite2_p.h" #endif #ifdef QT_SQL_IBASE #undef SQL_FLOAT // avoid clash with ODBC @@ -82,7 +82,7 @@ #undef SQL_TYPE_DATE #undef SQL_DATE #define SCHAR IBASE_SCHAR // avoid clash with ODBC (older versions of ibase.h with Firebird) -#include "../drivers/ibase/qsql_ibase.h" +#include "../drivers/ibase/qsql_ibase_p.h" #undef SCHAR #endif diff --git a/src/tools/uic/qclass_lib_map.h b/src/tools/uic/qclass_lib_map.h index c4d4d840a6..075b2d52e8 100644 --- a/src/tools/uic/qclass_lib_map.h +++ b/src/tools/uic/qclass_lib_map.h @@ -556,24 +556,6 @@ QT_CLASS_LIB(QSqlRelationalDelegate, QtSql, qsqlrelationaldelegate.h) QT_CLASS_LIB(QSqlRelation, QtSql, qsqlrelationaltablemodel.h) QT_CLASS_LIB(QSqlRelationalTableModel, QtSql, qsqlrelationaltablemodel.h) QT_CLASS_LIB(QSqlTableModel, QtSql, qsqltablemodel.h) -QT_CLASS_LIB(QDB2Result, QtSql, qsql_db2.h) -QT_CLASS_LIB(QDB2Driver, QtSql, qsql_db2.h) -QT_CLASS_LIB(QIBaseResult, QtSql, qsql_ibase.h) -QT_CLASS_LIB(QIBaseDriver, QtSql, qsql_ibase.h) -QT_CLASS_LIB(QMYSQLResult, QtSql, qsql_mysql.h) -QT_CLASS_LIB(QMYSQLDriver, QtSql, qsql_mysql.h) -QT_CLASS_LIB(QOCIResult, QtSql, qsql_oci.h) -QT_CLASS_LIB(QOCIDriver, QtSql, qsql_oci.h) -QT_CLASS_LIB(QODBCResult, QtSql, qsql_odbc.h) -QT_CLASS_LIB(QODBCDriver, QtSql, qsql_odbc.h) -QT_CLASS_LIB(QPSQLResult, QtSql, qsql_psql.h) -QT_CLASS_LIB(QPSQLDriver, QtSql, qsql_psql.h) -QT_CLASS_LIB(QSQLiteResult, QtSql, qsql_sqlite.h) -QT_CLASS_LIB(QSQLiteDriver, QtSql, qsql_sqlite.h) -QT_CLASS_LIB(QSQLite2Result, QtSql, qsql_sqlite2.h) -QT_CLASS_LIB(QSQLite2Driver, QtSql, qsql_sqlite2.h) -QT_CLASS_LIB(QTDSResult, QtSql, qsql_tds.h) -QT_CLASS_LIB(QTDSDriver, QtSql, qsql_tds.h) QT_CLASS_LIB(QAccessible, QtWidgets, qaccessible.h) QT_CLASS_LIB(QAccessibleInterface, QtWidgets, qaccessible.h) QT_CLASS_LIB(QAccessibleInterfaceEx, QtWidgets, qaccessible.h) -- cgit v1.2.3