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