git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11434 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8ec7035eee
commit
0249eea389
53 changed files with 2838 additions and 66 deletions
|
|
@ -35,6 +35,11 @@ namespace std {
|
|||
$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 @@ namespace std {
|
|||
ZVAL_STRINGL($result, const_cast<char*>($1.data()), $1.size(), 1);
|
||||
%}
|
||||
|
||||
%typemap(directorin) string %{
|
||||
ZVAL_STRINGL($input, const_cast<char*>($1_name.data()), $1_name.size(), 1);
|
||||
%}
|
||||
|
||||
%typemap(out) const string & %{
|
||||
ZVAL_STRINGL($result, const_cast<char*>($1->data()), $1->size(), 1);
|
||||
%}
|
||||
|
|
@ -63,6 +72,14 @@ namespace std {
|
|||
$1 = &temp;
|
||||
%}
|
||||
|
||||
%typemap(directorout) string & (std::string *temp) %{
|
||||
convert_to_string_ex($input);
|
||||
temp = new std::string;
|
||||
temp->assign(Z_STRVAL_PP($input), Z_STRLEN_PP($input));
|
||||
swig_acquire_ownership(temp);
|
||||
$result = temp;
|
||||
%}
|
||||
|
||||
%typemap(argout) string & %{
|
||||
ZVAL_STRINGL(*($input), const_cast<char*>($1->data()), $1->size(), 1);
|
||||
%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue