adding more cases
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6814 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
749870a799
commit
52fe09a938
10 changed files with 79 additions and 14 deletions
|
|
@ -1,13 +1,26 @@
|
|||
%module li_std_stream
|
||||
|
||||
%inline %{
|
||||
struct A;
|
||||
%}
|
||||
|
||||
%include <std_iostream.i>
|
||||
%include <std_sstream.i>
|
||||
|
||||
|
||||
%pythoncallback(1) A::bar;
|
||||
|
||||
%callback(1) A::bar;
|
||||
|
||||
%inline %{
|
||||
|
||||
struct A
|
||||
struct B {
|
||||
virtual ~B()
|
||||
{
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct A : B
|
||||
{
|
||||
void __add__(int a)
|
||||
{
|
||||
|
|
@ -25,8 +38,22 @@
|
|||
{
|
||||
return pf(a);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
std::ostream& __rlshift__(std::ostream& out)
|
||||
{
|
||||
out << "A class";
|
||||
return out;
|
||||
}
|
||||
};
|
||||
%}
|
||||
|
||||
%extend std::basic_ostream<char, std::char_traits<char> >{
|
||||
std::basic_ostream<char, std::char_traits<char> >&
|
||||
operator<<(const A& a)
|
||||
{
|
||||
*self << "A class";
|
||||
return *self;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue