~ubuntu-branches/ubuntu/hardy/swig1.3/hardy

« back to all changes in this revision

Viewing changes to Examples/test-suite/python/li_std_wstream.i

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%module li_std_wstream
 
2
 
 
3
%inline %{
 
4
  struct A;  
 
5
%}
 
6
 
 
7
%include <std_wiostream.i>
 
8
%include <std_wsstream.i>
 
9
 
 
10
 
 
11
 
 
12
%callback(1) A::bar;
 
13
 
 
14
%inline %{
 
15
 
 
16
  struct B {
 
17
    virtual ~B()
 
18
    {
 
19
    }
 
20
    
 
21
  };
 
22
  
 
23
  struct A : B
 
24
  {
 
25
    void __add__(int a)
 
26
    {
 
27
    }
 
28
 
 
29
    void __add__(double a)
 
30
    {
 
31
    }
 
32
 
 
33
    static int bar(int a){
 
34
      return a;
 
35
    }
 
36
 
 
37
    static int foo(int a, int (*pf)(int a))
 
38
    {
 
39
      return pf(a);
 
40
    }
 
41
 
 
42
 
 
43
    std::wostream& __rlshift__(std::wostream& out)
 
44
    {
 
45
      out << "A class";
 
46
      return out;
 
47
    }    
 
48
  };
 
49
%}
 
50
 
 
51
%extend std::basic_ostream<wchar_t>{
 
52
  std::basic_ostream<wchar_t>& 
 
53
    operator<<(const A& a)
 
54
    {
 
55
      *self << "A class";
 
56
      return *self;
 
57
    }
 
58
}
 
59