summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-05-26 16:47:04 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-05-26 16:47:04 -0300
commita2d783a7c281239806e1cceed0970cc541585d5d (patch)
tree858aca6400b47241f9998770b03c73f4decd3cf9
parent66dade5604f8c124c0d9c2811439a2a8bbf2d5a1 (diff)
downloadefl-a2d783a7c281239806e1cceed0970cc541585d5d.tar.gz
eolian-cxx: Fixed lookup of class types
-rw-r--r--src/bin/eolian_cxx/type_lookup.hh44
1 files changed, 20 insertions, 24 deletions
diff --git a/src/bin/eolian_cxx/type_lookup.hh b/src/bin/eolian_cxx/type_lookup.hh
index 37e4ff7b33..9410bdf358 100644
--- a/src/bin/eolian_cxx/type_lookup.hh
+++ b/src/bin/eolian_cxx/type_lookup.hh
@@ -65,32 +65,27 @@ type_from_eolian(Eolian_Type const& type)
efl::eolian::eolian_type x;
Eolian_Type_Type tpt = ::eolian_type_type_get(&type);
- if (tpt == EOLIAN_TYPE_POINTER || tpt == EOLIAN_TYPE_REGULAR)
+ if (tpt == EOLIAN_TYPE_CLASS)
{
- Eolian_Type const* base_type = ::eolian_type_base_type_get(&type);
- if (base_type && ::eolian_type_type_get(base_type) == EOLIAN_TYPE_CLASS)
+ Eolian_Class const* klass = ::eolian_type_class_get(&type);
+ if (klass)
{
- Eolian_Class const* klass = ::eolian_type_class_get(base_type);
- if (klass)
- {
- x.category = efl::eolian::eolian_type::simple_;
- x.is_class = true;
- x.binding_requires_optional = false;
- x.binding = "::" + class_format_cxx(safe_str(::eolian_class_full_name_get(klass)));
- x.native = "::";
- x.native += safe_str( ::eolian_class_full_name_get(klass));
- std::replace(x.native.begin(), x.native.end(), '.', '_');
-
- if( ::eolian_type_is_const(base_type))
- x.native += " const";
-
- x.native += '*';
+ x.category = efl::eolian::eolian_type::simple_;
+ x.is_class = true;
+ x.binding_requires_optional = false;
+ x.binding = "::" + class_format_cxx(safe_str(::eolian_class_full_name_get(klass)));
+ x.native = "::";
+ x.native += safe_str( ::eolian_class_full_name_get(klass));
+ std::replace(x.native.begin(), x.native.end(), '.', '_');
+
+ if( ::eolian_type_is_const(&type))
+ x.native += " const";
+ x.native += '*';
- Eina_Stringshare* klass_file = ::eolian_class_file_get(klass);
- if (klass_file)
- x.includes = {safe_str(klass_file) + ".hh"};
- }
+ Eina_Stringshare* klass_file = ::eolian_class_file_get(klass);
+ if (klass_file)
+ x.includes = {safe_str(klass_file) + ".hh"};
}
}
@@ -124,7 +119,7 @@ type_lookup(const Eolian_Type* type,
std::vector<Eolian_Type const*> types;
types.push_back(type);
- if (::eolian_type_type_get(type) == EOLIAN_TYPE_COMPLEX/* && type_is_complex(*eolian_type_base_type_get(type))*/)
+ if (type_is_complex(*type))
{
efl::eina::iterator<Eolian_Type const> end;
efl::eina::iterator<Eolian_Type const> it
@@ -134,7 +129,8 @@ type_lookup(const Eolian_Type* type,
if(Eolian_Type const* t = &*it)
{
types.push_back
- ( ::eolian_type_type_get(t) == EOLIAN_TYPE_POINTER ? ::eolian_type_base_type_get(t) /* remove this base type get when pointers are removed */
+ /* remove this base type get when pointers are removed */
+ ( ::eolian_type_type_get(t) == EOLIAN_TYPE_POINTER ? ::eolian_type_base_type_get(t)
: t
);
++it;