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 )
181 const QString& fileName,
182 const QString& fileEncoding,
184 const QString& driverName =
"ESRI Shapefile",
185 bool onlySelected =
false,
186 QString *errorMessage = 0,
187 const QStringList &datasourceOptions = QStringList(),
188 const QStringList &layerOptions = QStringList(),
189 bool skipAttributeCreation =
false,
190 QString *newFilename = 0,
191 SymbologyExport symbologyExport = NoSymbology,
192 double symbologyScale = 1.0
196 const QString& fileName,
197 const QString& fileEncoding,
199 const QString& driverName =
"ESRI Shapefile",
200 bool onlySelected =
false,
201 QString *errorMessage = 0,
202 const QStringList &datasourceOptions = QStringList(),
203 const QStringList &layerOptions = QStringList(),
204 bool skipAttributeCreation =
false,
205 QString *newFilename = 0,
206 SymbologyExport symbologyExport = NoSymbology,
207 double symbologyScale = 1.0
212 const QString& fileEncoding,
216 const QString& driverName =
"ESRI Shapefile",
217 const QStringList &datasourceOptions = QStringList(),
218 const QStringList &layerOptions = QStringList(),
219 QString *newFilename = 0,
220 SymbologyExport symbologyExport = NoSymbology
224 static QMap< QString, QString> supportedFiltersAndFormats();
230 static QMap< QString, QString> ogrDriverList();
233 static QString fileFilterString();
236 static QString filterForDriver(
const QString& driverName );
239 static QString convertCodecNameForEncodingOption(
const QString &codecName );
242 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 );