From: <vm...@us...> - 2009-06-20 14:08:54
|
Revision: 11291 http://swig.svn.sourceforge.net/swig/?rev=11291&view=rev Author: vmiklos Date: 2009-06-20 12:38:09 +0000 (Sat, 20 Jun 2009) Log Message: ----------- PHP: add directorin and directorout typemaps for std::string Modified Paths: -------------- branches/gsoc2009-vmiklos/Lib/php/std_string.i Modified: branches/gsoc2009-vmiklos/Lib/php/std_string.i =================================================================== --- branches/gsoc2009-vmiklos/Lib/php/std_string.i 2009-06-20 12:00:51 UTC (rev 11290) +++ branches/gsoc2009-vmiklos/Lib/php/std_string.i 2009-06-20 12:38:09 UTC (rev 11291) @@ -35,6 +35,11 @@ $1.assign(Z_STRVAL_PP($input), Z_STRLEN_PP($input)); %} + %typemap(directorout) string %{ + convert_to_string_ex($input); + $result.assign(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; %} @@ -43,6 +48,10 @@ ZVAL_STRINGL($result, const_cast<char*>($1.data()), $1.size(), 1); %} + %typemap(directorin) string %{ + ZVAL_STRINGL($input, const_cast<char*>($1.data()), $1.size(), 1); + %} + %typemap(out) const string & %{ ZVAL_STRINGL($result, const_cast<char*>($1->data()), $1->size(), 1); %} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |