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>
26
#include <migration/keximigrate_p.h>
29
namespace KexiMigration
32
class xBaseMigrate : public KexiMigrate, protected xbXBase
38
xBaseMigrate(QObject *parent, const QVariantList& args = QVariantList());
39
virtual ~xBaseMigrate();
42
//! Driver specific function to return table names
43
virtual bool drv_tableNames(QStringList& tablenames);
45
//! Driver specific implementation to read a table schema
46
virtual bool drv_readTableSchema(
47
const QString& originalName, KexiDB::TableSchema& tableSchema);
49
//! Driver specific connection implementation
50
virtual bool drv_connect();
52
virtual bool drv_disconnect();
54
virtual bool drv_copyTable(const QString& srcTable,
55
KexiDB::Connection *destConn, KexiDB::TableSchema* dstTable);
57
//TODO: move this somewhere to low level class (MIGRATION?)
58
// virtual bool drv_getTablesList( QStringList &list );
59
//TODO: move this somewhere to low level class (MIGRATION?)
60
// virtual bool drv_containsTable( const QString &tableName );
64
KexiDB::Field::Type type(char xBaseColumnType);
66
//! Sets and existing constraints on the field
67
void getConstraints(const QString& tableName, KexiDB::Field* fld);
69
//! Returns a list of index files corresponding to the specific fieldName
70
QStringList getIndexFileNames(const QString& tableName, const QString& fieldName);
72
//! Mapping tableNames to actual absoolute file name paths
73
// XBase only deals with absolute names ( with the .dbf extension ) which is pretty cumbersome
74
QHash<QString,QString> m_tableNamePathMap;