PageRenderTime 27ms CodeModel.GetById 23ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/li_std_wstream.i

#
Swig | 66 lines | 49 code | 17 blank | 0 comment | 0 complexity | 9a4a9531cc085334941342edea33380b MD5 | raw file
 1%module li_std_wstream
 2
 3%{
 4#if defined(__SUNPRO_CC)
 5#pragma error_messages (off, badargtype2w) /* Formal argument ... is being passed extern "C" ... */
 6#endif
 7%}
 8
 9%inline %{
10  struct A;  
11%}
12
13%include <std_wiostream.i>
14%include <std_wsstream.i>
15
16
17
18%callback(1) A::bar;
19
20%inline %{
21
22  struct B {
23    virtual ~B()
24    {
25    }
26    
27  };
28  
29  struct A : B
30  {
31    void __add__(int a)
32    {
33    }
34
35    void __add__(double a)
36    {
37    }
38
39    static int bar(int a){
40      return a;
41    }
42
43    static int foo(int a, int (*pf)(int a))
44    {
45      return pf(a);
46    }
47
48
49    std::wostream& __rlshift__(std::wostream& out)
50    {
51      out << "A class";
52      return out;
53    }    
54  };
55%}
56
57%extend std::basic_ostream<wchar_t>{
58  extern "C"
59  std::basic_ostream<wchar_t>& 
60    operator<<(const A& a)
61    {
62      *self << "A class";
63      return *self;
64    }
65}
66