Add some more std::string typemaps.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8632 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Matthias Köppe 2006-01-30 19:01:35 +00:00
commit fcd200a7b4

View file

@ -49,6 +49,16 @@ namespace std {
}
}
%typemap(in) string * (char* tempptr) {
if (gh_string_p($input)) {
tempptr = SWIG_scm2str($input);
$1 = new std::string(tempptr);
if (tempptr) SWIG_free(tempptr);
} else {
SWIG_exception(SWIG_TypeError, "string expected");
}
}
%typemap(out) string {
$result = gh_str02scm($1.c_str());
}
@ -57,4 +67,22 @@ namespace std {
$result = gh_str02scm($1->c_str());
}
%typemap(out) string * {
$result = gh_str02scm($1->c_str());
}
%typemap(varin) string {
if (gh_string_p($input)) {
char *tempptr = SWIG_scm2str($input);
$1 = std::string(tempptr);
if (tempptr) SWIG_free(tempptr);
} else {
SWIG_exception(SWIG_TypeError, "string expected");
}
}
%typemap(varout) string {
$result = gh_str02scm($1.c_str());
}
}