summaryrefslogtreecommitdiff
path: root/src/bin/eolian_cxx
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2014-07-16 20:17:10 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2014-07-18 18:57:13 -0300
commit637a97a0f5e2552659a7ab7c21959387e786b453 (patch)
tree35c3ea5420a97f8853371bf5b8c0a7a7e9c847bf /src/bin/eolian_cxx
parent377bb449ba1dbdb89bb6f8accda8c8eeb514fdbe (diff)
eolian-cxx: Fixed using eo::base for extension_inheritance
Extended the logic for rewriting the eo::base to efl::eo::base for parents to extension inheritance.
Diffstat (limited to 'src/bin/eolian_cxx')
-rw-r--r--src/bin/eolian_cxx/convert.cc29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/bin/eolian_cxx/convert.cc b/src/bin/eolian_cxx/convert.cc
index f52affa7db..71311886be 100644
--- a/src/bin/eolian_cxx/convert.cc
+++ b/src/bin/eolian_cxx/convert.cc
@@ -155,6 +155,14 @@ convert_eolian_property_to_functions(Eolian_Class const& klass)
155 return container; 155 return container;
156} 156}
157 157
158std::string get_class_name(std::string const& name)
159{
160 // "eo_base" is the Eolian name for EO_BASE_CLASS.
161 return (name == "eo_base" || name == "eo::base" || name == "")
162 ? "efl::eo::base"
163 : name;
164}
165
158void 166void
159convert_eolian_inheritances(efl::eolian::eo_class& cls, Eolian_Class const& klass) 167convert_eolian_inheritances(efl::eolian::eo_class& cls, Eolian_Class const& klass)
160{ 168{
@@ -171,21 +179,18 @@ convert_eolian_inheritances(efl::eolian::eo_class& cls, Eolian_Class const& klas
171 } 179 }
172 else 180 else
173 { 181 {
182 // First element is the parent
174 const char *ptr = static_cast<const char*> 183 const char *ptr = static_cast<const char*>
175 (eina_list_data_get(inheritances)); 184 (eina_list_data_get(inheritances));
176 std::string parent = class_format_cxx(safe_lower(ptr)); 185 cls.parent = get_class_name(class_format_cxx(safe_lower(ptr)));
177 186
178 // "eo_base" is the Eolian name for EO_BASE_CLASS. 187 inheritances = eina_list_next(inheritances);
179 cls.parent = 188
180 (parent == "eo_base" || parent == "eo::base" || parent == "") 189 EINA_LIST_FOREACH (inheritances, it, curr)
181 ? "efl::eo::base" 190 {
182 : parent; 191 std::string extension = safe_lower(static_cast<const char*>(curr));
183 } 192 cls.extensions.push_back(get_class_name(class_format_cxx(extension)));
184 inheritances = eina_list_next(inheritances); 193 }
185 EINA_LIST_FOREACH (inheritances, it, curr)
186 {
187 std::string extension = safe_lower(static_cast<const char*>(curr));
188 cls.extensions.push_back(class_format_cxx(extension));
189 } 194 }
190} 195}
191 196