std::string typemap modifications so they can be used with %apply for other string classes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13120 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
49b6c39d98
commit
12a9671440
13 changed files with 37 additions and 33 deletions
|
|
@ -51,7 +51,7 @@ Not using: lua_tolstring() as this is only found in Lua 5.1 & not 5.0.2
|
|||
%typemap(out) std::string
|
||||
%{ lua_pushlstring(L,$1.data(),$1.size()); SWIG_arg++;%}
|
||||
|
||||
%typemap(in,checkfn="lua_isstring") const std::string& (std::string temp)
|
||||
%typemap(in,checkfn="lua_isstring") const std::string& ($*1_ltype temp)
|
||||
%{temp.assign(lua_tostring(L,$input),lua_rawlen(L,$input)); $1=&temp;%}
|
||||
|
||||
%typemap(out) const std::string&
|
||||
|
|
@ -84,7 +84,7 @@ typemaps to tell SWIG what to do.
|
|||
*/
|
||||
|
||||
%typemap(in) std::string &INPUT=const std::string &;
|
||||
%typemap(in, numinputs=0) std::string &OUTPUT (std::string temp)
|
||||
%typemap(in, numinputs=0) std::string &OUTPUT ($*1_ltype temp)
|
||||
%{ $1 = &temp; %}
|
||||
%typemap(argout) std::string &OUTPUT
|
||||
%{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_arg++;%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue