summaryrefslogtreecommitdiff
path: root/src/bin/eolian_cxx/type_lookup.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/eolian_cxx/type_lookup.hh')
-rw-r--r--src/bin/eolian_cxx/type_lookup.hh26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/bin/eolian_cxx/type_lookup.hh b/src/bin/eolian_cxx/type_lookup.hh
index 7f73a5edda..a1b32204f4 100644
--- a/src/bin/eolian_cxx/type_lookup.hh
+++ b/src/bin/eolian_cxx/type_lookup.hh
@@ -27,14 +27,26 @@ extern const lookup_table_type type_lookup_table;
inline std::string
class_format_cxx(std::string const& fullname)
{
- std::string s = fullname;
- auto found = s.find(".");
- while (found != std::string::npos)
+ auto current = fullname.begin(), last = fullname.end();
+ auto found = std::find(current, last, '.');
+ std::string new_string;
+ while (current != last)
{
- s.replace(found, 1, "::");
- found = s.find(".");
+ if(found == last)
+ {
+ new_string.insert(new_string.end(), current, found);
+ current = found;
+ }
+ else
+ {
+ new_string += std::tolower(*current);
+ new_string.insert(new_string.end(), std::next(current), found);
+ new_string += "::";
+ current = std::next(found);
+ found = std::find(current, last, '.');
+ }
}
- return s;
+ return new_string;
}
inline bool
@@ -60,7 +72,7 @@ type_from_eolian(Eolian_Type const& type)
x.category = efl::eolian::eolian_type::simple_;
x.is_class = true;
x.binding_requires_optional = false;
- x.binding = "::" + class_format_cxx(safe_lower(safe_str(::eolian_class_full_name_get(klass))));
+ x.binding = "::" + class_format_cxx(safe_str(::eolian_class_full_name_get(klass)));
Eina_Stringshare* klass_file = ::eolian_class_file_get(klass);
if (klass_file)