Remove extra underscore from generated director names to maintain prevent breaking languages that do not support nspace.
This commit is contained in:
parent
c786781e92
commit
3c12306b21
3 changed files with 15 additions and 4 deletions
|
|
@ -10,7 +10,7 @@ public:
|
||||||
|
|
||||||
#include "java_director_assumeoverride_wrap.h"
|
#include "java_director_assumeoverride_wrap.h"
|
||||||
bool isFuncOverridden(OverrideMe* f) {
|
bool isFuncOverridden(OverrideMe* f) {
|
||||||
SwigDirector__OverrideMe* director = dynamic_cast<SwigDirector__OverrideMe*>(f);
|
SwigDirector_OverrideMe* director = dynamic_cast<SwigDirector_OverrideMe*>(f);
|
||||||
if (!director) {
|
if (!director) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -358,7 +358,10 @@ Language::~Language() {
|
||||||
String *classname = Getattr(n, "sym:name");
|
String *classname = Getattr(n, "sym:name");
|
||||||
|
|
||||||
Replace(nspace, ".", "_", DOH_REPLACE_ANY);
|
Replace(nspace, ".", "_", DOH_REPLACE_ANY);
|
||||||
dirclassname = NewStringf("SwigDirector_%s_%s", nspace, classname);
|
if (Len(nspace) > 0)
|
||||||
|
dirclassname = NewStringf("SwigDirector_%s_%s", nspace, classname);
|
||||||
|
else
|
||||||
|
dirclassname = NewStringf("SwigDirector_%s", classname);
|
||||||
Setattr(n, attrib, dirclassname);
|
Setattr(n, attrib, dirclassname);
|
||||||
|
|
||||||
Delete(nspace);
|
Delete(nspace);
|
||||||
|
|
|
||||||
|
|
@ -940,7 +940,10 @@ int Swig_MethodToFunction(Node *n, const_String_or_char_ptr nspace, String *clas
|
||||||
/* If protected access (can only be if a director method) then call the extra public accessor method (language module must provide this) */
|
/* If protected access (can only be if a director method) then call the extra public accessor method (language module must provide this) */
|
||||||
String *explicit_qualifier_tmp = SwigType_namestr(Getattr(Getattr(parentNode(n), "typescope"), "qname"));
|
String *explicit_qualifier_tmp = SwigType_namestr(Getattr(Getattr(parentNode(n), "typescope"), "qname"));
|
||||||
explicitcall_name = NewStringf("%sSwigPublic", name);
|
explicitcall_name = NewStringf("%sSwigPublic", name);
|
||||||
explicit_qualifier = NewStringf("SwigDirector_%s_%s", directorScope, explicit_qualifier_tmp);
|
if (Len(directorScope) > 0)
|
||||||
|
explicit_qualifier = NewStringf("SwigDirector_%s_%s", directorScope, explicit_qualifier_tmp);
|
||||||
|
else
|
||||||
|
explicit_qualifier = NewStringf("SwigDirector_%s", explicit_qualifier_tmp);
|
||||||
Delete(explicit_qualifier_tmp);
|
Delete(explicit_qualifier_tmp);
|
||||||
} else {
|
} else {
|
||||||
explicit_qualifier = SwigType_namestr(Getattr(Getattr(parentNode(n), "typescope"), "qname"));
|
explicit_qualifier = SwigType_namestr(Getattr(Getattr(parentNode(n), "typescope"), "qname"));
|
||||||
|
|
@ -1174,12 +1177,17 @@ int Swig_ConstructorToFunction(Node *n, const_String_or_char_ptr nspace, String
|
||||||
Node *parent = Swig_methodclass(n);
|
Node *parent = Swig_methodclass(n);
|
||||||
int abstract = Getattr(parent, "abstracts") != 0;
|
int abstract = Getattr(parent, "abstracts") != 0;
|
||||||
String *name = Getattr(parent, "sym:name");
|
String *name = Getattr(parent, "sym:name");
|
||||||
String *directorname = NewStringf("SwigDirector_%s_%s", directorScope, name);
|
String *directorname;
|
||||||
String *action = NewStringEmpty();
|
String *action = NewStringEmpty();
|
||||||
String *tmp_none_comparison = Copy(none_comparison);
|
String *tmp_none_comparison = Copy(none_comparison);
|
||||||
String *director_call;
|
String *director_call;
|
||||||
String *nodirector_call;
|
String *nodirector_call;
|
||||||
|
|
||||||
|
if (Len(directorScope) > 0)
|
||||||
|
directorname = NewStringf("SwigDirector_%s_%s", directorScope, name);
|
||||||
|
else
|
||||||
|
directorname = NewStringf("SwigDirector_%s", name);
|
||||||
|
|
||||||
Replaceall(tmp_none_comparison, "$arg", "arg1");
|
Replaceall(tmp_none_comparison, "$arg", "arg1");
|
||||||
|
|
||||||
director_call = Swig_cppconstructor_director_call(directorname, directorparms);
|
director_call = Swig_cppconstructor_director_call(directorname, directorparms);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue