Add %csattributes for adding C# attributes to enum values, see docs for example.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11691 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
4ebb9b0db2
commit
5eeab68e21
4 changed files with 34 additions and 0 deletions
|
|
@ -1226,12 +1226,17 @@ public:
|
|||
|
||||
{
|
||||
EnumFeature enum_feature = decodeEnumFeature(parent);
|
||||
const String *csattributes = Getattr(n, "feature:cs:attributes");
|
||||
|
||||
if ((enum_feature == ProperEnum) && parent_name && !unnamedinstance) {
|
||||
// Wrap (non-anonymous) C/C++ enum with a proper C# enum
|
||||
// Emit the enum item.
|
||||
if (!GetFlag(n, "firstenumitem"))
|
||||
Printf(enum_code, ",\n");
|
||||
|
||||
if (csattributes)
|
||||
Printf(enum_code, " %s\n", csattributes);
|
||||
|
||||
Printf(enum_code, " %s", symname);
|
||||
|
||||
// Check for the %csconstvalue feature
|
||||
|
|
@ -1252,6 +1257,9 @@ public:
|
|||
const String *methodmods = Getattr(n, "feature:cs:methodmodifiers");
|
||||
methodmods = methodmods ? methodmods : (is_public(n) ? public_string : protected_string);
|
||||
|
||||
if (csattributes)
|
||||
Printf(enum_code, " %s\n", csattributes);
|
||||
|
||||
if ((enum_feature == TypesafeEnum) && parent_name && !unnamedinstance) {
|
||||
// Wrap (non-anonymous) enum using the typesafe enum pattern
|
||||
if (Getattr(n, "enumvalue")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue