Fix virtual conversion operators for directors

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9410 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-10-04 17:34:08 +00:00
commit be89441352
5 changed files with 40 additions and 10 deletions

View file

@ -3266,11 +3266,17 @@ class CSHARP : public Language {
target = Swig_method_decl(decl, qualified_name, l, 0, 0); target = Swig_method_decl(decl, qualified_name, l, 0, 0);
String *rtype = SwigType_str(type, 0); String *rtype = SwigType_str(type, 0);
if (Getattr(n, "conversion_operator"))
Printf(w->def, "%s", target);
else
Printf(w->def, "%s %s", rtype, target); Printf(w->def, "%s %s", rtype, target);
Delete(qualified_name); Delete(qualified_name);
Delete(target); Delete(target);
target = Swig_method_decl(decl, name, l, 0, 1); target = Swig_method_decl(decl, name, l, 0, 1);
if (Getattr(n, "conversion_operator"))
Printf(declaration, " virtual %s", target);
else
Printf(declaration, " virtual %s %s", rtype, target); Printf(declaration, " virtual %s %s", rtype, target);
Delete(rtype); Delete(rtype);
Delete(target); Delete(target);

View file

@ -3366,11 +3366,17 @@ class JAVA : public Language {
target = Swig_method_decl(decl, qualified_name, l, 0, 0); target = Swig_method_decl(decl, qualified_name, l, 0, 0);
String *rtype = SwigType_str(type, 0); String *rtype = SwigType_str(type, 0);
if (Getattr(n, "conversion_operator"))
Printf(w->def, "%s", target);
else
Printf(w->def, "%s %s", rtype, target); Printf(w->def, "%s %s", rtype, target);
Delete(qualified_name); Delete(qualified_name);
Delete(target); Delete(target);
target = Swig_method_decl(decl, name, l, 0, 1); target = Swig_method_decl(decl, name, l, 0, 1);
if (Getattr(n, "conversion_operator"))
Printf(declaration, " virtual %s", target);
else
Printf(declaration, " virtual %s %s", rtype, target); Printf(declaration, " virtual %s %s", rtype, target);
Delete(rtype); Delete(rtype);
Delete(target); Delete(target);

View file

@ -1539,11 +1539,17 @@ public:
String *qualified_name = NewStringf("%s::%s", pclassname, name); String *qualified_name = NewStringf("%s::%s", pclassname, name);
target = Swig_method_decl(decl, qualified_name, l, 0, 0); target = Swig_method_decl(decl, qualified_name, l, 0, 0);
String *rtype = SwigType_str(type, 0); String *rtype = SwigType_str(type, 0);
if (Getattr(n, "conversion_operator"))
Printf(w->def, "%s {", target);
else
Printf(w->def, "%s %s {", rtype, target); Printf(w->def, "%s %s {", rtype, target);
Delete(qualified_name); Delete(qualified_name);
Delete(target); Delete(target);
/* header declaration */ /* header declaration */
target = Swig_method_decl(decl, name, l, 0, 1); target = Swig_method_decl(decl, name, l, 0, 1);
if (Getattr(n, "conversion_operator"))
Printf(declaration, " virtual %s;", target);
else
Printf(declaration, " virtual %s %s;\n", rtype, target); Printf(declaration, " virtual %s %s;\n", rtype, target);
Delete(target); Delete(target);

View file

@ -3394,11 +3394,17 @@ int PYTHON::classDirectorMethod(Node *n, Node *parent, String *super) {
String *qualified_name = NewStringf("%s::%s", pclassname, name); String *qualified_name = NewStringf("%s::%s", pclassname, name);
target = Swig_method_decl(decl, qualified_name, l, 0, 0); target = Swig_method_decl(decl, qualified_name, l, 0, 0);
String *rtype = SwigType_str(type, 0); String *rtype = SwigType_str(type, 0);
if (Getattr(n, "conversion_operator"))
Printf(w->def, "%s", target);
else
Printf(w->def, "%s %s", rtype, target); Printf(w->def, "%s %s", rtype, target);
Delete(qualified_name); Delete(qualified_name);
Delete(target); Delete(target);
/* header declaration */ /* header declaration */
target = Swig_method_decl(decl, name, l, 0, 1); target = Swig_method_decl(decl, name, l, 0, 1);
if (Getattr(n, "conversion_operator"))
Printf(declaration, " virtual %s", target);
else
Printf(declaration, " virtual %s %s", rtype, target); Printf(declaration, " virtual %s %s", rtype, target);
Delete(target); Delete(target);

View file

@ -2350,11 +2350,17 @@ public:
String *qualified_name = NewStringf("%s::%s", pclassname, name); String *qualified_name = NewStringf("%s::%s", pclassname, name);
target = Swig_method_decl(decl, qualified_name, l, 0, 0); target = Swig_method_decl(decl, qualified_name, l, 0, 0);
String *rtype = SwigType_str(type, 0); String *rtype = SwigType_str(type, 0);
if (Getattr(n, "conversion_operator"))
Printf(w->def, "%s", target);
else
Printf(w->def, "%s %s", rtype, target); Printf(w->def, "%s %s", rtype, target);
Delete(qualified_name); Delete(qualified_name);
Delete(target); Delete(target);
/* header declaration */ /* header declaration */
target = Swig_method_decl(decl, name, l, 0, 1); target = Swig_method_decl(decl, name, l, 0, 1);
if (Getattr(n, "conversion_operator"))
Printf(declaration, " virtual %s", target);
else
Printf(declaration, " virtual %s %s", rtype, target); Printf(declaration, " virtual %s %s", rtype, target);
Delete(target); Delete(target);