summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/struct_definition.hh
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-04-16 16:26:13 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2018-04-26 10:55:18 -0300
commit429d7510b06d3b475b8b924fbf642ef4313f0b26 (patch)
tree298563af635d38381a4258e4b8b85d3a056017e8 /src/bin/eolian_mono/eolian/mono/struct_definition.hh
parent628e5ab95029c222e5f2eca3fa9a3702015fb8c1 (diff)
efl_mono: Reorganize utility functions.
Summary: Blacklist functions are all in the header/namespace blacklist. Helper functions returning strings (names) are in the name_helpers header. They act somewhat like "mini-generators". Helpers.hh was left with other kind of helper functions (checks, etc) that do not return strings. Depends on D5992 Reviewers: felipealmeida Reviewed By: felipealmeida Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D5993
Diffstat (limited to 'src/bin/eolian_mono/eolian/mono/struct_definition.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_definition.hh12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
index bc3b730857..9ff47de51d 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
@@ -6,12 +6,14 @@
6#include "grammar/indentation.hpp" 6#include "grammar/indentation.hpp"
7#include "grammar/list.hpp" 7#include "grammar/list.hpp"
8#include "grammar/alternative.hpp" 8#include "grammar/alternative.hpp"
9#include "name_helpers.hh"
9#include "helpers.hh" 10#include "helpers.hh"
10#include "type.hh" 11#include "type.hh"
11#include "keyword.hh" 12#include "keyword.hh"
12#include "using_decl.hh" 13#include "using_decl.hh"
13#include "documentation.hh" 14#include "documentation.hh"
14#include "struct_fields.hh" 15#include "struct_fields.hh"
16#include "blacklist.hh"
15 17
16namespace eolian_mono { 18namespace eolian_mono {
17 19
@@ -51,7 +53,7 @@ struct struct_definition_generator
51 documentation(1) 53 documentation(1)
52 << scope_tab(1) << "public " << type << " " << string << ";\n" 54 << scope_tab(1) << "public " << type << " " << string << ";\n"
53 ) 55 )
54 .generate(sink, std::make_tuple(field, field.type, helpers::to_field_name(field.name)), context)) 56 .generate(sink, std::make_tuple(field, field.type, name_helpers::to_field_name(field.name)), context))
55 return false; 57 return false;
56 } 58 }
57 59
@@ -104,7 +106,7 @@ struct struct_internal_definition_generator
104 // iterate struct fields 106 // iterate struct fields
105 for (auto const& field : struct_.fields) 107 for (auto const& field : struct_.fields)
106 { 108 {
107 auto field_name = helpers::to_field_name(field.name); 109 auto field_name = name_helpers::to_field_name(field.name);
108 auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type); 110 auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type);
109 auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type); 111 auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type);
110 112
@@ -165,7 +167,7 @@ struct to_internal_field_convert_generator
165 template <typename OutputIterator, typename Context> 167 template <typename OutputIterator, typename Context>
166 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const 168 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
167 { 169 {
168 auto field_name = helpers::to_field_name(field.name); 170 auto field_name = name_helpers::to_field_name(field.name);
169 auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type); 171 auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type);
170 auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type); 172 auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type);
171 auto complex = efl::eina::get<attributes::complex_type_def>(&field.type.original_type); 173 auto complex = efl::eina::get<attributes::complex_type_def>(&field.type.original_type);
@@ -259,7 +261,7 @@ struct to_external_field_convert_generator
259 template <typename OutputIterator, typename Context> 261 template <typename OutputIterator, typename Context>
260 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const 262 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
261 { 263 {
262 auto field_name = helpers::to_field_name(field.name); 264 auto field_name = name_helpers::to_field_name(field.name);
263 auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type); 265 auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type);
264 auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type); 266 auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type);
265 auto complex = efl::eina::get<attributes::complex_type_def>(&field.type.original_type); 267 auto complex = efl::eina::get<attributes::complex_type_def>(&field.type.original_type);
@@ -439,7 +441,7 @@ struct struct_entities_generator
439 template <typename OutputIterator, typename Context> 441 template <typename OutputIterator, typename Context>
440 bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const 442 bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const
441 { 443 {
442 if (helpers::is_struct_blacklisted(struct_)) 444 if (blacklist::is_struct_blacklisted(struct_))
443 return true; 445 return true;
444 446
445 std::vector<std::string> cpp_namespaces = escape_namespace(attributes::cpp_namespaces(struct_.namespaces)); 447 std::vector<std::string> cpp_namespaces = escape_namespace(attributes::cpp_namespaces(struct_.namespaces));