From 26283a6945cbfc5787dd6e08f96290ec22f497f3 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 26 Aug 2004 21:57:36 +0000 Subject: [PATCH] throws typemaps added git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6159 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/csharp/std_string.i | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Lib/csharp/std_string.i b/Lib/csharp/std_string.i index 9eff76f35..73c164153 100644 --- a/Lib/csharp/std_string.i +++ b/Lib/csharp/std_string.i @@ -38,6 +38,10 @@ class string; %typemap(typecheck) string = char *; +%typemap(throws) string %{ + SWIG_CSharpThrowException(SWIG_CSharpException, $1.c_str()); +%} + // const string & %typemap(ctype) const string & "char *" %typemap(imtype) const string & "string" @@ -56,5 +60,9 @@ class string; %typemap(typecheck) const string & = char *; +%typemap(throws) const string & %{ + SWIG_CSharpThrowException(SWIG_CSharpException, $1.c_str()); +%} + }