Added typechecks for string and const string&.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8660 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
07d8cddbde
commit
e5e700b3c2
1 changed files with 8 additions and 0 deletions
|
|
@ -25,11 +25,19 @@ namespace std {
|
||||||
|
|
||||||
class string;
|
class string;
|
||||||
|
|
||||||
|
%typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) string {
|
||||||
|
$1 = ( Z_TYPE_PP($input) == IS_STRING ) ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
%typemap(in) string {
|
%typemap(in) string {
|
||||||
convert_to_string_ex($input);
|
convert_to_string_ex($input);
|
||||||
$1 = std::string(Z_STRVAL_PP($input),Z_STRLEN_PP($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) {
|
%typemap(in) const string & (std::string temp) {
|
||||||
convert_to_string_ex($input);
|
convert_to_string_ex($input);
|
||||||
temp = std::string(Z_STRVAL_PP($input),Z_STRLEN_PP($input));
|
temp = std::string(Z_STRVAL_PP($input),Z_STRLEN_PP($input));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue