QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsbabelformat.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsbabelformat.h - import/export formats for GPSBabel
3  -------------------
4  begin : Oct 20, 2004
5  copyright : (C) 2004 by Lars Luthman
6  email : [email protected]
7 
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSBABELFORMAT_H
18 #define QGSBABELFORMAT_H
19 
20 #include "qgis_core.h"
21 #include "qgis.h"
22 #include <QStringList>
23 
24 class QString;
25 
33 class CORE_EXPORT QgsAbstractBabelFormat
34 {
35  public:
36 
37  virtual ~QgsAbstractBabelFormat() = default;
38 
42  QString name() const;
43 
47  Qgis::BabelFormatCapabilities capabilities() const;
48 
60  virtual QStringList importCommand( const QString &babel,
61  Qgis::GpsFeatureType featureType,
62  const QString &input,
63  const QString &output,
64  Qgis::BabelCommandFlags flags = Qgis::BabelCommandFlags() ) const;
65 
77  virtual QStringList exportCommand( const QString &babel,
78  Qgis::GpsFeatureType featureType,
79  const QString &input,
80  const QString &output,
81  Qgis::BabelCommandFlags flags = Qgis::BabelCommandFlags() ) const;
82 
83  protected:
84 
88  explicit QgsAbstractBabelFormat( const QString &name = QString() );
89 
93  static QString featureTypeToArgument( Qgis::GpsFeatureType type );
94 
96  QString mName;
97 
98  Qgis::BabelFormatCapabilities mCapabilities = Qgis::BabelFormatCapabilities();
99 };
100 
101 
110 {
111  public:
112 
126  QgsBabelSimpleImportFormat( const QString &format, const QString &description, Qgis::BabelFormatCapabilities capabilities,
127  const QStringList extensions = QStringList() );
128 
132  QString description() const { return mDescription; }
133 
137  QStringList extensions() const { return mExtensions; }
138 
139  QStringList importCommand( const QString &babel,
140  Qgis::GpsFeatureType featureType,
141  const QString &input,
142  const QString &output,
143  Qgis::BabelCommandFlags flags = Qgis::BabelCommandFlags() ) const override;
144  private:
145  QString mDescription;
146  QStringList mExtensions;
147 };
148 
149 #endif
QgsBabelSimpleImportFormat::description
QString description() const
Returns the friendly description for the format.
Definition: qgsbabelformat.h:132
QgsBabelSimpleImportFormat
A babel format capable of converting input files to GPX files.
Definition: qgsbabelformat.h:109
qgis.h
QgsAbstractBabelFormat::mName
QString mName
Name of format.
Definition: qgsbabelformat.h:96
QgsBabelSimpleImportFormat::extensions
QStringList extensions() const
Returns the list of known extensions for the format, e.g.
Definition: qgsbabelformat.h:137
QgsAbstractBabelFormat::importCommand
virtual QStringList importCommand(const QString &babel, Qgis::GpsFeatureType featureType, const QString &input, const QString &output, Qgis::BabelCommandFlags flags=Qgis::BabelCommandFlags()) const
Generates a command for importing data into a GPS format using babel.
Definition: qgsbabelformat.cpp:46
Qgis::GpsFeatureType
GpsFeatureType
Babel command flags.
Definition: qgis.h:886
QgsAbstractBabelFormat
Abstract base class for babel GPS formats.
Definition: qgsbabelformat.h:33