add 'self' attribute for later use
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7981 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
32cbb57ab6
commit
cbca8a3e88
2 changed files with 10 additions and 0 deletions
|
|
@ -772,6 +772,7 @@ Swig_MethodToFunction(Node *n, String *classname, int flags) {
|
||||||
}
|
}
|
||||||
SwigType_add_pointer(type);
|
SwigType_add_pointer(type);
|
||||||
p = NewParm(type,"self");
|
p = NewParm(type,"self");
|
||||||
|
Setattr(p,"self","1");
|
||||||
Setattr(p,"hidden","1");
|
Setattr(p,"hidden","1");
|
||||||
/*
|
/*
|
||||||
Disable the 'this' ownership in 'self' to manage inplace
|
Disable the 'this' ownership in 'self' to manage inplace
|
||||||
|
|
@ -1111,6 +1112,7 @@ Swig_DestructorToFunction(Node *n, String *classname, int cplus, int flags)
|
||||||
type = NewString(classname);
|
type = NewString(classname);
|
||||||
SwigType_add_pointer(type);
|
SwigType_add_pointer(type);
|
||||||
p = NewParm(type,"self");
|
p = NewParm(type,"self");
|
||||||
|
Setattr(p,"self","1");
|
||||||
Setattr(p,"wrap:disown","1");
|
Setattr(p,"wrap:disown","1");
|
||||||
Delete(type);
|
Delete(type);
|
||||||
type = NewString("void");
|
type = NewString("void");
|
||||||
|
|
@ -1190,6 +1192,7 @@ Swig_MembersetToFunction(Node *n, String *classname, int flags) {
|
||||||
t = NewString(classname);
|
t = NewString(classname);
|
||||||
SwigType_add_pointer(t);
|
SwigType_add_pointer(t);
|
||||||
parms = NewParm(t,"self");
|
parms = NewParm(t,"self");
|
||||||
|
Setattr(parms,"self","1");
|
||||||
Delete(t);
|
Delete(t);
|
||||||
|
|
||||||
ty = Swig_wrapped_var_type(type);
|
ty = Swig_wrapped_var_type(type);
|
||||||
|
|
@ -1273,6 +1276,7 @@ Swig_MembergetToFunction(Node *n, String *classname, int flags) {
|
||||||
t = NewString(classname);
|
t = NewString(classname);
|
||||||
SwigType_add_pointer(t);
|
SwigType_add_pointer(t);
|
||||||
parms = NewParm(t,"self");
|
parms = NewParm(t,"self");
|
||||||
|
Setattr(parms,"self","1");
|
||||||
Delete(t);
|
Delete(t);
|
||||||
|
|
||||||
ty = Swig_wrapped_var_type(type);
|
ty = Swig_wrapped_var_type(type);
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ Parm *CopyParm(Parm *p) {
|
||||||
String *alttype = Getattr(p,"alttype");
|
String *alttype = Getattr(p,"alttype");
|
||||||
String *byname = Getattr(p, "arg:byname");
|
String *byname = Getattr(p, "arg:byname");
|
||||||
String *compactdefargs = Getattr(p, "compactdefargs");
|
String *compactdefargs = Getattr(p, "compactdefargs");
|
||||||
|
String *self = Getattr(p, "self");
|
||||||
|
|
||||||
if (t) {
|
if (t) {
|
||||||
SwigType *nt = Copy(t);
|
SwigType *nt = Copy(t);
|
||||||
|
|
@ -109,6 +110,11 @@ Parm *CopyParm(Parm *p) {
|
||||||
Setattr(np, "compactdefargs", str);
|
Setattr(np, "compactdefargs", str);
|
||||||
Delete(str);
|
Delete(str);
|
||||||
}
|
}
|
||||||
|
if (self) {
|
||||||
|
String *str = Copy(self);
|
||||||
|
Setattr(np, "self", str);
|
||||||
|
Delete(str);
|
||||||
|
}
|
||||||
|
|
||||||
Setfile(np,Getfile(p));
|
Setfile(np,Getfile(p));
|
||||||
Setline(np,Getline(p));
|
Setline(np,Getline(p));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue