add %rename predicates

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8381 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-01-12 00:39:59 +00:00
commit f3f56ee734
2 changed files with 46 additions and 1 deletions

View file

@ -1,6 +1,6 @@
%module rename_camel
%rename("%(utitle)s",match="cdecl",notmatch$decl="",match$parentNode$nodeType="class") "";
%rename("%(utitle)s",%isfunction,%ismember) "";
%inline {
struct GeometryFactory

View file

@ -203,6 +203,51 @@ static int NAME(TYPE x) {
%enddef
/* -----------------------------------------------------------------------------
* %rename predicates
* ----------------------------------------------------------------------------- */
/*
Predicates to be used with %rename, for example:
- to rename all the functions:
%rename("%(utitle)s", %isfunction) "";
- to rename only the member methods:
%rename("m_%(utitle)s", %isfunction, %ismember) "";
- to rename only the global functions:
%rename("g_%(utitle)s", %isfunction, %isnotmember) "";
*/
#define %isenum match="enum"
#define %isenumitem match="enumitem"
#define %isaccess match="access"
#define %isclass match="class"
#define %isextend match="extend"
#define %isextend match="extend"
#define %isconstructor match="constructor"
#define %isdestructor match="destructor"
#define %isnamespace match="namespace"
#define %istemplate match="template"
#define %isunion match$kind="union"
#define %isfunction match="cdecl",notmatch$decl=""
#define %isstatic match$storage="static"
#define %isfriend match$storage="friend"
#define %istypedef match$storage="typedef"
#define %isvirtual match$storage="virtual"
#define %isexplicit match$storage="explicit"
#define %isextern match$storage="extern"
#define %ismember match$parentNode$nodeType="class"
#define %isnotmember notmatch$parentNode$nodeType="class"
/* -----------------------------------------------------------------------------
* Include all the warnings labels and macros
* ----------------------------------------------------------------------------- */