Marvin Greenberg
2012-06-20 19:23:56 UTC
For swig 2.0 the documentation for %rename says
" The renaming applies to functions, variables, class and structure names,
member functions, and member data"
Later it recommends examining swig.swg for a list of renaming predicates, and
there we find (for 2.0.5, as of around revision 12900):
%define %$isnamespace "match"="namespace" %enddef
Trying some renames like this:
foo.i:
%module myspam
%rename("Utility",%$isnamespace) std;
%nspace std::Spam;
namespace std {
class Spam {
public:
void foo(int);
};
}
and running:
swig -c++ -java -o cppsrc/foo.cpp -outdir javasrc/ foo.i
still generates std/Spam.java not Utility/Spam.java. Trying variations on the
rename and nspace don;t seem to have any effect. Is %renaming namespaces (and
corresponding support in %nspace) some work in progress? Or is the predicate in
swig.swg just some "wouldn't it be nice" placeholder...
" The renaming applies to functions, variables, class and structure names,
member functions, and member data"
Later it recommends examining swig.swg for a list of renaming predicates, and
there we find (for 2.0.5, as of around revision 12900):
%define %$isnamespace "match"="namespace" %enddef
Trying some renames like this:
foo.i:
%module myspam
%rename("Utility",%$isnamespace) std;
%nspace std::Spam;
namespace std {
class Spam {
public:
void foo(int);
};
}
and running:
swig -c++ -java -o cppsrc/foo.cpp -outdir javasrc/ foo.i
still generates std/Spam.java not Utility/Spam.java. Trying variations on the
rename and nspace don;t seem to have any effect. Is %renaming namespaces (and
corresponding support in %nspace) some work in progress? Or is the predicate in
swig.swg just some "wouldn't it be nice" placeholder...