Add %$isextendmember for %rename of members added via %extend
This commit is contained in:
parent
9cbd742b66
commit
c5911cc08d
5 changed files with 49 additions and 6 deletions
|
|
@ -33,3 +33,10 @@ FL_firstLowerCase()
|
|||
CA_CamelCase()
|
||||
LC_lowerCamelCase()
|
||||
UC_under_case_it()
|
||||
|
||||
ex = ExtendCheck()
|
||||
ex.MF_real_member1()
|
||||
ex.MF_real_member2()
|
||||
ex.EX_EXTENDMETHOD1()
|
||||
ex.EX_EXTENDMETHOD2()
|
||||
ex.EX_EXTENDMETHOD3()
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
%module rename_predicates
|
||||
|
||||
// Test a few of the predicates - %$isfunction etc
|
||||
%rename("AF_%(utitle)s", %$isfunction) "";
|
||||
%rename("MF_%(utitle)s", %$isfunction, %$ismember) "";
|
||||
%rename("GF_%(utitle)s", %$isfunction, %$not %$ismember) "";
|
||||
%rename("MV_%(utitle)s", %$isvariable) "";
|
||||
%rename("GV_%(utitle)s", %$isvariable, %$isglobal) "";
|
||||
|
||||
|
||||
%extend RenamePredicates {
|
||||
void extend_function_before() {}
|
||||
}
|
||||
|
|
@ -28,6 +28,7 @@ void global_function() {}
|
|||
void extend_function_after() {}
|
||||
}
|
||||
|
||||
// Test the various %rename functions - %(upper) etc
|
||||
%rename("UC_%(upper)s") "uppercase";
|
||||
%rename("LC_%(lower)s") "LOWERcase";
|
||||
%rename("TI_%(title)s") "title";
|
||||
|
|
@ -48,3 +49,23 @@ void Lower_camel_Case() {}
|
|||
void UnderCaseIt() {}
|
||||
%}
|
||||
|
||||
// Test renaming only member functions in %extend
|
||||
%rename("EX_%(upper)s", %$isfunction, %$isextendmember) "";
|
||||
%extend ExtendCheck {
|
||||
void ExtendMethod1() {}
|
||||
}
|
||||
%inline %{
|
||||
struct ExtendCheck {
|
||||
void RealMember1() {}
|
||||
#ifdef SWIG
|
||||
%extend {
|
||||
void ExtendMethod2() {}
|
||||
}
|
||||
#endif
|
||||
void RealMember2() {}
|
||||
};
|
||||
%}
|
||||
%extend ExtendCheck {
|
||||
void ExtendMethod3() {}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue