Add support for %nspace when using directors - Java
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12891 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
cd51908860
commit
debd5e9246
6 changed files with 137 additions and 7 deletions
68
Examples/test-suite/director_nspace.i
Normal file
68
Examples/test-suite/director_nspace.i
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
%module(directors="1") director_nspace
|
||||
|
||||
#ifdef SWIGJAVA
|
||||
SWIG_JAVABODY_PROXY(public, public, SWIGTYPE)
|
||||
SWIG_JAVABODY_TYPEWRAPPER(public, public, public, SWIGTYPE)
|
||||
#endif
|
||||
|
||||
%{
|
||||
#include <string>
|
||||
|
||||
namespace Bar
|
||||
{
|
||||
class FooBar {
|
||||
public:
|
||||
FooBar() {}
|
||||
FooBar(const FooBar&) {}
|
||||
virtual ~FooBar() {}
|
||||
|
||||
std::string FooBarDo() { return "Bar::Foo2::Foo2Bar()"; }
|
||||
};
|
||||
|
||||
class Foo {
|
||||
public:
|
||||
virtual ~Foo() {}
|
||||
virtual std::string ping() { return "Bar::Foo::ping()"; }
|
||||
virtual std::string pong() { return "Bar::Foo::pong();" + ping(); }
|
||||
virtual std::string fooBar(FooBar* fooBar) { return fooBar->FooBarDo(); }
|
||||
virtual Foo makeFoo() { return Foo(); }
|
||||
virtual FooBar makeFooBar() { return FooBar(); }
|
||||
|
||||
static Foo* get_self(Foo *self) {return self;}
|
||||
};
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
%include <std_string.i>
|
||||
|
||||
%nspace Bar::Foo;
|
||||
%nspace Bar::FooBar;
|
||||
|
||||
%feature("director") Bar::Foo;
|
||||
|
||||
namespace Bar
|
||||
{
|
||||
class FooBar {
|
||||
public:
|
||||
FooBar();
|
||||
FooBar(const FooBar&);
|
||||
virtual ~FooBar();
|
||||
|
||||
std::string FooBarDo();
|
||||
|
||||
};
|
||||
|
||||
class Foo
|
||||
{
|
||||
public:
|
||||
virtual ~Foo();
|
||||
virtual std::string ping();
|
||||
virtual std::string pong();
|
||||
virtual std::string fooBar(FooBar* fooBar);
|
||||
virtual Foo makeFoo();
|
||||
virtual FooBar makeFooBar();
|
||||
|
||||
static Foo* get_self(Foo *self);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue