rettypet = eolian_function_return_type_get(func, ftype);
if (ftype == EOLIAN_PROP_GET && !rettypet)
{
- itr = eolian_property_values_get(func);
+ itr = eolian_property_values_get(func, ftype);
/* We want to check if there is only one parameter */
if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
{
Eina_Strbuf *str_retdesc = eina_strbuf_new();
Eina_Strbuf *str_typecheck = eina_strbuf_new();
- itr = eolian_property_keys_get(func);
+ itr = eolian_property_keys_get(func, ftype);
EINA_ITERATOR_FOREACH(itr, data)
{
Eolian_Function_Parameter *param = data;
if (!var_as_ret)
{
- itr = is_prop ? eolian_property_values_get(func) : eolian_function_parameters_get(func);
+ itr = is_prop ? eolian_property_values_get(func, ftype) : eolian_function_parameters_get(func);
EINA_ITERATOR_FOREACH(itr, data)
{
Eolian_Function_Parameter *param = data;
add_star = EINA_TRUE;
if (!rettypet)
{
- itr = eolian_property_values_get(funcid);
+ itr = eolian_property_values_get(funcid, ftype);
/* We want to check if there is only one parameter */
if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
{
suffix = "_set";
}
- itr = eolian_property_keys_get(funcid);
+ itr = eolian_property_keys_get(funcid, ftype);
EINA_ITERATOR_FOREACH(itr, data)
{
Eolian_Function_Parameter *param = data;
eina_iterator_free(itr);
if (!var_as_ret)
{
- itr = is_prop ? eolian_property_values_get(funcid) : eolian_function_parameters_get(funcid);
+ itr = is_prop ? eolian_property_values_get(funcid, ftype) : eolian_function_parameters_get(funcid);
EINA_ITERATOR_FOREACH(itr, data)
{
Eolian_Function_Parameter *param = data;
Eina_Strbuf *eo_func_decl = eina_strbuf_new();
Eina_Bool has_params = EINA_FALSE;
- itr = eolian_property_keys_get(funcid);
+ itr = eolian_property_keys_get(funcid, ftype);
has_params |= (eina_iterator_next(itr, &data));
eina_iterator_free(itr);
if (!has_params && !var_as_ret)
{
- itr = is_prop ? eolian_property_values_get(funcid) : eolian_function_parameters_get(funcid);
+ itr = is_prop ? eolian_property_values_get(funcid, ftype) : eolian_function_parameters_get(funcid);
has_params |= (eina_iterator_next(itr, &data));
eina_iterator_free(itr);
}
Eina_Bool is_prop = (ftype == EOLIAN_PROP_GET || ftype == EOLIAN_PROP_SET);
eina_strbuf_reset(params);
eina_strbuf_reset(short_params);
- itr = eolian_property_keys_get(foo);
+ itr = eolian_property_keys_get(foo, ftype);
EINA_ITERATOR_FOREACH(itr, param)
{
const Eolian_Type *ptypet = eolian_parameter_type_get(param);
if (!var_as_ret)
{
Eina_Bool add_star = (ftype == EOLIAN_PROP_GET);
- itr = is_prop ? eolian_property_values_get(foo) : eolian_function_parameters_get(foo);
+ itr = is_prop ? eolian_property_values_get(foo, ftype) : eolian_function_parameters_get(foo);
EINA_ITERATOR_FOREACH(itr, param)
{
const Eolian_Type *ptypet = eolian_parameter_type_get(param);
const Eolian_Type *rettypet = eolian_function_return_type_get(foo, ftype);
if (ftype == EOLIAN_PROP_GET && !rettypet)
{
- Eina_Iterator *itr = eolian_property_values_get(foo);
+ Eina_Iterator *itr = eolian_property_values_get(foo, ftype);
void *data, *data2;
/* We want to check if there is only one parameter */
if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
add_star = EINA_TRUE;
if (!rettypet)
{
- itr = eolian_property_values_get(funcid);
+ itr = eolian_property_values_get(funcid, ftype);
/* We want to check if there is only one parameter */
if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
{
eina_strbuf_replace_all(fbody, "@#desc", eina_strbuf_string_get(linedesc));
eina_strbuf_free(linedesc);
- itr = eolian_property_keys_get(funcid);
+ itr = eolian_property_keys_get(funcid, ftype);
EINA_ITERATOR_FOREACH(itr, data)
{
Eolian_Function_Parameter *param = data;
eina_iterator_free(itr);
if (!var_as_ret)
{
- itr = is_prop ? eolian_property_values_get(funcid) : eolian_function_parameters_get(funcid);
+ itr = is_prop ? eolian_property_values_get(funcid, ftype) : eolian_function_parameters_get(funcid);
EINA_ITERATOR_FOREACH(itr, data)
{
Eolian_Function_Parameter *param = data;
add_star = EINA_TRUE;
if (!rettypet)
{
- itr = eolian_property_values_get(funcid);
+ itr = eolian_property_values_get(funcid, ftype);
/* We want to check if there is only one parameter */
if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
{
tmpstr[0] = '\0';
- itr = eolian_property_keys_get(funcid);
+ itr = eolian_property_keys_get(funcid, ftype);
EINA_ITERATOR_FOREACH(itr, data)
{
Eolian_Function_Parameter *param = data;
eina_iterator_free(itr);
if (!var_as_ret)
{
- itr = is_prop ? eolian_property_values_get(funcid) : eolian_function_parameters_get(funcid);
+ itr = is_prop ? eolian_property_values_get(funcid, ftype) : eolian_function_parameters_get(funcid);
EINA_ITERATOR_FOREACH(itr, data)
{
Eolian_Function_Parameter *param = data;
Eina_Bool eolian_function_is_class(const Eolian_Function *function_id);
Eina_Bool eolian_function_is_c_only(const Eolian_Function *function_id);
const Eolian_Function_Parameter *eolian_function_parameter_get_by_name(const Eolian_Function *function_id, const char *param_name);
- Eina_Iterator *eolian_property_keys_get(const Eolian_Function *foo_id);
- Eina_Iterator *eolian_property_values_get(const Eolian_Function *foo_id);
+ Eina_Iterator *eolian_property_keys_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
+ Eina_Iterator *eolian_property_values_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
Eina_Iterator *eolian_function_parameters_get(const Eolian_Function *function_id);
Eolian_Parameter_Dir eolian_parameter_direction_get(const Eolian_Function_Parameter *param);
const Eolian_Type *eolian_parameter_type_get(const Eolian_Function_Parameter *param);
return v
end,
- property_keys_get = function(self)
+ property_keys_get = function(self, ftype)
return Ptr_Iterator("const Eolian_Function_Parameter*",
- eolian.eolian_property_keys_get(self))
+ eolian.eolian_property_keys_get(self, ftype))
end,
- property_values_get = function(self)
+ property_values_get = function(self, ftype)
return Ptr_Iterator("const Eolian_Function_Parameter*",
- eolian.eolian_property_values_get(self))
+ eolian.eolian_property_values_get(self, ftype))
end,
parameters_get = function(self)
* @brief Returns an iterator to the keys params of a given function.
*
* @param[in] function_id Id of the function
+ * @param[in] ftype The function type, for property get/set distinction.
* @return the iterator
*
* @ingroup Eolian
*/
-EAPI Eina_Iterator *eolian_property_keys_get(const Eolian_Function *foo_id);
+EAPI Eina_Iterator *eolian_property_keys_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
/*
* @brief Returns an iterator to the values params of a given function.
*
* @param[in] function_id Id of the function
+ * @param[in] ftype The function type, for property get/set distinction.
* @return the iterator
*
* @ingroup Eolian
*/
-EAPI Eina_Iterator *eolian_property_values_get(const Eolian_Function *foo_id);
+EAPI Eina_Iterator *eolian_property_values_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
/*
* @brief Get direction of a parameter
}
EAPI Eina_Iterator *
-eolian_property_keys_get(const Eolian_Function *fid)
+eolian_property_keys_get(const Eolian_Function *fid, Eolian_Function_Type ftype)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
+ if (ftype != EOLIAN_PROP_GET && ftype != EOLIAN_PROP_SET)
+ return NULL;
return (fid->keys ? eina_list_iterator_new(fid->keys) : NULL);
}
EAPI Eina_Iterator *
-eolian_property_values_get(const Eolian_Function *fid)
+eolian_property_values_get(const Eolian_Function *fid, Eolian_Function_Type ftype)
{
- return eolian_function_parameters_get(fid);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
+ if (ftype != EOLIAN_PROP_GET && ftype != EOLIAN_PROP_SET)
+ return NULL;
+ return (fid->params ? eina_list_iterator_new(fid->params) : NULL);
}
EAPI Eina_Iterator *
eolian_function_parameters_get(const Eolian_Function *fid)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
+ if (fid->type != EOLIAN_METHOD)
+ return NULL;
return (fid->params ? eina_list_iterator_new(fid->params) : NULL);
}
if self.cached_proto then return self.cached_proto end
local prop = self.property
- local keys = prop:property_keys_get():to_array()
- local vals = prop:property_values_get():to_array()
+ local keys = prop:property_keys_get(self.ftype):to_array()
+ local vals = prop:property_values_get(self.ftype):to_array()
local rett = prop:return_type_get(self.ftype)
local proto = {
or tp == func_type.METHOD then
cfuncs[#cfuncs + 1] = cfunc
if tp ~= func_type.METHOD then
- for par in cfunc:property_keys_get() do
+ for par in cfunc:property_keys_get(func_type.PROP_SET) do
parnames[#parnames + 1] = build_pn(cn, par:name_get())
end
end
- for par in cfunc:parameters_get() do
+ local iter = (tp ~= func_type.METHOD)
+ and cfunc:property_values_get(func_type.PROP_SET)
+ or cfunc:parameters_get()
+ for par in iter do
if par:direction_get() ~= param_dir.OUT then
parnames[#parnames + 1] = build_pn(cn, par:name_get())
end
-- write ctor body
local j = 1
for i, cfunc in ipairs(cfuncs) do
+ local tp = cfunc:type_get()
s:write(" self:", cfunc:name_get())
if cfunc:type_get() ~= func_type.METHOD then
s:write("_set")
end
s:write("(")
local fpars = {}
- if cfunc:type_get() ~= func_type.METHOD then
- for par in cfunc:property_keys_get() do
+ if tp ~= func_type.METHOD then
+ for par in cfunc:property_keys_get(func_type.PROP_SET) do
fpars[#fpars + 1] = parnames[j]
j = j + 1
end
end
- for par in cfunc:parameters_get() do
+ local iter = (tp ~= func_type.METHOD)
+ and cfunc:property_values_get(func_type.PROP_SET)
+ or cfunc:parameters_get()
+ for par in iter do
if par:direction_get() ~= param_dir.OUT then
fpars[#fpars + 1] = parnames[j]
j = j + 1
eina_stringshare_del(type_name);
eina_iterator_free(iter);
/* Properties parameter type */
- fail_if(!(iter = eolian_function_parameters_get(fid)));
+ fail_if(!(iter = eolian_property_values_get(fid, EOLIAN_PROP_GET)));
fail_if(!(eina_iterator_next(iter, (void**)¶m)));
fail_if(eina_iterator_next(iter, &dummy));
eina_iterator_free(iter);
fail_if(string);
/* Function parameters */
- fail_if(eolian_property_keys_get(fid) != NULL);
- fail_if(!(iter = eolian_property_values_get(fid)));
+ fail_if(eolian_property_keys_get(fid, EOLIAN_PROP_GET) != NULL);
+ fail_if(!(iter = eolian_property_values_get(fid, EOLIAN_PROP_GET)));
fail_if(!(eina_iterator_next(iter, (void**)¶m)));
fail_if(eina_iterator_next(iter, &dummy));
eina_iterator_free(iter);
fail_if(eolian_function_is_legacy_only(fid, EOLIAN_METHOD));
/* Function parameters */
- fail_if(!(iter = eolian_property_values_get(fid)));
+ fail_if(!(iter = eolian_function_parameters_get(fid)));
fail_if(!(eina_iterator_next(iter, (void**)¶m)));
fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "int"));