Fix %csmethodmodifiers for smart pointers
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9494 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
cbe7439018
commit
bd7b75b57f
1 changed files with 17 additions and 7 deletions
|
|
@ -1917,9 +1917,20 @@ class CSHARP : public Language {
|
|||
Printf(function_code, " %s\n", csattributes);
|
||||
const String *methodmods = Getattr(n,"feature:cs:methodmodifiers");
|
||||
if (methodmods) {
|
||||
Printf(function_code, " %s ", methodmods);
|
||||
if (is_smart_pointer()) {
|
||||
// Smart pointer classes do not mirror the inheritance hierarchy of the underlying pointer type, so no virtual/override/new required.
|
||||
String *mmods = Copy(methodmods);
|
||||
Replaceall(mmods, "override", "");
|
||||
Replaceall(mmods, "virtual", "");
|
||||
Replaceall(mmods, "new", "");
|
||||
Chop(mmods); // remove trailing whitespace
|
||||
Printf(function_code, " %s ", mmods);
|
||||
Delete(mmods);
|
||||
} else {
|
||||
Printf(function_code, " %s ", methodmods);
|
||||
}
|
||||
} else {
|
||||
methodmods = (!is_public(n) ? protected_string : public_string);
|
||||
methodmods = (is_public(n) ? public_string : protected_string);
|
||||
Printf(function_code, " %s ", methodmods);
|
||||
if (!is_smart_pointer()) {
|
||||
// Smart pointer classes do not mirror the inheritance hierarchy of the underlying pointer type, so no virtual/override/new required.
|
||||
|
|
@ -2062,12 +2073,11 @@ class CSHARP : public Language {
|
|||
Printf(proxy_class_code, " %s\n", csattributes);
|
||||
const String *methodmods = Getattr(n,"feature:cs:methodmodifiers");
|
||||
if (!methodmods)
|
||||
methodmods = (!is_public(n) ? protected_string : public_string);
|
||||
methodmods = (is_public(n) ? public_string : protected_string);
|
||||
Printf(proxy_class_code, " %s %s%s %s {", methodmods, static_flag ? "static " : "", variable_type, variable_name);
|
||||
}
|
||||
generate_property_declaration_flag = false;
|
||||
|
||||
|
||||
if(setter_flag) {
|
||||
// Setter method
|
||||
Swig_typemap_attach_parms("csvarin", l, NULL);
|
||||
|
|
@ -2137,7 +2147,7 @@ class CSHARP : public Language {
|
|||
if (csattributes)
|
||||
Printf(function_code, " %s\n", csattributes);
|
||||
const String *methodmods = Getattr(n,"feature:cs:methodmodifiers");
|
||||
methodmods = methodmods ? methodmods : (!is_public(n) ? protected_string : public_string);
|
||||
methodmods = methodmods ? methodmods : (is_public(n) ? public_string : protected_string);
|
||||
Printf(function_code, " %s %s(", methodmods, proxy_class_name);
|
||||
Printv(imcall, imclass_name, ".", mangled_overname, "(", NIL);
|
||||
|
||||
|
|
@ -2394,7 +2404,7 @@ class CSHARP : public Language {
|
|||
if (csattributes)
|
||||
Printf(function_code, " %s\n", csattributes);
|
||||
const String *methodmods = Getattr(n,"feature:cs:methodmodifiers");
|
||||
methodmods = methodmods ? methodmods : (!is_public(n) ? protected_string : public_string);
|
||||
methodmods = methodmods ? methodmods : (is_public(n) ? public_string : protected_string);
|
||||
Printf(function_code, " %s static %s %s(", methodmods, return_type, func_name);
|
||||
Printv(imcall, imclass_name, ".", overloaded_name, "(", NIL);
|
||||
|
||||
|
|
@ -2490,7 +2500,7 @@ class CSHARP : public Language {
|
|||
Printf(module_class_code, " %s\n", csattributes);
|
||||
const String *methodmods = Getattr(n,"feature:cs:methodmodifiers");
|
||||
if (!methodmods)
|
||||
methodmods = (!is_public(n) ? protected_string : public_string);
|
||||
methodmods = (is_public(n) ? public_string : protected_string);
|
||||
Printf(module_class_code, " %s static %s %s {", methodmods, variable_type, variable_name);
|
||||
}
|
||||
generate_property_declaration_flag = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue