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:
William S Fulton 2016-03-01 20:42:12 +00:00
commit 4a3e1fd44c
6 changed files with 72 additions and 0 deletions

View file

@ -344,6 +344,7 @@ CPP_TEST_CASES += \
rename2 \
rename3 \
rename4 \
rename_rstrip_encoder \
rename_scope \
rename_simple \
rename_strip_encoder \

View file

@ -0,0 +1,5 @@
from rename_rstrip_encoder import *
s = SomeThing()
a = AnotherThing()
a.DoClsX()

View 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() {}
};
%}