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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-09-01 18:35:55 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050901183555-eq59uwhq8b62e44c
Tags: 1.3.24-1ubuntu4
* Use php5-dev instead of php4-dev, to kick php4 out of main.
* Drop support for generation of pike bindings, as nothing uses it,
  and swig is the only thing keeping pike7.6 in main (Ubuntu #13796)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
%module lib_std_wstring
2
 
 
3
 
%include "std_wstring.i"
4
 
 
5
 
 
6
 
%template(wstring) std::basic_string<wchar_t>;
7
 
%inline %{
8
 
 
9
 
struct A : std::wstring 
10
 
{
11
 
  A(const std::wstring& s) : std::wstring(s)
12
 
  {
13
 
  }
14
 
};
15
 
 
16
 
struct B 
17
 
{
18
 
  B(const std::wstring& s) : cname(0), name(s), a(s)
19
 
  {
20
 
  }
21
 
  
22
 
  char *cname;
23
 
  std::wstring name;
24
 
  A a;
25
 
 
26
 
};
27
 
 
28
 
 
29
 
wchar_t test_wcvalue(wchar_t x) {
30
 
   return x;
31
 
}
32
 
 
33
 
const wchar_t* test_ccvalue(const wchar_t* x) {
34
 
   return x;
35
 
}
36
 
 
37
 
wchar_t* test_cvalue(wchar_t* x) {
38
 
   return x;
39
 
}
40
 
  
41
 
 
42
 
std::wstring test_value(std::wstring x) {
43
 
   return x;
44
 
}
45
 
 
46
 
const std::wstring& test_const_reference(const std::wstring &x) {
47
 
   return x;
48
 
}
49
 
 
50
 
void test_pointer(std::wstring *x) {
51
 
}
52
 
 
53
 
std::wstring *test_pointer_out() {
54
 
   static std::wstring x = L"x";
55
 
   return &x;
56
 
}
57
 
 
58
 
void test_const_pointer(const std::wstring *x) {
59
 
}
60
 
 
61
 
const std::wstring *test_const_pointer_out() {
62
 
   static std::wstring x = L"x";
63
 
   return &x;
64
 
}
65
 
 
66
 
void test_reference(std::wstring &x) {
67
 
}
68
 
 
69
 
std::wstring& test_reference_out() {
70
 
   static std::wstring x = L"x";
71
 
   return x;
72
 
}
73
 
 
74
 
void test_throw() throw(std::wstring){
75
 
  static std::wstring x = L"x";
76
 
  
77
 
  throw x;
78
 
}
79
 
 
80
 
%}
81
 
 
82