1 /* -----------------------------------------------------------------------------
2 * See the LICENSE file for information on copyright, usage and redistribution
3 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
7 * Typemaps for std::wstring and const std::wstring&
8 * These are mapped to a C# String and are passed around by value.
10 * To use non-const std::wstring references use the following %apply. Note
11 * that they are passed by value.
12 * %apply const std::wstring & {std::wstring &};
13 * ----------------------------------------------------------------------------- */
28 %typemap(ctype, out="void *") wstring "wchar_t *"
29 %typemap(imtype, inattributes="[MarshalAs(UnmanagedType.LPWStr)]") wstring "string"
30 %typemap(cstype) wstring "string"
31 %typemap(csdirectorin) wstring "$iminput"
32 %typemap(csdirectorout) wstring "$cscall"
34 %typemap(in, canthrow=1) wstring
36 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0);
40 %typemap(out) wstring %{ $result = SWIG_csharp_wstring_callback($1.c_str()); %}
42 %typemap(directorout, canthrow=1) wstring
44 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0);
47 $result.assign($input); %}
49 %typemap(directorin) wstring %{ $input = SWIG_csharp_wstring_callback($1.c_str()); %}
51 %typemap(csin) wstring "$csinput"
52 %typemap(csout, excode=SWIGEXCODE) wstring {
53 string ret = $imcall;$excode
57 %typemap(typecheck) wstring = wchar_t *;
59 %typemap(throws, canthrow=1) wstring
60 %{ std::string message($1.begin(), $1.end());
61 SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, message.c_str());
65 %typemap(ctype, out="void *") const wstring & "wchar_t *"
66 %typemap(imtype, inattributes="[MarshalAs(UnmanagedType.LPWStr)]") const wstring & "string"
67 %typemap(cstype) const wstring & "string"
69 %typemap(csdirectorin) const wstring & "$iminput"
70 %typemap(csdirectorout) const wstring & "$cscall"
72 %typemap(in, canthrow=1) const wstring &
74 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0);
77 std::wstring $1_str($input);
79 %typemap(out) const wstring & %{ $result = SWIG_csharp_wstring_callback($1->c_str()); %}
81 %typemap(csin) const wstring & "$csinput"
82 %typemap(csout, excode=SWIGEXCODE) const wstring & {
83 string ret = $imcall;$excode
87 %typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const wstring &
89 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null wstring", 0);
92 /* possible thread/reentrant code problem */
93 static std::wstring $1_str;
97 %typemap(directorin) const wstring & %{ $input = SWIG_csharp_wstring_callback($1.c_str()); %}
99 %typemap(csvarin, excode=SWIGEXCODE2) const wstring & %{
103 %typemap(csvarout, excode=SWIGEXCODE2) const wstring & %{
105 string ret = $imcall;$excode
109 %typemap(typecheck) const wstring & = wchar_t *;
111 %typemap(throws, canthrow=1) const wstring &
112 %{ std::string message($1.begin(), $1.end());
113 SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, message.c_str());