throws typemaps for std::wstring using C# patch #1799064 from David Piepgrass

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9956 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2007-09-25 21:35:24 +00:00
commit 23f8a0464c
3 changed files with 25 additions and 4 deletions

View file

@ -1,6 +1,13 @@
Version 1.3.32 (in progress)
============================
09/25/2007: wsfulton
[C#, Java] throws typemaps for std::wstring using C# patch #1799064 from David Piepgrass
09/24/2007: wsfulton
[Tcl] Apply #1771313 to fix bug #1650229 - fixes long long and unsigned long long
handling.
09/20/2007: olly
[Java] Eliminate some unnecessary uses of a temporary buffer
allocated using new[]. SF#1796609.

View file

@ -57,8 +57,8 @@ class wstring;
%typemap(typecheck) wstring = wchar_t *;
%typemap(throws, canthrow=1) wstring
%{ (void)$1;
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "wstring exception");
%{ std::string message($1.begin(), $1.end());
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, message.c_str());
return $null; %}
// const wstring &
@ -109,8 +109,8 @@ class wstring;
%typemap(typecheck) const wstring & = wchar_t *;
%typemap(throws, canthrow=1) const wstring &
%{ (void)$1;
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "wstring exception");
%{ std::string message($1.begin(), $1.end());
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, message.c_str());
return $null; %}
}

View file

@ -87,6 +87,13 @@ class wstring;
return $jnicall;
}
//%typemap(typecheck) wstring = wchar_t *;
%typemap(throws) wstring
%{ std::string message($1.begin(), $1.end());
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, message.c_str());
return $null; %}
// const wstring &
%typemap(jni) const wstring & "jstring"
%typemap(jtype) const wstring & "String"
@ -157,5 +164,12 @@ class wstring;
return $jnicall;
}
//%typemap(typecheck) const wstring & = wchar_t *;
%typemap(throws) const wstring &
%{ std::string message($1.begin(), $1.end());
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, message.c_str());
return $null; %}
}