3030class QgsProcessingProvider ;
3131class QgsProcessingFeedback ;
3232class QgsFeatureSink ;
33+ class QgsProcessingFeedback ;
3334
3435
3536/* *
@@ -485,7 +486,7 @@ class CORE_EXPORT QgsProcessingAlgorithm
485486 const QgsFields &fields, QgsWkbTypes::Type geometryType = QgsWkbTypes::NoGeometry, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() ) const SIP_FACTORY;
486487
487488 /* *
488- * Evaluates the parameter with matching \a definition to a feature source.
489+ * Evaluates the parameter with matching \a name to a feature source.
489490 *
490491 * Sources will either be taken from \a context's active project, or loaded from external
491492 * sources and stored temporarily in the \a context.
@@ -494,6 +495,21 @@ class CORE_EXPORT QgsProcessingAlgorithm
494495 */
495496 QgsProcessingFeatureSource *parameterAsSource ( const QVariantMap ¶meters, const QString &name, QgsProcessingContext &context ) const SIP_FACTORY;
496497
498+ /* *
499+ * Evaluates the parameter with matching \a name to a source vector layer file path of compatible format.
500+ *
501+ * If the parameter is evaluated to an existing layer, and that layer is not of the format listed in the
502+ * \a compatibleFormats argument, then the layer will first be exported to a compatible format
503+ * in a temporary location. The function will then return the path to that temporary file.
504+ *
505+ * \a compatibleFormats should consist entirely of lowercase file extensions, e.g. 'shp'.
506+ *
507+ * The \a preferredFormat argument is used to specify to desired file extension to use when a temporary
508+ * layer export is required.
509+ */
510+ QString parameterAsCompatibleSourceLayerPath ( const QVariantMap ¶meters, const QString &name,
511+ QgsProcessingContext &context, const QStringList &compatibleFormats, const QString &preferredFormat = QString( " shp" ), QgsProcessingFeedback *feedback = nullptr );
512+
497513 /* *
498514 * Evaluates the parameter with matching \a name to a map layer.
499515 *
0 commit comments