QGIS/plugins/spit/qgsshapefile.h
gsherman 41fa0fcb43 Implementation of reserved word handling. Reserved PostgreSQL keywords are
detected and the user is given the change to change the column names prior
to import into the database. Column names can be changed for any field if
desired.


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@2359 c8812cc2-4d05-0410-92ff-de0c093fc19c
2004-11-28 05:49:30 +00:00

73 lines
2.0 KiB
C++

/***************************************************************************
qgsshapefile.h - description
-------------------
begin : Fri Dec 19 2003
copyright : (C) 2003 by Denis Antipov
email :
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/* $Id$ */
#ifndef QGSSHAPEFILE_H
#define QGSSHAPEFILE_H
#include <vector>
#include <qstring.h>
#include <qstringlist.h>
#include <qobject.h>
#include <ogrsf_frmts.h>
#include <qprogressdialog.h>
class OGRLayer;
class OGRDataSource;
extern "C"
{
#include <libpq-fe.h>
}
class QgsShapeFile : public QObject
{
Q_OBJECT
public:
QgsShapeFile(QString filename);
~QgsShapeFile();
int getFeatureCount();
QString getFeatureClass();
bool insertLayer(QString dbname, QString schema, QString geom_col, QString srid, PGconn * conn, QProgressDialog * pro, bool &fin);
bool is_valid();
QString getName();
QString getTable();
void setTable(QString new_table);
void setDefaultTable();
std::vector <QString> column_names;
std::vector <QString> column_types;
void setColumnNames(QStringList);
private:
QString table_name;
OGRDataSource *ogrDataSource;
OGRLayer * ogrLayer;
bool import_cancelled;
bool valid;
int features;
QString filename;
QString geom_type;
public slots:
void cancelImport();
};
#endif