24using namespace Qt::StringLiterals;
28QString QgsTruncateTableAlgorithm::name()
const
30 return u
"truncatetable"_s;
33QString QgsTruncateTableAlgorithm::displayName()
const
35 return QObject::tr(
"Truncate table" );
38QStringList QgsTruncateTableAlgorithm::tags()
const
40 return QObject::tr(
"empty,delete,layer,clear,features" ).split(
',' );
43QString QgsTruncateTableAlgorithm::group()
const
45 return QObject::tr(
"Vector general" );
48QString QgsTruncateTableAlgorithm::groupId()
const
50 return u
"vectorgeneral"_s;
53QString QgsTruncateTableAlgorithm::shortHelpString()
const
55 return QObject::tr(
"This algorithm truncates a layer, by deleting all features from within the layer." )
57 + QObject::tr(
"Warning — this algorithm modifies the layer in place, and deleted features cannot be restored!" );
60QString QgsTruncateTableAlgorithm::shortDescription()
const
62 return QObject::tr(
"Truncates a layer, by deleting all features from within the layer." );
70QgsTruncateTableAlgorithm *QgsTruncateTableAlgorithm::createInstance()
const
72 return new QgsTruncateTableAlgorithm();
75void QgsTruncateTableAlgorithm::initAlgorithm(
const QVariantMap & )
83 QgsVectorLayer *layer = parameterAsVectorLayer( parameters, u
"INPUT"_s, context );
94 outputs.insert( u
"OUTPUT"_s, layer->
id() );
@ Vector
Tables (i.e. vector layers with or without geometry). When used for a sink this indicates the sink ha...
QFlags< ProcessingAlgorithmFlag > ProcessingAlgorithmFlags
Flags indicating how and when an algorithm operates and should be exposed to users.
@ NoThreading
Algorithm is not thread safe and cannot be run in a background thread, e.g. for algorithms which mani...
virtual Qgis::ProcessingAlgorithmFlags flags() const
Returns the flags indicating how and when the algorithm operates and should be exposed to users.
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 dataset.
QgsVectorDataProvider * dataProvider() final
Returns the layer's data provider, it may be nullptr.