From 4cc915123204fc00c2019665a8138f6bfdbbf5d0 Mon Sep 17 00:00:00 2001 From: Kevin Ruland Date: Tue, 31 Jan 2006 16:38:48 +0000 Subject: [PATCH] Added typechecks for string and const string&. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8660 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/php4/std_string.i | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Lib/php4/std_string.i b/Lib/php4/std_string.i index 3388d06b4..e1ea9403f 100644 --- a/Lib/php4/std_string.i +++ b/Lib/php4/std_string.i @@ -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));