Add rstrip encoder for use in %rename.
This is like the strip encoder but strips the symbol's suffix instead of the prefix.
This commit is contained in:
parent
3000824c94
commit
4a3e1fd44c
6 changed files with 72 additions and 0 deletions
|
|
@ -344,6 +344,7 @@ CPP_TEST_CASES += \
|
|||
rename2 \
|
||||
rename3 \
|
||||
rename4 \
|
||||
rename_rstrip_encoder \
|
||||
rename_scope \
|
||||
rename_simple \
|
||||
rename_strip_encoder \
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
from rename_rstrip_encoder import *
|
||||
|
||||
s = SomeThing()
|
||||
a = AnotherThing()
|
||||
a.DoClsX()
|
||||
15
Examples/test-suite/rename_rstrip_encoder.i
Normal file
15
Examples/test-suite/rename_rstrip_encoder.i
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
%module rename_rstrip_encoder
|
||||
|
||||
// strip the Cls suffix from all identifiers
|
||||
%rename("%(rstrip:[Cls])s") "";
|
||||
|
||||
%inline %{
|
||||
|
||||
class SomeThingCls {
|
||||
};
|
||||
|
||||
struct AnotherThingCls {
|
||||
void DoClsXCls() {}
|
||||
};
|
||||
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue