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
This commit is contained in:
parent
138c3bc76e
commit
4cc9151232
1 changed files with 8 additions and 0 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue