aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-12-04 15:50:48 -0200
committerChristopher Michael <cp.michael@samsung.com>2018-12-06 12:06:17 -0500
commit44db8aa9a0db716db633077ecf1d64a4c7859a36 (patch)
tree3e2feba11f55038cf2fc39ca991483b38787a332
parentexamples: update gitignore (diff)
downloadefl-44db8aa9a0db716db633077ecf1d64a4c7859a36.tar.gz
eolian_cxx: Add documentation field to property_def
Test Plan: run eolian_cxx suite Reviewers: vitor.sousa, felipealmeida Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7414
-rw-r--r--src/lib/eolian_cxx/grammar/klass_def.hpp10
-rw-r--r--src/tests/eolian_cxx/eolian_cxx_test_documentation.cc6
2 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp
index 1db9324001..08240b6e28 100644
--- a/src/lib/eolian_cxx/grammar/klass_def.hpp
+++ b/src/lib/eolian_cxx/grammar/klass_def.hpp
@@ -802,6 +802,7 @@ struct property_def
{
klass_name klass;
std::string name;
+ documentation_def documentation;
efl::eina::optional<function_def> getter;
efl::eina::optional<function_def> setter;
@@ -810,6 +811,7 @@ struct property_def
{
return lhs.klass == rhs.klass
&& lhs.name == rhs.name
+ && lhs.documentation == rhs.documentation
&& lhs.getter == rhs.getter
&& lhs.setter == rhs.setter;
}
@@ -828,6 +830,14 @@ struct property_def
const Eolian_Class *eolian_klass = eolian_function_class_get(function);
klass = klass_name(eolian_klass, {attributes::qualifier_info::is_none, std::string()});
+
+ Eolian_Implement const* implement = ::eolian_function_implement_get(function);
+ if (!implement)
+ return;
+
+ Eolian_Function_Type type = ::eolian_function_type_get(function);
+ if (type == EOLIAN_PROP_GET || type == EOLIAN_PROP_SET || type == EOLIAN_PROPERTY)
+ documentation = eolian_implement_documentation_get(implement, EOLIAN_PROPERTY);
}
};
diff --git a/src/tests/eolian_cxx/eolian_cxx_test_documentation.cc b/src/tests/eolian_cxx/eolian_cxx_test_documentation.cc
index 4690f45498..d3908ffb42 100644
--- a/src/tests/eolian_cxx/eolian_cxx_test_documentation.cc
+++ b/src/tests/eolian_cxx/eolian_cxx_test_documentation.cc
@@ -144,6 +144,12 @@ EFL_START_TEST(eolian_cxx_test_property_docs)
ck_assert_str_eq(doc.summary.c_str(), "Set documentation.");
ck_assert_str_eq(doc.description.c_str(), "");
ck_assert_str_eq(doc.since.c_str(), "1.17"); // Members inherit from parent *class*
+
+ auto property_iter = klass.properties.begin();
+ auto property = *property_iter;
+ doc = property.documentation;
+ ck_assert_str_eq(doc.summary.c_str(), "Property common documentation.");
+ ck_assert_str_eq(doc.since.c_str(), "1.18");
}
EFL_END_TEST