summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-03-18 17:48:47 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-03-18 17:48:47 -0300
commitc42254a24e5817c46f53261b1fd1efb832907704 (patch)
tree5eb3b697a4616a4344db2cf85fac8b8aceff9254
parent2b249423e7bfa422256c6828763029065ebf232b (diff)
eolian-cxx: WIP: Remove .Base requirementdevs/felipealmeida/remove_base
-rw-r--r--src/Makefile_Eolian_Cxx.am5
-rw-r--r--src/bin/eolian_cxx/eolian_wrappers.hh4
-rw-r--r--src/bin/eolian_cxx/type_lookup.hh26
-rw-r--r--src/tests/eolian_cxx/name_name.c7
-rw-r--r--src/tests/eolian_cxx/name_name.eo4
-rw-r--r--src/tests/eolian_cxx/name_name_cxx.cc6
6 files changed, 43 insertions, 9 deletions
diff --git a/src/Makefile_Eolian_Cxx.am b/src/Makefile_Eolian_Cxx.am
index 89111c1681..c9da3f0b13 100644
--- a/src/Makefile_Eolian_Cxx.am
+++ b/src/Makefile_Eolian_Cxx.am
@@ -72,6 +72,8 @@ tests/eolian_cxx/eolian_cxx_test_callback.cc \
72tests/eolian_cxx/eolian_cxx_test_address_of.cc \ 72tests/eolian_cxx/eolian_cxx_test_address_of.cc \
73tests/eolian_cxx/eolian_cxx_test_wrapper.cc \ 73tests/eolian_cxx/eolian_cxx_test_wrapper.cc \
74tests/eolian_cxx/simple.c \ 74tests/eolian_cxx/simple.c \
75tests/eolian_cxx/name_name.c \
76tests/eolian_cxx/name_name_cxx.cc \
75tests/eolian_cxx/generic.c \ 77tests/eolian_cxx/generic.c \
76tests/eolian_cxx/eolian_cxx_test_inheritance.cc \ 78tests/eolian_cxx/eolian_cxx_test_inheritance.cc \
77tests/eolian_cxx/eolian_cxx_test_generate.cc \ 79tests/eolian_cxx/eolian_cxx_test_generate.cc \
@@ -91,6 +93,9 @@ tests/eolian_cxx/tests_eolian_cxx_eolian_cxx_suite-b.$(OBJEXT): tests/eolian_cxx
91tests/eolian_cxx/tests_eolian_cxx_eolian_cxx_suite-c.$(OBJEXT): tests/eolian_cxx/c.eo.c tests/eolian_cxx/c.eo.h 93tests/eolian_cxx/tests_eolian_cxx_eolian_cxx_suite-c.$(OBJEXT): tests/eolian_cxx/c.eo.c tests/eolian_cxx/c.eo.h
92tests/eolian_cxx/tests_eolian_cxx_eolian_cxx_suite-d.$(OBJEXT): tests/eolian_cxx/d.eo.c tests/eolian_cxx/d.eo.h 94tests/eolian_cxx/tests_eolian_cxx_eolian_cxx_suite-d.$(OBJEXT): tests/eolian_cxx/d.eo.c tests/eolian_cxx/d.eo.h
93 95
96tests/eolian_cxx/tests_eolian_cxx_eolian_cxx_suite-name_name.$(OBJEXT): tests/eolian_cxx/name_name.eo.c tests/eolian_cxx/name_name.eo.h
97tests/eolian_cxx/tests_eolian_cxx_eolian_cxx_suite-name_name_cxx.$(OBJEXT): tests/eolian_cxx/name_name.eo.h tests/eolian_cxx/name_name.eo.hh
98
94CLEANFILES += \ 99CLEANFILES += \
95tests/eolian_cxx/callback.eo.hh \ 100tests/eolian_cxx/callback.eo.hh \
96tests/eolian_cxx/callback.eo.c \ 101tests/eolian_cxx/callback.eo.c \
diff --git a/src/bin/eolian_cxx/eolian_wrappers.hh b/src/bin/eolian_cxx/eolian_wrappers.hh
index 0b78020188..8be5f9bec6 100644
--- a/src/bin/eolian_cxx/eolian_wrappers.hh
+++ b/src/bin/eolian_cxx/eolian_wrappers.hh
@@ -59,7 +59,7 @@ class_base_file(Eolian_Class const& klass)
59inline std::string 59inline std::string
60class_name(Eolian_Class const& klass) 60class_name(Eolian_Class const& klass)
61{ 61{
62 return safe_lower(::eolian_class_name_get(&klass)); 62 return ::eolian_class_name_get(&klass);
63} 63}
64 64
65inline std::string 65inline std::string
@@ -347,7 +347,7 @@ event_create(Eolian_Class const& klass, const Eolian_Event *event_)
347 event.is_beta = (::eolian_event_is_beta(event_) != EINA_FALSE); 347 event.is_beta = (::eolian_event_is_beta(event_) != EINA_FALSE);
348 event.name = normalize_spaces(name_); 348 event.name = normalize_spaces(name_);
349 event.eo_name = safe_upper 349 event.eo_name = safe_upper
350 (find_replace(class_full_name(klass), ".", "_") + "_EVENT_" + event.name); 350 (find_replace(safe_lower(class_full_name(klass)), ".", "_") + "_EVENT_" + event.name);
351 /* FIXME: use doc api */ 351 /* FIXME: use doc api */
352 event.comment = safe_str(""); 352 event.comment = safe_str("");
353 } 353 }
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;
27inline std::string 27inline std::string
28class_format_cxx(std::string const& fullname) 28class_format_cxx(std::string const& fullname)
29{ 29{
30 std::string s = fullname; 30 auto current = fullname.begin(), last = fullname.end();
31 auto found = s.find("."); 31 auto found = std::find(current, last, '.');
32 while (found != std::string::npos) 32 std::string new_string;
33 while (current != last)
33 { 34 {
34 s.replace(found, 1, "::"); 35 if(found == last)
35 found = s.find("."); 36 {
37 new_string.insert(new_string.end(), current, found);
38 current = found;
39 }
40 else
41 {
42 new_string += std::tolower(*current);
43 new_string.insert(new_string.end(), std::next(current), found);
44 new_string += "::";
45 current = std::next(found);
46 found = std::find(current, last, '.');
47 }
36 } 48 }
37 return s; 49 return new_string;
38} 50}
39 51
40inline bool 52inline bool
@@ -60,7 +72,7 @@ type_from_eolian(Eolian_Type const& type)
60 x.category = efl::eolian::eolian_type::simple_; 72 x.category = efl::eolian::eolian_type::simple_;
61 x.is_class = true; 73 x.is_class = true;
62 x.binding_requires_optional = false; 74 x.binding_requires_optional = false;
63 x.binding = "::" + class_format_cxx(safe_lower(safe_str(::eolian_class_full_name_get(klass)))); 75 x.binding = "::" + class_format_cxx(safe_str(::eolian_class_full_name_get(klass)));
64 76
65 Eina_Stringshare* klass_file = ::eolian_class_file_get(klass); 77 Eina_Stringshare* klass_file = ::eolian_class_file_get(klass);
66 if (klass_file) 78 if (klass_file)
diff --git a/src/tests/eolian_cxx/name_name.c b/src/tests/eolian_cxx/name_name.c
new file mode 100644
index 0000000000..6526c7e05d
--- /dev/null
+++ b/src/tests/eolian_cxx/name_name.c
@@ -0,0 +1,7 @@
1
2#include <Eo.h>
3
4struct Name_Name_Data {};
5
6#include "name_name.eo.h"
7#include "name_name.eo.c"
diff --git a/src/tests/eolian_cxx/name_name.eo b/src/tests/eolian_cxx/name_name.eo
new file mode 100644
index 0000000000..fd88a5e8c1
--- /dev/null
+++ b/src/tests/eolian_cxx/name_name.eo
@@ -0,0 +1,4 @@
1class Name.Name {
2 legacy_prefix: null;
3}
4
diff --git a/src/tests/eolian_cxx/name_name_cxx.cc b/src/tests/eolian_cxx/name_name_cxx.cc
new file mode 100644
index 0000000000..99087548f1
--- /dev/null
+++ b/src/tests/eolian_cxx/name_name_cxx.cc
@@ -0,0 +1,6 @@
1
2#include <Eo.h>
3
4#include "name_name.eo.h"
5#include "name_name.eo.hh"
6