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::string and const std::string&
8 * These are mapped to a C# String and are passed around by value.
10 * To use non-const std::string references use the following %apply. Note
11 * that they are passed by value.
12 * %apply const std::string & {std::string &};
13 * ----------------------------------------------------------------------------- */
26 %typemap(ctype) string "char *"
27 %typemap(imtype) string "string"
28 %typemap(cstype) string "string"
30 %typemap(csdirectorin) string "$iminput"
31 %typemap(csdirectorout) string "$cscall"
33 %typemap(in, canthrow=1) string
35 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
39 %typemap(out) string %{ $result = SWIG_csharp_string_callback($1.c_str()); %}
41 %typemap(directorout, canthrow=1) string
43 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
46 $result.assign($input); %}
48 %typemap(directorin) string %{ $input = SWIG_csharp_string_callback($1.c_str()); %}
50 %typemap(csin) string "$csinput"
51 %typemap(csout, excode=SWIGEXCODE) string {
52 string ret = $imcall;$excode
56 %typemap(typecheck) string = char *;
58 %typemap(throws, canthrow=1) string
59 %{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.c_str());
63 %typemap(ctype) const string & "char *"
64 %typemap(imtype) const string & "string"
65 %typemap(cstype) const string & "string"
67 %typemap(csdirectorin) const string & "$iminput"
68 %typemap(csdirectorout) const string & "$cscall"
70 %typemap(in, canthrow=1) const string &
72 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
75 std::string $1_str($input);
77 %typemap(out) const string & %{ $result = SWIG_csharp_string_callback($1->c_str()); %}
79 %typemap(csin) const string & "$csinput"
80 %typemap(csout, excode=SWIGEXCODE) const string & {
81 string ret = $imcall;$excode
85 %typemap(directorout, canthrow=1, warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const string &
87 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
90 /* possible thread/reentrant code problem */
91 static std::string $1_str;
95 %typemap(directorin) const string & %{ $input = SWIG_csharp_string_callback($1.c_str()); %}
97 %typemap(csvarin, excode=SWIGEXCODE2) const string & %{
101 %typemap(csvarout, excode=SWIGEXCODE2) const string & %{
103 string ret = $imcall;$excode
107 %typemap(typecheck) const string & = char *;
109 %typemap(throws, canthrow=1) const string &
110 %{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.c_str());