Skip to content
Permalink
Browse files
[sipify] Fix stripping function body with virtual const reference ret…
…urns
  • Loading branch information
nyalldawson committed Apr 11, 2017
1 parent 5fb63c0 commit 669fa87eb422c5a7a2c59946daedf9e948e3af63
Showing with 10 additions and 1 deletion.
  1. +1 −1 scripts/sipify.pl
  2. +6 −0 tests/scripts/sipifyheader.expected.sip
  3. +3 −0 tests/scripts/sipifyheader.h
@@ -347,7 +347,7 @@ sub processDoxygenLine
}

# remove function bodies
if ( $line =~ m/^(\s*)?(const )?(virtual |static )?(([\w:]+(<.*?>)?\s+(\*|&)?)?(\w+|operator.{1,2})\(.*?(\(.*\))*.*\)( (?:const|SIP_[A-Z_]*?))*)\s*(\{.*\})?(?!;)(\s*\/\/.*)?$/ ){
if ( $line =~ m/^(\s*)?(virtual )?(static |const )*(([\w:]+(<.*?>)?\s+(\*|&)?)?(\w+|operator.{1,2})\(.*?(\(.*\))*.*\)( (?:const|SIP_[A-Z_]*?))*)\s*(\{.*\})?(?!;)(\s*\/\/.*)?$/ ){
my $newline = "$1$2$3$4;\n";
if ($line !~ m/\{.*?\}$/){
$line = readline $header;
@@ -190,6 +190,12 @@ Removing function body with namespaced return value
:rtype: QgsRaster.RasterBuildPyramids
%End

virtual const QgsLayerMetadata &metadata() const;
%Docstring
Removing function body with virtual const reference
:rtype: QgsLayerMetadata
%End


virtual int overriddenProperty();
%Docstring
@@ -205,6 +205,9 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas
//! Removing function body with namespaced return value
QgsRaster::RasterBuildPyramids buildPyramidsFlag() const { return mBuildPyramidsFlag; }

//! Removing function body with virtual const reference
virtual const QgsLayerMetadata &metadata() const { return mMetadata; }

bool deletedFunction() = delete; // some comments

virtual int overriddenProperty() override { return 42; } // if in doubt, comment it out

0 comments on commit 669fa87

Please sign in to comment.