%javamethodmodifiers (java) and %csmethodmodifiers (C#) operate slightly differently.
Previously this had to be present to set the method modifiers. Now this feature is only used if it exists for the method being wrapped. The default is "public" as previous however, when wrapping protected director methods it is "protected". git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5553 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
87cd33a6d6
commit
2e0346a3a6
2 changed files with 27 additions and 6 deletions
|
|
@ -22,6 +22,8 @@ char cvsroot_csharp_cxx[] = "$Header$";
|
|||
class CSHARP : public Language {
|
||||
static const char *usage;
|
||||
const String *empty_string;
|
||||
const String *public_string;
|
||||
const String *protected_string;
|
||||
|
||||
Hash *swig_types_hash;
|
||||
File *f_runtime;
|
||||
|
|
@ -71,6 +73,8 @@ class CSHARP : public Language {
|
|||
|
||||
CSHARP() :
|
||||
empty_string(NewString("")),
|
||||
public_string(NewString("public")),
|
||||
protected_string(NewString("protected")),
|
||||
|
||||
swig_types_hash(NULL),
|
||||
f_runtime(NULL),
|
||||
|
|
@ -1262,7 +1266,9 @@ class CSHARP : public Language {
|
|||
}
|
||||
|
||||
/* Start generating the proxy function */
|
||||
Printf(function_code, " %s ", Getattr(n,"feature:cs:methodmodifiers"));
|
||||
const String *methodmods = Getattr(n,"feature:cs:methodmodifiers");
|
||||
methodmods = methodmods ? methodmods : (is_protected(n) ? protected_string : public_string);
|
||||
Printf(function_code, " %s ", methodmods);
|
||||
if (static_flag)
|
||||
Printf(function_code, "static ");
|
||||
if (Getattr(n,"virtual:derived"))
|
||||
|
|
@ -1416,7 +1422,10 @@ class CSHARP : public Language {
|
|||
String *overloaded_name = getOverloadedName(n);
|
||||
String *imcall = NewString("");
|
||||
|
||||
Printf(proxy_class_code, " %s %s(", Getattr(n,"feature:cs:methodmodifiers"), proxy_class_name);
|
||||
const String *methodmods = Getattr(n,"feature:cs:methodmodifiers");
|
||||
methodmods = methodmods ? methodmods : (is_protected(n) ? protected_string : public_string);
|
||||
methodmods = methodmods ? methodmods : public_string;
|
||||
Printf(proxy_class_code, " %s %s(", methodmods, proxy_class_name);
|
||||
Printv(imcall, " : this(", imclass_name, ".", Swig_name_construct(overloaded_name), "(", NIL);
|
||||
|
||||
/* Attach the non-standard typemaps to the parameter list */
|
||||
|
|
@ -1664,7 +1673,9 @@ class CSHARP : public Language {
|
|||
}
|
||||
|
||||
/* Start generating the function */
|
||||
Printf(function_code, " %s static %s %s(", Getattr(n,"feature:cs:methodmodifiers"), return_type, func_name);
|
||||
const String *methodmods = Getattr(n,"feature:cs:methodmodifiers");
|
||||
methodmods = methodmods ? methodmods : (is_protected(n) ? protected_string : public_string);
|
||||
Printf(function_code, " %s static %s %s(", methodmods, return_type, func_name);
|
||||
Printv(imcall, imclass_name, ".", overloaded_name, "(", NIL);
|
||||
|
||||
/* Get number of required and total arguments */
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ typedef DOH UpcallData;
|
|||
class JAVA : public Language {
|
||||
static const char *usage;
|
||||
const String *empty_string;
|
||||
const String *public_string;
|
||||
const String *protected_string;
|
||||
|
||||
Hash *swig_types_hash;
|
||||
File *f_runtime;
|
||||
|
|
@ -92,6 +94,8 @@ class JAVA : public Language {
|
|||
|
||||
JAVA() :
|
||||
empty_string(NewString("")),
|
||||
public_string(NewString("public")),
|
||||
protected_string(NewString("protected")),
|
||||
|
||||
swig_types_hash(NULL),
|
||||
f_runtime(NULL),
|
||||
|
|
@ -1617,7 +1621,9 @@ class JAVA : public Language {
|
|||
}
|
||||
|
||||
/* Start generating the proxy function */
|
||||
Printf(function_code, " %s ", Getattr(n,"feature:java:methodmodifiers"));
|
||||
const String *methodmods = Getattr(n,"feature:java:methodmodifiers");
|
||||
methodmods = methodmods ? methodmods : (is_protected(n) ? protected_string : public_string);
|
||||
Printf(function_code, " %s ", methodmods);
|
||||
if (static_flag)
|
||||
Printf(function_code, "static ");
|
||||
Printf(function_code, "%s %s(", return_type, proxy_function_name);
|
||||
|
|
@ -1735,7 +1741,9 @@ class JAVA : public Language {
|
|||
String *mangled_overname = Swig_name_construct(overloaded_name);
|
||||
String *imcall = NewString("");
|
||||
|
||||
Printf(proxy_class_code, " %s %s(", Getattr(n,"feature:java:methodmodifiers"), proxy_class_name);
|
||||
const String *methodmods = Getattr(n,"feature:java:methodmodifiers");
|
||||
methodmods = methodmods ? methodmods : (is_protected(n) ? protected_string : public_string);
|
||||
Printf(proxy_class_code, " %s %s(", methodmods, proxy_class_name);
|
||||
Printv(imcall, "this(", imclass_name, ".", mangled_overname, "(", NIL);
|
||||
|
||||
/* Attach the non-standard typemaps to the parameter list */
|
||||
|
|
@ -1988,7 +1996,9 @@ class JAVA : public Language {
|
|||
}
|
||||
|
||||
/* Start generating the function */
|
||||
Printf(function_code, " %s static %s %s(", Getattr(n,"feature:java:methodmodifiers"), return_type, func_name);
|
||||
const String *methodmods = Getattr(n,"feature:java:methodmodifiers");
|
||||
methodmods = methodmods ? methodmods : (is_protected(n) ? protected_string : public_string);
|
||||
Printf(function_code, " %s static %s %s(", methodmods, return_type, func_name);
|
||||
Printv(imcall, imclass_name, ".", overloaded_name, "(", NIL);
|
||||
|
||||
/* Get number of required and total arguments */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue