Allow returning std::strings with embedded null characters (why one would want to do this is beyond my understanding)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4337 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
63beb5b38a
commit
dc309054dd
2 changed files with 3 additions and 3 deletions
|
|
@ -44,11 +44,11 @@ namespace std {
|
|||
}
|
||||
|
||||
%typemap(out) string {
|
||||
$result = PyString_FromString($1.c_str());
|
||||
$result = PyString_FromStringAndSize($1.data(),$1.size());
|
||||
}
|
||||
|
||||
%typemap(out) const string & {
|
||||
$result = PyString_FromString($1->c_str());
|
||||
$result = PyString_FromStringAndSize($1->data(),$1->size());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue