Eolian: add API to return the class from a function.

@feature
This commit is contained in:
Daniel Zaoui 2015-03-16 17:04:44 +02:00
parent 13c3d3d7d6
commit 57a4cae33b
3 changed files with 18 additions and 0 deletions

View File

@ -1097,6 +1097,16 @@ EAPI Eina_Bool eolian_function_return_is_warn_unused(const Eolian_Function *foo_
*/
EAPI Eina_Bool eolian_function_object_is_const(const Eolian_Function *function_id);
/*
* @brief Return the Eolian class associated to the function.
*
* @param[in] function_id id of the function
* @return the class, NULL otherwise
*
* @ingroup Eolian
*/
EAPI const Eolian_Class *eolian_function_class_get(const Eolian_Function *function_id);
/*
* @brief Get full string of an overriding function (implement).
*

View File

@ -250,6 +250,13 @@ eolian_function_object_is_const(const Eolian_Function *fid)
return fid->obj_is_const;
}
EAPI const Eolian_Class *
eolian_function_class_get(const Eolian_Function *fid)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
return fid->klass;
}
EAPI Eina_Bool
eolian_function_is_c_only(const Eolian_Function *fid)
{

View File

@ -558,6 +558,7 @@ START_TEST(eolian_simple_parsing)
fail_if(strcmp(string, "comment a.set"));
string = eolian_function_description_get(fid, EOLIAN_PROP_GET);
fail_if(string);
fail_if(eolian_function_class_get(fid) != class);
/* Set return */
tp = eolian_function_return_type_get(fid, EOLIAN_PROP_SET);
fail_if(!tp);