File indexing completed on 2024-04-21 15:29:52

0001 /* This file is part of the KDE project
0002    Copyright (C) 2008 Sharan Rao <sharanrao@gmail.com>
0003 
0004    This program is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU Library General Public
0006    License as published by the Free Software Foundation; either
0007    version 2 of the License, or (at your option) any later version.
0008 
0009    This program is distributed in the hope that it will be useful,
0010    but WITHOUT ANY WARRANTY; without even the implied warranty of
0011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012    Library General Public License for more details.
0013 
0014    You should have received a copy of the GNU Library General Public License
0015    along with this program; see the file COPYING.  If not, write to
0016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018 */
0019 
0020 #ifndef KDB_XBASECLIENT_P_H
0021 #define KDB_XBASECLIENT_P_H
0022 
0023 #include <QPointer>
0024 
0025 #include "KDbConnection_p.h"
0026 
0027 class KDbConnectionData;
0028 
0029 //! Internal xBase connection data.
0030 /*! Provides a low-level API for accessing xBase databases, that can
0031 be shared by any module that needs direct access to the underlying
0032 database.  Used by the KDb drivers.
0033 */
0034 class xBaseConnectionInternal : public KDbConnectionInternal
0035 {
0036   public:
0037     xBaseConnectionInternal(KDbConnection* connection, KDbDriver* internalDriver);
0038     virtual ~xBaseConnectionInternal();
0039 
0040     //! Connects to a xBase database
0041     bool db_connect(const KDbConnectionData& data);
0042 
0043     //! Disconnects from the database
0044     bool db_disconnect(const KDbConnectionData& data);
0045 
0046     //! Selects a database that is about to be used
0047     bool useDatabase(const QString &dbName = QString());
0048 
0049     //! Execute SQL statement on the database
0050     bool executeSql(const KDbEscapedString& sql);
0051 
0052     //! Stores last operation's result
0053     virtual void storeResult();
0054 
0055     QPointer<KDbDriver> internalDriver;
0056     QPointer<KDbConnection> internalConn;
0057     QString tempDatabase;
0058 
0059     QHash<QString,QString> dbMap;
0060 
0061     QString errmsg; //!< server-specific message of last operation
0062     int res; //!< result code of last operation on server
0063 };
0064 
0065 #endif