std::string typemap modifications so they can be used with %apply for other string classes

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13120 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2012-05-26 06:33:49 +00:00
commit 12a9671440
13 changed files with 37 additions and 33 deletions

View file

@ -36,7 +36,7 @@ namespace std {
}
}
%typemap(in) const string & (std::string temp, char *tempptr) {
%typemap(in) const string & ($*1_ltype temp, char *tempptr) {
if (gh_string_p($input)) {
tempptr = SWIG_scm2str($input);
temp.assign(tempptr);
@ -50,7 +50,7 @@ namespace std {
%typemap(in) string * (char *tempptr) {
if (gh_string_p($input)) {
tempptr = SWIG_scm2str($input);
$1 = new std::string(tempptr);
$1 = new $*1_ltype(tempptr);
if (tempptr) SWIG_free(tempptr);
} else {
SWIG_exception(SWIG_TypeError, "string expected");