23QString QgsTruncateTableAlgorithm::name()
const
25 return QStringLiteral(
"truncatetable" );
28QString QgsTruncateTableAlgorithm::displayName()
const
30 return QObject::tr(
"Truncate table" );
33QStringList QgsTruncateTableAlgorithm::tags()
const
35 return QObject::tr(
"empty,delete,layer,clear,features" ).split(
',' );
38QString QgsTruncateTableAlgorithm::group()
const
40 return QObject::tr(
"Vector general" );
43QString QgsTruncateTableAlgorithm::groupId()
const
45 return QStringLiteral(
"vectorgeneral" );
48QString QgsTruncateTableAlgorithm::shortHelpString()
const
50 return QObject::tr(
"This algorithm truncates a layer, by deleting all features from within the layer." )
51 + QStringLiteral(
"\n\n" )
52 + QObject::tr(
"Warning — this algorithm modifies the layer in place, and deleted features cannot be restored!" );
55QgsProcessingAlgorithm::Flags QgsTruncateTableAlgorithm::flags()
const
60QgsTruncateTableAlgorithm *QgsTruncateTableAlgorithm::createInstance()
const
62 return new QgsTruncateTableAlgorithm();
65void QgsTruncateTableAlgorithm::initAlgorithm(
const QVariantMap & )
73 QgsVectorLayer *layer = parameterAsVectorLayer( parameters, QStringLiteral(
"INPUT" ), context );
84 outputs.insert( QStringLiteral(
"OUTPUT" ), layer->
id() );
QString id() const
Returns the layer's unique ID, which is used to access this layer from QgsProject.
virtual Flags flags() const
Returns the flags indicating how and when the algorithm operates and should be exposed to users.
@ FlagNoThreading
Algorithm is not thread safe and cannot be run in a background thread, e.g. for algorithms which mani...
Contains information about the context in which a processing algorithm is executed.
Custom exception class for processing related exceptions.
Base class for providing feedback from a processing algorithm.
A vector layer output for processing algorithms.
A vector layer (with or without geometry) parameter for processing algorithms.
virtual bool truncate()
Removes all features from the layer.
Represents a vector layer which manages a vector based data sets.
QgsVectorDataProvider * dataProvider() FINAL
Returns the layer's data provider, it may be nullptr.