fixes for director class naming when nested classes are used
This commit is contained in:
parent
504c2030bb
commit
e18044185e
7 changed files with 67 additions and 47 deletions
|
|
@ -203,26 +203,6 @@ public:
|
|||
return proxyname;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* directorClassName()
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
String *directorClassName(Node *n) {
|
||||
String *dirclassname;
|
||||
const char *attrib = "director:classname";
|
||||
|
||||
if (!(dirclassname = Getattr(n, attrib))) {
|
||||
String *classname = getClassPrefix();
|
||||
|
||||
dirclassname = NewStringf("SwigDirector_%s", classname);
|
||||
Setattr(n, attrib, dirclassname);
|
||||
}
|
||||
else
|
||||
dirclassname = Copy(dirclassname);
|
||||
|
||||
return dirclassname;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------
|
||||
* main()
|
||||
* ------------------------------------------------------------ */
|
||||
|
|
|
|||
|
|
@ -2373,6 +2373,7 @@ int Language::classDeclaration(Node *n) {
|
|||
String *oldDirectorClassName = DirectorClassName;
|
||||
String *oldNSpace = NSpace;
|
||||
Node *oldCurrentClass = CurrentClass;
|
||||
int dir = 0;
|
||||
|
||||
String *kind = Getattr(n, "kind");
|
||||
String *name = Getattr(n, "name");
|
||||
|
|
@ -2424,7 +2425,6 @@ int Language::classDeclaration(Node *n) {
|
|||
|
||||
/* Call classHandler() here */
|
||||
if (!ImportMode) {
|
||||
int dir = 0;
|
||||
if (directorsEnabled()) {
|
||||
int ndir = GetFlag(n, "feature:director");
|
||||
int nndir = GetFlag(n, "feature:nodirector");
|
||||
|
|
@ -2481,7 +2481,9 @@ int Language::classDeclaration(Node *n) {
|
|||
ClassPrefix = oldClassPrefix;
|
||||
Delete(ClassName);
|
||||
ClassName = oldClassName;
|
||||
Delete(DirectorClassName);
|
||||
if (dir) {
|
||||
Delete(DirectorClassName);
|
||||
}
|
||||
DirectorClassName = oldDirectorClassName;
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
|
@ -2749,7 +2751,7 @@ int Language::constructorHandler(Node *n) {
|
|||
Setattr(n, "handled_as_constructor", "1");
|
||||
}
|
||||
|
||||
Swig_ConstructorToFunction(n, NSpace, ClassType, none_comparison, director_ctor, CPlusPlus, Getattr(n, "template") ? 0 : Extend);
|
||||
Swig_ConstructorToFunction(n, NSpace, ClassType, none_comparison, director_ctor, CPlusPlus, Getattr(n, "template") ? 0 : Extend, DirectorClassName);
|
||||
Setattr(n, "sym:name", mrename);
|
||||
functionWrapper(n);
|
||||
Delete(mrename);
|
||||
|
|
@ -2771,7 +2773,7 @@ int Language::copyconstructorHandler(Node *n) {
|
|||
String *director_ctor = get_director_ctor_code(n, director_ctor_code,
|
||||
director_prot_ctor_code,
|
||||
abstracts);
|
||||
Swig_ConstructorToFunction(n, NSpace, ClassType, none_comparison, director_ctor, CPlusPlus, Getattr(n, "template") ? 0 : Extend);
|
||||
Swig_ConstructorToFunction(n, NSpace, ClassType, none_comparison, director_ctor, CPlusPlus, Getattr(n, "template") ? 0 : Extend, DirectorClassName);
|
||||
Setattr(n, "sym:name", mrename);
|
||||
functionWrapper(n);
|
||||
Delete(mrename);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue