summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/enum_definition.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/eolian_mono/eolian/mono/enum_definition.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/enum_definition.hh31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/enum_definition.hh b/src/bin/eolian_mono/eolian/mono/enum_definition.hh
index 96595d3..2c304fc 100644
--- a/src/bin/eolian_mono/eolian/mono/enum_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/enum_definition.hh
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1#ifndef EOLIAN_MONO_ENUM_DEFINITION_HH 16#ifndef EOLIAN_MONO_ENUM_DEFINITION_HH
2#define EOLIAN_MONO_ENUM_DEFINITION_HH 17#define EOLIAN_MONO_ENUM_DEFINITION_HH
3 18
@@ -25,15 +40,21 @@ struct enum_definition_generator
25 if(!name_helpers::open_namespaces(sink, enum_.namespaces, context)) 40 if(!name_helpers::open_namespaces(sink, enum_.namespaces, context))
26 return false; 41 return false;
27 42
28 if(!as_generator(documentation).generate(sink, enum_, context)) 43 std::string enum_name = name_helpers::typedecl_managed_name(enum_);
29 return false; 44 std::string flags_attribute;
45
46 // CA1717
47 if (utils::ends_with(enum_name, "Flags") || utils::ends_with(enum_name, "InputHints")) // Special provision while Text api is revamped
48 flags_attribute = "[Flags]";
30 49
31 if(!as_generator 50 if(!as_generator
32 ( 51 (
33 "[Efl.Eo.BindingEntity]\n" 52 documentation
34 "public enum " << string << "\n{\n" 53 << flags_attribute
54 << "[Efl.Eo.BindingEntity]\n"
55 "public enum " << enum_name << "\n{\n"
35 ) 56 )
36 .generate(sink, name_helpers::typedecl_managed_name(enum_), context)) 57 .generate(sink, enum_, context))
37 return false; 58 return false;
38 59
39 // iterate enum fiels 60 // iterate enum fiels