summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-04-17 21:03:45 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-04-17 21:51:33 -0300
commit71d98d0a5f050203f9a3c16ee698971044ea699e (patch)
tree61f14491e239e378862989580343f1ba1b8c145e
parentabc63218bc1b4d65bc265ae59a916bdec6b3bd29 (diff)
csharp: Remove managed_method_name overload.devs/lauromoura/csharp_conventions
-rw-r--r--src/bin/eolian_mono/eolian/mono/documentation.hh9
-rw-r--r--src/bin/eolian_mono/eolian/mono/name_helpers.hh11
2 files changed, 9 insertions, 11 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/documentation.hh b/src/bin/eolian_mono/eolian/mono/documentation.hh
index 2cad038e25..ac072a4220 100644
--- a/src/bin/eolian_mono/eolian/mono/documentation.hh
+++ b/src/bin/eolian_mono/eolian/mono/documentation.hh
@@ -74,8 +74,7 @@ struct documentation_generator
74 if (blacklist::is_function_blacklisted( 74 if (blacklist::is_function_blacklisted(
75 ::eolian_function_full_c_name_get(function, ftype))) return ""; 75 ::eolian_function_full_c_name_get(function, ftype))) return "";
76 name += "."; 76 name += ".";
77 name += name_helpers::managed_method_name( 77 name += name_helpers::managed_method_name({function, ftype, NULL, eolian_object_unit_get(EOLIAN_OBJECT(function))});
78 ::eolian_object_short_name_get(klass), eo_name);
79 break; 78 break;
80 case ::EOLIAN_PROP_SET: 79 case ::EOLIAN_PROP_SET:
81 name += ".Set"; 80 name += ".Set";
@@ -118,7 +117,7 @@ struct documentation_generator
118 case attributes::function_type::prop_get: 117 case attributes::function_type::prop_get:
119 if (blacklist::is_function_blacklisted(func.c_name))return ""; 118 if (blacklist::is_function_blacklisted(func.c_name))return "";
120 if (!name.empty()) name += "."; 119 if (!name.empty()) name += ".";
121 name += name_helpers::managed_method_name(func.klass.eolian_name, func.name); 120 name += name_helpers::managed_method_name(func);
122 break; 121 break;
123 default: 122 default:
124 // No need to deal with property as function_defs are converted to get/set when building a given klass_def. 123 // No need to deal with property as function_defs are converted to get/set when building a given klass_def.
@@ -432,7 +431,7 @@ struct documentation_generator
432 431
433 return generate_all_tag_examples(sink, 432 return generate_all_tag_examples(sink,
434 name_helpers::klass_full_concrete_or_interface_name(func.klass), 433 name_helpers::klass_full_concrete_or_interface_name(func.klass),
435 name_helpers::managed_method_name(func.klass.eolian_name, func.name), 434 name_helpers::managed_method_name(func),
436 context); 435 context);
437 } 436 }
438 437
@@ -451,7 +450,7 @@ struct documentation_generator
451 450
452 return generate_all_tag_examples(sink, 451 return generate_all_tag_examples(sink,
453 name_helpers::klass_full_concrete_or_interface_name(func.klass), 452 name_helpers::klass_full_concrete_or_interface_name(func.klass),
454 name_helpers::managed_method_name(func.klass.eolian_name, func.name), 453 name_helpers::managed_method_name(func),
455 context); 454 context);
456 } 455 }
457 456
diff --git a/src/bin/eolian_mono/eolian/mono/name_helpers.hh b/src/bin/eolian_mono/eolian/mono/name_helpers.hh
index 4d9fff92de..11ccec3146 100644
--- a/src/bin/eolian_mono/eolian/mono/name_helpers.hh
+++ b/src/bin/eolian_mono/eolian/mono/name_helpers.hh
@@ -176,8 +176,12 @@ inline std::string managed_namespace(std::string const& ns)
176 return escape_keyword(utils::remove_all(ns, '_')); 176 return escape_keyword(utils::remove_all(ns, '_'));
177} 177}
178 178
179inline std::string managed_method_name(std::string const& klass, std::string const& name) 179inline std::string managed_method_name(attributes::function_def const& f)
180{ 180{
181 auto klass = f.klass.eolian_name;
182 // TODO get managed name to check if the managed actually clashes with the method name.
183 auto name = f.name;
184
181 std::vector<std::string> names = utils::split(name, '_'); 185 std::vector<std::string> names = utils::split(name, '_');
182 186
183 name_helpers::reorder_verb(names); 187 name_helpers::reorder_verb(names);
@@ -203,11 +207,6 @@ inline std::string managed_name(std::string const& name, char separator='_')
203 return utils::to_pascal_case(tokens); 207 return utils::to_pascal_case(tokens);
204} 208}
205 209
206inline std::string managed_method_name(attributes::function_def const& f)
207{
208 return managed_method_name(f.klass.eolian_name, f.name);
209}
210
211inline std::string alias_full_eolian_name(attributes::alias_def const& alias) 210inline std::string alias_full_eolian_name(attributes::alias_def const& alias)
212{ 211{
213 212