add support for smart pointers + %extend
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6819 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ee3e53c9cd
commit
d0fad62e2c
5 changed files with 75 additions and 36 deletions
|
|
@ -259,16 +259,17 @@ class Allocate : public Dispatcher {
|
|||
|
||||
Node *c = firstChild(cls);
|
||||
String *kind = Getattr(cls,"kind");
|
||||
int mode;
|
||||
if (Strcmp(kind,"class") == 0) mode = PRIVATE;
|
||||
else mode = PUBLIC;
|
||||
int mode = PUBLIC;
|
||||
if (kind && (Strcmp(kind,"class") == 0)) mode = PRIVATE;
|
||||
|
||||
while (c) {
|
||||
if (Getattr(c,"error") || Getattr(c,"feature:ignore")) {
|
||||
c = nextSibling(c);
|
||||
continue;
|
||||
}
|
||||
if (Strcmp(nodeType(c),"cdecl") == 0) {
|
||||
if (Strcmp(nodeType(c),"extend") == 0) {
|
||||
Append(methods,c);
|
||||
} else if (Strcmp(nodeType(c),"cdecl") == 0) {
|
||||
if (!Getattr(c,"feature:ignore")) {
|
||||
String *storage = Getattr(c,"storage");
|
||||
if (!((Cmp(storage,"typedef") == 0))) {
|
||||
|
|
|
|||
|
|
@ -1055,6 +1055,9 @@ Language::memberfunctionHandler(Node *n) {
|
|||
}
|
||||
|
||||
String *fname = Swig_name_member(ClassPrefix, symname);
|
||||
if (Extend && SmartPointer) {
|
||||
Setattr(n,"classname",Getattr(CurrentClass,"allocate:smartpointerbase"));
|
||||
}
|
||||
/* Transformation */
|
||||
Swig_MethodToFunction(n,ClassType, Getattr(n,"template") ? 0 : Extend | SmartPointer);
|
||||
Setattr(n,"sym:name",fname);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue