Director %ignore test case

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9316 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-09-20 20:39:50 +00:00
commit 05556f43b8
3 changed files with 87 additions and 0 deletions

View file

@ -128,6 +128,7 @@ CPP_TEST_CASES += \
director_exception \
director_frob \
director_finalizer \
director_ignore \
director_namespace_clash \
director_nested \
director_primitives \

View file

@ -0,0 +1,34 @@
using System;
namespace director_ignoreNamespace {
public class runme
{
static void Main()
{
runme r = new runme();
r.run();
}
void run()
{
}
}
class DIgnoresDerived : DIgnores
{
public DIgnoresDerived() : base()
{
}
// These will give a warning if the %ignore is not working
public virtual void OverloadedMethod(int n, int xoffset, int yoffset) {}
public virtual void OverloadedMethod(int n, int xoffset) {}
public virtual void OverloadedMethod(int n) {}
public virtual void ProtectedMethod(int n, int xoffset, int yoffset) {}
public virtual void ProtectedMethod(int n, int xoffset) {}
public virtual void ProtectedMethod(int n) {}
}
}

View file

@ -0,0 +1,52 @@
%module(directors="1") director_ignore
%include "std_string.i"
%feature("director");
%ignore OverloadedMethod(int n, int xoffset = 0, int yoffset = 0);
%ignore ProtectedMethod(int n, int xoffset = 0, int yoffset = 0);
%ignore DIgnoreConstructor(bool b);
%ignore DIgnoreOnlyConstructor(bool b);
%inline %{
#include <string>
class DIgnores
{
public:
virtual ~DIgnores() {}
virtual void OverloadedMethod(int n, int xoffset = 0, int yoffset = 0) {}
virtual void OverloadedMethod(bool b) {}
protected:
virtual void ProtectedMethod(int n, int xoffset = 0, int yoffset = 0) {}
};
class DIgnoreConstructor
{
public:
virtual ~DIgnoreConstructor() {}
DIgnoreConstructor(std::string s, int i) {}
DIgnoreConstructor(bool b) {}
};
class DIgnoreOnlyConstructor
{
public:
virtual ~DIgnoreOnlyConstructor() {}
DIgnoreOnlyConstructor(bool b) {}
};
/*
class DAbstractIgnores
{
public:
virtual ~DAbstractIgnores() {}
virtual void OverloadedMethod(int n, int xoffset = 0, int yoffset = 0) = 0;
virtual void OverloadedMethod(bool b) = 0;
};
*/
%}