2004-10-21 22:30:56 +00:00
|
|
|
/***************************************************************************
|
|
|
|
qgsbabelformat.h - import/export formats for GPSBabel
|
2004-10-22 13:16:58 +00:00
|
|
|
-------------------
|
|
|
|
begin : Oct 20, 2004
|
|
|
|
copyright : (C) 2004 by Lars Luthman
|
|
|
|
email : larsl@users.sourceforge.net
|
2004-10-21 22:30:56 +00:00
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
* *
|
|
|
|
* 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 QGSBABELFORMAT_H
|
|
|
|
#define QGSBABELFORMAT_H
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include <qstring.h>
|
|
|
|
#include <qstringlist.h>
|
|
|
|
|
|
|
|
|
|
|
|
class QgsBabelFormat {
|
|
|
|
public:
|
2005-02-15 15:38:52 +00:00
|
|
|
QgsBabelFormat(const QString& name = "");
|
2004-10-21 22:30:56 +00:00
|
|
|
virtual ~QgsBabelFormat() { }
|
|
|
|
|
2004-10-22 13:16:58 +00:00
|
|
|
const QString& name() const;
|
|
|
|
virtual QStringList importCommand(const QString& babel,
|
|
|
|
const QString& featuretype,
|
|
|
|
const QString& input,
|
|
|
|
const QString& output) const;
|
|
|
|
virtual QStringList exportCommand(const QString& babel,
|
|
|
|
const QString& featuretype,
|
|
|
|
const QString& input,
|
|
|
|
const QString& output) const;
|
2004-10-21 22:30:56 +00:00
|
|
|
|
|
|
|
bool supportsImport() const;
|
|
|
|
bool supportsExport() const;
|
|
|
|
bool supportsWaypoints() const;
|
|
|
|
bool supportsRoutes() const;
|
|
|
|
bool supportsTracks() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2005-02-15 15:38:52 +00:00
|
|
|
QString mName;
|
2005-09-28 23:59:13 +00:00
|
|
|
bool mSupportsImport, mSupportsExport;
|
|
|
|
bool mSupportsWaypoints, mSupportsRoutes, mSupportsTracks;
|
2004-10-21 22:30:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-10-22 13:16:58 +00:00
|
|
|
|
2004-10-21 22:30:56 +00:00
|
|
|
class QgsSimpleBabelFormat : public QgsBabelFormat {
|
|
|
|
public:
|
|
|
|
QgsSimpleBabelFormat(const QString& format, bool hasWaypoints,
|
|
|
|
bool hasRoutes, bool hasTracks);
|
2004-10-22 13:16:58 +00:00
|
|
|
QStringList importCommand(const QString& babel,
|
|
|
|
const QString& featuretype,
|
|
|
|
const QString& input,
|
|
|
|
const QString& output) const;
|
2004-10-21 22:30:56 +00:00
|
|
|
protected:
|
|
|
|
QString mFormat;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-10-22 13:16:58 +00:00
|
|
|
|
2004-10-21 22:30:56 +00:00
|
|
|
class QgsBabelCommand : public QgsBabelFormat {
|
|
|
|
public:
|
|
|
|
QgsBabelCommand(const QString& importCmd, const QString& exportCmd);
|
2004-10-22 13:16:58 +00:00
|
|
|
QStringList importCommand(const QString& babel,
|
|
|
|
const QString& featuretype,
|
|
|
|
const QString& input,
|
|
|
|
const QString& output) const;
|
|
|
|
QStringList exportCommand(const QString& babel,
|
|
|
|
const QString& featuretype,
|
|
|
|
const QString& input,
|
|
|
|
const QString& output) const;
|
2004-10-21 22:30:56 +00:00
|
|
|
protected:
|
|
|
|
QStringList mImportCmd;
|
|
|
|
QStringList mExportCmd;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef std::map<QString, QgsBabelFormat*> BabelMap;
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|