Added typechecks for string and const string&.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8660 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Kevin Ruland 2006-01-31 16:38:48 +00:00
commit e5e700b3c2

View file

@ -25,11 +25,19 @@ namespace std {
class string;
%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) string {
$1 = ( Z_TYPE_PP($input) == IS_STRING ) ? 1 : 0;
}
%typemap(in) string {
convert_to_string_ex($input);
$1 = std::string(Z_STRVAL_PP($input),Z_STRLEN_PP($input));
}
%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) const string& {
$1 = ( Z_TYPE_PP($input) == IS_STRING ) ? 1 : 0;
}
%typemap(in) const string & (std::string temp) {
convert_to_string_ex($input);
temp = std::string(Z_STRVAL_PP($input),Z_STRLEN_PP($input));