Skip to content
Permalink
Browse files

Merge pull request #4797 from nyalldawson/flush_sink

Move flushBuffer method up to QgsFeatureSink
  • Loading branch information
nyalldawson committed Jun 29, 2017
2 parents 7b1932a + bf3d55c commit fe800e25a57e90be45e0ec0453c45bfabb36810a
@@ -55,6 +55,12 @@ class QgsFeatureSink
:rtype: bool
%End

virtual bool flushBuffer();
%Docstring
Flushes any internal buffer which may exist in the sink, causing any buffered features to be added to the sink's destination.
:return: false if any buffered features could not be added to the sink.
:rtype: bool
%End
};

QFlags<QgsFeatureSink::Flag> operator|(QgsFeatureSink::Flag f1, QFlags<QgsFeatureSink::Flag> f2);
@@ -124,12 +124,8 @@ class QgsVectorLayerExporter : QgsFeatureSink
Finalizes the export and closes the new created layer.
%End

bool flushBuffer();
%Docstring
Flush the buffer writing the features to the new layer.
.. versionadded:: 3.0
:rtype: bool
%End
virtual bool flushBuffer();


private:
QgsVectorLayerExporter( const QgsVectorLayerExporter &rh );
@@ -71,6 +71,11 @@ class CORE_EXPORT QgsFeatureSink
*/
virtual bool addFeatures( QgsFeatureIterator &iterator, QgsFeatureSink::Flags flags = 0 );

/**
* Flushes any internal buffer which may exist in the sink, causing any buffered features to be added to the sink's destination.
* \returns false if any buffered features could not be added to the sink.
*/
virtual bool flushBuffer() { return true; }
};

Q_DECLARE_OPERATORS_FOR_FLAGS( QgsFeatureSink::Flags )
@@ -141,11 +141,7 @@ class CORE_EXPORT QgsVectorLayerExporter : public QgsFeatureSink
*/
~QgsVectorLayerExporter();

/**
* Flush the buffer writing the features to the new layer.
* \since QGIS 3.0
*/
bool flushBuffer();
bool flushBuffer() override;

private:

0 comments on commit fe800e2

Please sign in to comment.
You can’t perform that action at this time.