29#include "moc_qgsprovidermetadata.cpp"
31using namespace Qt::StringLiterals;
44 , mCreateFunction( createFunc )
49 qDeleteAll( mProviderConnections );
94 return mCreateFunction;
114 return QList<QgsMeshDriverMetadata>();
124 return QList<Qgis::LayerType>();
134 return QStringList();
139 return QList<QgsProviderSublayerDetails>();
146 if ( mCreateFunction )
148 return mCreateFunction( uri, options, flags );
155 if ( value.toString().compare( u
"yes"_s, Qt::CaseInsensitive ) == 0 ||
156 value.toString().compare( u
"1"_s, Qt::CaseInsensitive ) == 0 ||
157 value.toString().compare( u
"true"_s, Qt::CaseInsensitive ) == 0 )
159 uri[ parameter ] =
true;
161 else if ( value.toString().compare( u
"no"_s, Qt::CaseInsensitive ) == 0 ||
162 value.toString().compare( u
"0"_s, Qt::CaseInsensitive ) == 0 ||
163 value.toString().compare( u
"false"_s, Qt::CaseInsensitive ) == 0 )
165 uri[ parameter ] =
false;
171 if ( uri.value( parameter, QString() ).toString().compare( u
"yes"_s, Qt::CaseInsensitive ) == 0 ||
172 uri.value( parameter, QString() ).toString().compare( u
"1"_s, Qt::CaseInsensitive ) == 0 ||
173 uri.value( parameter, QString() ).toString().compare( u
"true"_s, Qt::CaseInsensitive ) == 0 )
177 else if ( uri.value( parameter, QString() ).toString().compare( u
"no"_s, Qt::CaseInsensitive ) == 0 ||
178 uri.value( parameter, QString() ).toString().compare( u
"0"_s, Qt::CaseInsensitive ) == 0 ||
179 uri.value( parameter, QString() ).toString().compare( u
"false"_s, Qt::CaseInsensitive ) == 0 )
189 return QVariantMap();
218 bool, QMap<int, int> &,
219 QString &errorMessage,
const QMap<QString, QVariant> *,
222 errorMessage = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), u
"createEmptyLayer"_s );
228 errorMessage = QObject::tr(
"The %1 provider does not support database creation" ).arg(
key() );
233 const QString &,
const QString &,
237 const QStringList & )
246 const QMap<QString, QString> & )
const
254 const QMap<QString, QString> & )
const
261 return QList<QPair<QString, QString> >();
266 return QList<QgsDataItemProvider *>();
270 QStringList &, QString &errCause )
272 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), u
"listStyles"_s );
285 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), u
"getStyleById"_s );
291 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), u
"deleteStyleById"_s );
296 const QString &,
const QString &,
bool, QString &errCause )
298 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), u
"saveStyle"_s );
304 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), u
"loadStyle"_s );
310 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), u
"loadStoredStyle"_s );
321 errCause = QObject::tr(
"Provider %1 has no %2 method" ).arg(
key(), u
"createDb"_s );
343 const QMap<QString, QgsAbstractProviderConnection *> constConns {
connections( cached ) };
344 const QStringList constKeys { constConns.keys( ) };
345 for (
const QString &
key : constKeys )
349 return constConns.value(
key );
364 Q_UNUSED( configuration );
377 Q_UNUSED( connection )
385 const bool isNewConnection = !
connections().contains( name );
387 mProviderConnections.clear();
389 if ( !isNewConnection )
399 QMap<QString, T *> result;
401 const QStringList constConnKeys { constConns.keys() };
402 for (
const auto &
c : constConnKeys )
404 T *casted {
static_cast<T *
>( constConns.value(
c ) ) };
407 result.insert(
c, casted );
418 const QString &writeDatasetOnfileSuffix )
422 , mWriteDatasetOnFileSuffix( writeDatasetOnfileSuffix )
429 const QString &writeDatasetOnfileSuffix,
431 int maxVerticesPerface )
435 , mWriteDatasetOnFileSuffix( writeDatasetOnfileSuffix )
437 , mMaxVerticesPerFace( maxVerticesPerface )
443 return mCapabilities;
458 return mWriteDatasetOnFileSuffix;
463 return mWriteMeshFrameOnFileSuffix;
468 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.