Fix virtual conversion operators for directors

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2350,12 +2350,18 @@ public:
String *qualified_name = NewStringf("%s::%s", pclassname, name);
target = Swig_method_decl(decl, qualified_name, l, 0, 0);
String *rtype = SwigType_str(type, 0);
Printf(w->def, "%s %s", rtype, target);
if (Getattr(n, "conversion_operator"))
Printf(w->def, "%s", target);
else
Printf(w->def, "%s %s", rtype, target);
Delete(qualified_name);
Delete(target);
/* header declaration */
target = Swig_method_decl(decl, name, l, 0, 1);
Printf(declaration, " virtual %s %s", rtype, target);
if (Getattr(n, "conversion_operator"))
Printf(declaration, " virtual %s", target);
else
Printf(declaration, " virtual %s %s", rtype, target);
Delete(target);
// Get any exception classes in the throws typemap