PageRenderTime 15ms CodeModel.GetById 8ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Swig | 89 lines | 63 code | 26 blank | 0 comment | 0 complexity | cea09b6aa71e0e82fe69ac3f5d4b842c MD5 | raw file
 1%module li_std_wstring
 2%include <std_basic_string.i>
 3%include <std_wstring.i>
 4
 5
 6%inline %{
 7
 8struct A : std::wstring 
 9{
10  A(const std::wstring& s) : std::wstring(s)
11  {
12  }
13};
14
15struct B 
16{
17  B(const std::wstring& s) : cname(0), name(s), a(s)
18  {
19  }
20  
21  char *cname;
22  std::wstring name;
23  A a;
24
25};
26 
27
28wchar_t test_wcvalue(wchar_t x) {
29   return x;
30}
31
32const wchar_t* test_ccvalue(const wchar_t* x) {
33   return x;
34}
35
36wchar_t* test_cvalue(wchar_t* x) {
37   return x;
38}
39  
40
41std::wstring test_value(std::wstring x) {
42   return x;
43}
44
45const std::wstring& test_const_reference(const std::wstring &x) {
46   return x;
47}
48
49void test_pointer(std::wstring *x) {
50}
51
52std::wstring *test_pointer_out() {
53   static std::wstring x = L"x";
54   return &x;
55}
56
57void test_const_pointer(const std::wstring *x) {
58}
59
60const std::wstring *test_const_pointer_out() {
61   static std::wstring x = L"x";
62   return &x;
63}
64
65void test_reference(std::wstring &x) {
66}
67
68std::wstring& test_reference_out() {
69   static std::wstring x = L"x";
70   return x;
71}
72
73#if defined(_MSC_VER)
74  #pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
75#endif
76
77void test_throw() throw(std::wstring){
78  static std::wstring x = L"x";
79  
80  throw x;
81}
82
83#if defined(_MSC_VER)
84  #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
85#endif
86
87%}
88
89