Skip to content

Commit ac54a3f

Browse files
committedMay 3, 2017
[sipify] Combine multiple argument annotations
1 parent 5068024 commit ac54a3f

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed
 

‎scripts/sipify.pl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,10 @@ sub remove_constructor_or_body {
579579
$line =~ s/\/(\w+(=\w+)?)\/\s*\/(\w+(=\w+)?)\/\s*;(\s*(\/\/.*)?)$/\/$1,$3\/$5;/;
580580
(! $3) or dbg_info("combine multiple annotations -- works only for 2");
581581
};
582+
# combine multiple argument annotations
Code has comments. Press enter to view.
583+
do {no warnings 'uninitialized';
584+
$line =~ s/\/(\w+(=\w+)?)\/\s*\/(\w+(=\w+)?)\//\/$1,$3\//;
585+
};
582586

583587
# unprinted annotations
584588
$line =~ s/(\w+)(\<(?>[^<>]|(?2))*\>)?\s+SIP_PYTYPE\(\s*\'?([^()']+)(\(\s*(?:[^()]++|(?2))*\s*\))?\'?\s*\)/$3/g;

‎tests/scripts/sipifyheader.expected.sip

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ complex default value and type (i.e. containing commas) should be given as a str
208208

209209
void removeProxyFactory( QNetworkProxyFactory *factory /TransferBack/ );
210210

211+
void multiAnnotationArg( SomeClass** object /Out,TransferBack/, int& another /Out/ );
212+
211213
bool removeFunctionBody( const QList<int, QString> &list, QgsVectorLayer *vl, Some::Thing _part = -1 /*default =-1*/ );
212214
%Docstring
213215
:rtype: bool

‎tests/scripts/sipifyheader.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas
240240

241241
void removeProxyFactory( QNetworkProxyFactory *factory SIP_TRANSFERBACK );
242242

243+
void multiAnnotationArg( SomeClass **object SIP_OUT SIP_TRANSFERBACK, int &another SIP_OUT );
244+
243245
bool removeFunctionBody( const QList<int, QString> &list, QgsVectorLayer *vl, Some::Thing _part = -1 /*default =-1*/ ) { doSomething; return true; } // some comments
244246

245247
static inline QgsMapLayer *skippedMethodWithBody() SIP_SKIP

0 commit comments

Comments
 (0)
Please sign in to comment.