1
/* This file is part of the KDE project
2
Copyright (C) 2008 Sharan Rao <sharanrao@gmail.com>
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this program; see the file COPYING. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
* Boston, MA 02110-1301, USA.
20
#ifndef XBASEMIGRATE_H
21
#define XBASEMIGRATE_H
25
#include <migration/keximigrate.h>
28
namespace KexiMigration
31
class xBaseMigrate : public KexiMigrate, protected xbXBase
36
xBaseMigrate(QObject *parent, const QVariantList& args = QVariantList());
37
virtual ~xBaseMigrate();
40
//! Driver specific function to return table names
41
virtual bool drv_tableNames(QStringList *tablenames);
43
//! Driver specific implementation to read a table schema
44
virtual bool drv_readTableSchema(
45
const QString& originalName, KDbTableSchema *tableSchema);
47
//! Driver specific connection implementation
48
virtual bool drv_connect();
50
virtual bool drv_disconnect();
52
virtual bool drv_copyTable(const QString& srcTable,
53
KDbConnection *destConn, KDbTableSchema* dstTable,
54
const RecordFilter *recordFilter = nullptr);
56
//! @todo move this somewhere to low level class (MIGRATION?) virtual bool drv_getTablesList( QStringList &list );
57
//! @todo move this somewhere to low level class (MIGRATION?) virtual bool drv_containsTable( const QString &tableName );
60
KDbField::Type type(char xBaseColumnType);
62
//! Sets and existing constraints on the field
63
void getConstraints(const QString& tableName, KDbField* fld);
65
//! Returns a list of index files corresponding to the specific fieldName
66
QStringList getIndexFileNames(const QString& tableName, const QString& fieldName);
68
//! Mapping tableNames to actual absoolute file name paths
69
//! XBase only deals with absolute names ( with the .dbf extension ) which is pretty cumbersome
70
QHash<QString,QString> m_tableNamePathMap;