27#include "moc_qgsprovidermetadata.cpp"
40 , mCreateFunction( createFunc )
45 qDeleteAll( mProviderConnections );
90 return mCreateFunction;
110 return QList<QgsMeshDriverMetadata>();
120 return QList<Qgis::LayerType>();
130 return QStringList();
135 return QList<QgsProviderSublayerDetails>();
142 if ( mCreateFunction )
144 return mCreateFunction( uri, options, flags );
151 if ( value.toString().compare( QStringLiteral(
"yes" ), Qt::CaseInsensitive ) == 0 ||
152 value.toString().compare( QStringLiteral(
"1" ), Qt::CaseInsensitive ) == 0 ||
153 value.toString().compare( QStringLiteral(
"true" ), Qt::CaseInsensitive ) == 0 )
155 uri[ parameter ] =
true;
157 else if ( value.toString().compare( QStringLiteral(
"no" ), Qt::CaseInsensitive ) == 0 ||
158 value.toString().compare( QStringLiteral(
"0" ), Qt::CaseInsensitive ) == 0 ||
159 value.toString().compare( QStringLiteral(
"false" ), Qt::CaseInsensitive ) == 0 )
161 uri[ parameter ] =
false;
167 if ( uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"yes" ), Qt::CaseInsensitive ) == 0 ||
168 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"1" ), Qt::CaseInsensitive ) == 0 ||
169 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"true" ), Qt::CaseInsensitive ) == 0 )
173 else if ( uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"no" ), Qt::CaseInsensitive ) == 0 ||
174 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"0" ), Qt::CaseInsensitive ) == 0 ||
175 uri.value( parameter, QString() ).toString().compare( QStringLiteral(
"false" ), Qt::CaseInsensitive ) == 0 )
185 return QVariantMap();
214 bool, QMap<int, int> &,
215 QString &errorMessage,
const QMap<QString, QVariant> *,
218 errorMessage = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"createEmptyLayer" ) );
224 errorMessage = QObject::tr(
"The %1 provider does not support database creation" ).arg(
key() );
229 const QString &,
const QString &,
233 const QStringList & )
242 const QMap<QString, QString> & )
const
250 const QMap<QString, QString> & )
const
257 return QList<QPair<QString, QString> >();
262 return QList<QgsDataItemProvider *>();
266 QStringList &, QString &errCause )
268 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"listStyles" ) );
281 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"getStyleById" ) );
287 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"deleteStyleById" ) );
292 const QString &,
const QString &,
bool, QString &errCause )
294 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"saveStyle" ) );
300 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"loadStyle" ) );
306 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"loadStoredStyle" ) );
317 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), QStringLiteral(
"createDb" ) );
339 const QMap<QString, QgsAbstractProviderConnection *> constConns {
connections( cached ) };
340 const QStringList constKeys { constConns.keys( ) };
341 for (
const QString &
key : constKeys )
345 return constConns.value(
key );
360 Q_UNUSED( configuration );
373 Q_UNUSED( connection )
381 const bool isNewConnection = !
connections().contains( name );
383 mProviderConnections.clear();
385 if ( !isNewConnection )
395 QMap<QString, T *> result;
397 const QStringList constConnKeys { constConns.keys() };
398 for (
const auto &
c : constConnKeys )
400 T *casted {
static_cast<T *
>( constConns.value(
c ) ) };
403 result.insert(
c, casted );
414 const QString &writeDatasetOnfileSuffix )
418 , mWriteDatasetOnFileSuffix( writeDatasetOnfileSuffix )
425 const QString &writeDatasetOnfileSuffix,
427 int maxVerticesPerface )
431 , mWriteDatasetOnFileSuffix( writeDatasetOnfileSuffix )
433 , mMaxVerticesPerFace( maxVerticesPerface )
439 return mCapabilities;
454 return mWriteDatasetOnFileSuffix;
459 return mWriteMeshFrameOnFileSuffix;
464 return mMaxVerticesPerFace;
QFlags< UriCleaningFlag > UriCleaningFlags
Flags for cleaning layer URIs.
FileFilterType
Type of file filters.
VectorExportResult
Vector layer export result codes.
@ ErrorProviderUnsupportedFeature
Provider does not support creation of empty layers.
@ RemoveCredentials
Completely remove credentials (eg passwords) from the URI. This flag is not compatible with the Redac...
@ RedactCredentials
Replace the value of credentials (eg passwords) with 'xxxxxxxx'. This flag is not compatible with the...
QFlags< DataProviderReadFlag > DataProviderReadFlags
Flags which control data provider construction.
DataType
Raster data types.
QFlags< SublayerQueryFlag > SublayerQueryFlags
Sublayer query flags.
WkbType
The WKB type describes the number of dimensions a geometry has.
An interface for data provider connections.
virtual void store(const QString &name) const =0
Stores the connection in the settings.
Represents a coordinate reference system (CRS).
Abstract base class for spatial data provider implementations.
static QString removePassword(const QString &aUri, bool hide=false)
Removes the password element from a URI.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Container of fields for a vector layer.
Custom exception class which is raised when an operation is not supported.
QString writePath(const QString &filename) const
Prepare a filename to save it to the project file.
QString readPath(const QString &filename) const
Turn filename read from the project file to an absolute path.
Custom exception class for provider connection related exceptions.
Base class for raster data providers.
A container for the context for various read/write operations on objects.
const QgsPathResolver & pathResolver() const
Returns path resolver for conversion between relative and absolute paths.
Allows creation of a multi-layer database-side transaction.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
Setting options for creating vector data providers.
Mesh - vertices, edges and faces.