Two additional special variable are expanded in %exception - $parentname
and $parentsymname git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13870 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
77d9ad5354
commit
2598a1daf2
5 changed files with 68 additions and 5 deletions
|
|
@ -15,13 +15,13 @@ public class special_variables_runme {
|
|||
public static void main(String argv[])
|
||||
{
|
||||
verify(special_variables.ExceptionVars(1.0, 2.0),
|
||||
"result = Space::exceptionvars(arg1,arg2); Space::exceptionvars ExceptionVars Java_special_1variables_special_1variablesJNI_ExceptionVars");
|
||||
"result = Space::exceptionvars(arg1,arg2); Space::exceptionvars ExceptionVars Java_special_1variables_special_1variablesJNI_ExceptionVars ");
|
||||
|
||||
verify(special_variables.overloadedmethod(),
|
||||
"result = Space::overloadedmethod(); Space::overloadedmethod overloadedmethod __SWIG_1 Java_special_1variables_special_1variablesJNI_overloadedmethod_1_1SWIG_11");
|
||||
"result = Space::overloadedmethod(); Space::overloadedmethod overloadedmethod __SWIG_1 Java_special_1variables_special_1variablesJNI_overloadedmethod_1_1SWIG_11 ");
|
||||
|
||||
verify(special_variables.overloadedmethod(10.0),
|
||||
"result = Space::overloadedmethod(arg1); Space::overloadedmethod overloadedmethod __SWIG_0 Java_special_1variables_special_1variablesJNI_overloadedmethod_1_1SWIG_10");
|
||||
"result = Space::overloadedmethod(arg1); Space::overloadedmethod overloadedmethod __SWIG_0 Java_special_1variables_special_1variablesJNI_overloadedmethod_1_1SWIG_10 ");
|
||||
|
||||
ABC a = new ABC(0, 0.0);
|
||||
verify(special_variables.getDeclaration(), "SpaceNamespace::ABC::ABC(int,double) SpaceNamespace::ABC::ABC(int,double)");
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ std::string ExceptionVars(double i, double j) {
|
|||
result = $symname(1.0,2.0); // Should expand to ExceptionVars
|
||||
result = $name(3.0,4.0); // Should expand to Space::exceptionvars
|
||||
// above will not compile if the variables are not expanded properly
|
||||
result = "$action $name $symname $overname $wrapname";
|
||||
result = "$action $name $symname $overname $wrapname $parentclassname $parentclasssymname";
|
||||
%}
|
||||
%inline %{
|
||||
namespace Space {
|
||||
|
|
@ -49,7 +49,7 @@ std::string exceptionvars(double i, double j) {
|
|||
result = $name();
|
||||
result = $name(2.0);
|
||||
// above will not compile if the variables are not expanded properly
|
||||
result = "$action $name $symname $overname $wrapname";
|
||||
result = "$action $name $symname $overname $wrapname $parentclassname $parentclasssymname";
|
||||
// $decl
|
||||
%}
|
||||
|
||||
|
|
@ -104,3 +104,36 @@ struct DirectorTest {
|
|||
virtual ~DirectorTest() {}
|
||||
};
|
||||
%}
|
||||
|
||||
|
||||
/////////////////////////////////// parentclasssymname parentclassname /////////////////////////////////
|
||||
%exception instance_def {
|
||||
$action
|
||||
$parentclasssymname_aaa();
|
||||
$parentclassname_bbb();
|
||||
// above will not compile if the variables are not expanded properly
|
||||
}
|
||||
%exception static_def {
|
||||
$action
|
||||
$parentclasssymname_aaa();
|
||||
$parentclassname_bbb();
|
||||
// above will not compile if the variables are not expanded properly
|
||||
}
|
||||
|
||||
%{
|
||||
void DEFNewName_aaa() {}
|
||||
namespace SpaceNamespace {
|
||||
void DEF_bbb() {}
|
||||
}
|
||||
%}
|
||||
|
||||
%rename(DEFNewName) DEF;
|
||||
%inline %{
|
||||
namespace SpaceNamespace {
|
||||
struct DEF : ABC {
|
||||
void instance_def() {}
|
||||
static void static_def() {}
|
||||
};
|
||||
}
|
||||
%}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue