summaryrefslogtreecommitdiff
path: root/src/bin/eolian_cxx
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-05-29 14:42:16 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-05-29 14:48:05 +0300
commitdc3178404f2d82cddf5be19de03dd81cdeab7541 (patch)
tree757a76a847d5902c6ecd781e1ead42b8c82883cc /src/bin/eolian_cxx
parentf4a0c8054f1ad8b1352bc3a261f0213ff71daa82 (diff)
Eolian: modify 'implement' API parameters.
The function eolian_implement_information_get was returning strings for the class and the function. It was written in this way at the beginning because it was not needed to verify the correctness of the class and the function. Now that we have the namespace feature, this function must check it, meaning that the class and the function are now known. So we can return them instead of returning the strings. The generators had to find the class from the classname. It is no more needed. The C++ generator has been adapted to this new API.
Diffstat (limited to 'src/bin/eolian_cxx')
-rw-r--r--src/bin/eolian_cxx/convert.cc21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/bin/eolian_cxx/convert.cc b/src/bin/eolian_cxx/convert.cc
index 4a4215c763..f3a639242a 100644
--- a/src/bin/eolian_cxx/convert.cc
+++ b/src/bin/eolian_cxx/convert.cc
@@ -182,25 +182,22 @@ convert_eolian_implements(efl::eolian::eo_class& cls, const Eolian_Class klass)
182 EINA_LIST_FOREACH(eolian_class_implements_list_get(klass), it, impl_desc_) 182 EINA_LIST_FOREACH(eolian_class_implements_list_get(klass), it, impl_desc_)
183 { 183 {
184 Eolian_Implement impl_desc = static_cast<Eolian_Implement>(impl_desc_); 184 Eolian_Implement impl_desc = static_cast<Eolian_Implement>(impl_desc_);
185 const char *impl_classname; 185 Eolian_Class impl_class;
186 const char *func_name; 186 Eolian_Function impl_func;
187 Eolian_Function_Type func_type; 187 Eolian_Function_Type impl_type;
188 eolian_implement_information_get 188 eolian_implement_information_get
189 (impl_desc, &impl_classname, &func_name, &func_type); 189 (impl_desc, &impl_class, &impl_func, &impl_type);
190 if (func_type == EOLIAN_CTOR) 190 if (impl_type == EOLIAN_CTOR)
191 { 191 {
192 efl::eolian::eo_constructor constructor; 192 efl::eolian::eo_constructor constructor;
193 Eolian_Class impl_class = eolian_class_find_by_name(impl_classname); 193 std::string parent = safe_str(eolian_class_full_name_get(impl_class));
194 Eolian_Function eolian_constructor =
195 eolian_class_function_find_by_name(impl_class, func_name, func_type);
196 std::string parent = safe_str(impl_classname);
197 if(parent == "Eo_Base") parent = "eo"; 194 if(parent == "Eo_Base") parent = "eo";
198 else std::transform(parent.begin(), parent.end(), parent.begin(), ::tolower); 195 else std::transform(parent.begin(), parent.end(), parent.begin(), ::tolower);
199 constructor.name = parent + "_" + safe_str(func_name); 196 constructor.name = parent + "_" + safe_str(eolian_function_name_get(impl_func));
200 constructor.params = _get_params 197 constructor.params = _get_params
201 (eolian_parameters_list_get(eolian_constructor)); 198 (eolian_parameters_list_get(impl_func));
202 constructor.comment = detail::eolian_constructor_comment 199 constructor.comment = detail::eolian_constructor_comment
203 (eolian_constructor); 200 (impl_func);
204 cls.constructors.push_back(constructor); 201 cls.constructors.push_back(constructor);
205 } 202 }
206 } 203 }