adding more cases and suppressing the 470 warning
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7854 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d18d84cd3b
commit
f4a45fa252
8 changed files with 36 additions and 15 deletions
|
|
@ -1,4 +1,6 @@
|
|||
%module(directors="1") director_basic
|
||||
#pragma SWIG nowarn=470
|
||||
|
||||
%{
|
||||
#include <string>
|
||||
|
||||
|
|
@ -32,7 +34,7 @@
|
|||
%{
|
||||
#include <complex>
|
||||
%}
|
||||
%feature("director");
|
||||
%feature("director") A;
|
||||
|
||||
// basic renaming
|
||||
%rename(rg) A::gg;
|
||||
|
|
@ -99,11 +101,18 @@ public:
|
|||
return b;
|
||||
}
|
||||
|
||||
virtual Bar* pmethod(Bar *b)
|
||||
{
|
||||
b->x += 12;
|
||||
return b;
|
||||
}
|
||||
|
||||
Bar cmethod(const Bar &b)
|
||||
{
|
||||
return vmethod(b);
|
||||
}
|
||||
|
||||
|
||||
static MyClass *get_self(MyClass *c)
|
||||
{
|
||||
return c;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
%module(directors="1") director_detect
|
||||
#pragma SWIG nowarn=470
|
||||
|
||||
%warnfilter(822, 842) cloner; /* Java, C# covariant return types */
|
||||
|
||||
|
|
|
|||
|
|
@ -3,16 +3,6 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
class Foo {
|
||||
public:
|
||||
virtual ~Foo() {}
|
||||
virtual std::string ping() { return "Foo::ping()"; }
|
||||
virtual std::string pong(int val = 3) { return "Foo::pong();" + ping(); }
|
||||
};
|
||||
|
||||
Foo *launder(Foo *f) {
|
||||
return f;
|
||||
}
|
||||
|
||||
// define dummy director exception classes to prevent spurious errors
|
||||
// in target languages that do not support directors.
|
||||
|
|
@ -61,14 +51,21 @@ class DirectorMethodException: public Swig::DirectorException {};
|
|||
|
||||
%feature("director") Foo;
|
||||
|
||||
%inline {
|
||||
|
||||
class Foo {
|
||||
public:
|
||||
virtual ~Foo() {}
|
||||
virtual std::string ping() { return "Foo::ping()"; }
|
||||
virtual std::string pong(int val = 3) { return "Foo::pong();" + ping(); }
|
||||
virtual ~Foo() {}
|
||||
virtual std::string ping() { return "Foo::ping()"; }
|
||||
virtual std::string pong(int val=3) { return "Foo::pong();" + ping(); }
|
||||
};
|
||||
|
||||
Foo *launder(Foo *f);
|
||||
Foo *launder(Foo *f) {
|
||||
return f;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
%{
|
||||
struct Unknown1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
%module(directors="1") director_frob;
|
||||
#pragma SWIG nowarn=470
|
||||
|
||||
%header %{
|
||||
#include <iostream>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
%module(directors="1",dirprot="1") director_nested
|
||||
#pragma SWIG nowarn=470
|
||||
|
||||
%{
|
||||
#include <string>
|
||||
|
|
@ -65,6 +66,11 @@
|
|||
{
|
||||
return "FooBar::get_name";
|
||||
}
|
||||
|
||||
const char *name()
|
||||
{
|
||||
return get_name();
|
||||
}
|
||||
|
||||
static FooBar *get_self(FooBar *a)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
%module(directors="1") director_wombat
|
||||
#pragma SWIG nowarn=470
|
||||
|
||||
%feature(director) Bar;
|
||||
%feature(director) Foo<int>;
|
||||
|
|
|
|||
|
|
@ -120,6 +120,11 @@
|
|||
T val;
|
||||
|
||||
Param(T v = 0): val(v) {
|
||||
name[0] = 0;
|
||||
name[1] = 0;
|
||||
name[2] = 0;
|
||||
name[3] = 0;
|
||||
name[4] = 0;
|
||||
}
|
||||
|
||||
operator T() const { return val; }
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
%module(directors="1") director_stl
|
||||
#pragma SWIG nowarn=470
|
||||
|
||||
%include "std_string.i"
|
||||
%include "std_pair.i"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue