[sipify] Combine multiple argument annotations

This commit is contained in:
Nyall Dawson 2017-05-04 08:29:23 +10:00
parent 50680249ed
commit ac54a3f83f
3 changed files with 8 additions and 0 deletions

View File

@ -579,6 +579,10 @@ while ($line_idx < $line_count){
$line =~ s/\/(\w+(=\w+)?)\/\s*\/(\w+(=\w+)?)\/\s*;(\s*(\/\/.*)?)$/\/$1,$3\/$5;/;
(! $3) or dbg_info("combine multiple annotations -- works only for 2");
};
# combine multiple argument annotations
do {no warnings 'uninitialized';
$line =~ s/\/(\w+(=\w+)?)\/\s*\/(\w+(=\w+)?)\//\/$1,$3\//;
};
# unprinted annotations
$line =~ s/(\w+)(\<(?>[^<>]|(?2))*\>)?\s+SIP_PYTYPE\(\s*\'?([^()']+)(\(\s*(?:[^()]++|(?2))*\s*\))?\'?\s*\)/$3/g;

View File

@ -208,6 +208,8 @@ complex default value and type (i.e. containing commas) should be given as a str
void removeProxyFactory( QNetworkProxyFactory *factory /TransferBack/ );
void multiAnnotationArg( SomeClass** object /Out,TransferBack/, int& another /Out/ );
bool removeFunctionBody( const QList<int, QString> &list, QgsVectorLayer *vl, Some::Thing _part = -1 /*default =-1*/ );
%Docstring
:rtype: bool

View File

@ -240,6 +240,8 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas
void removeProxyFactory( QNetworkProxyFactory *factory SIP_TRANSFERBACK );
void multiAnnotationArg( SomeClass **object SIP_OUT SIP_TRANSFERBACK, int &another SIP_OUT );
bool removeFunctionBody( const QList<int, QString> &list, QgsVectorLayer *vl, Some::Thing _part = -1 /*default =-1*/ ) { doSomething; return true; } // some comments
static inline QgsMapLayer *skippedMethodWithBody() SIP_SKIP