19 #ifndef _QGSVECTORFILEWRITER_H_
20 #define _QGSVECTORFILEWRITER_H_
57 : docString( docString )
68 SetOption(
const QString& docString, QStringList values,
const QString& defaultValue,
bool allowNone =
false )
70 , values( values.toSet() )
71 , defaultValue( defaultValue )
72 , allowNone( allowNone )
83 StringOption(
const QString& docString,
const QString& defaultValue = QString() )
84 :
Option( docString, String )
85 , defaultValue( defaultValue )
94 IntOption(
const QString& docString,
int defaultValue )
96 , defaultValue( defaultValue )
106 :
SetOption( docString, QStringList() <<
"YES" <<
"NO", defaultValue ?
"YES" :
"NO" )
126 MetaData( QString longName, QString trLongName, QString glob, QString ext, QMap<QString, Option*> driverOptions, QMap<QString, Option*> layerOptions )
127 : longName( longName )
128 , trLongName( trLongName )
131 , driverOptions( driverOptions )
132 , layerOptions( layerOptions )
180 const QString& fileName,
181 const QString& fileEncoding,
183 const QString& driverName =
"ESRI Shapefile",
184 bool onlySelected =
false,
185 QString *errorMessage = 0,
186 const QStringList &datasourceOptions = QStringList(),
187 const QStringList &layerOptions = QStringList(),
188 bool skipAttributeCreation =
false,
189 QString *newFilename = 0,
190 SymbologyExport symbologyExport = NoSymbology,
191 double symbologyScale = 1.0,
197 const QString& fileName,
198 const QString& fileEncoding,
200 const QString& driverName =
"ESRI Shapefile",
201 bool onlySelected =
false,
202 QString *errorMessage = 0,
203 const QStringList &datasourceOptions = QStringList(),
204 const QStringList &layerOptions = QStringList(),
205 bool skipAttributeCreation =
false,
206 QString *newFilename = 0,
207 SymbologyExport symbologyExport = NoSymbology,
208 double symbologyScale = 1.0,
214 const QString& fileEncoding,
218 const QString& driverName =
"ESRI Shapefile",
219 const QStringList &datasourceOptions = QStringList(),
220 const QStringList &layerOptions = QStringList(),
221 QString *newFilename = 0,
222 SymbologyExport symbologyExport = NoSymbology
226 static QMap< QString, QString> supportedFiltersAndFormats();
232 static QMap< QString, QString> ogrDriverList();
235 static QString fileFilterString();
238 static QString filterForDriver(
const QString& driverName );
241 static QString convertCodecNameForEncodingOption(
const QString &codecName );
244 WriterError hasError();
247 QString errorMessage();
262 static bool deleteShapeFile( QString theFileName );
270 static bool driverMetadata(
const QString& driverName, MetaData& driverMetadata );
296 #if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 1700
297 QMap< QgsSymbolLayerV2*, QString > mSymbolLayerTable;
304 static QMap<QString, MetaData> initMetaData();
308 static bool driverMetadata( QString driverName, QString &longName, QString &trLongName, QString &glob, QString &ext );
310 OGRFeatureH createFeature(
QgsFeature& feature );
311 bool writeFeature( OGRLayerH layer, OGRFeatureH feature );
323 static QMap<QString, MetaData> sDriverMetadata;