forked from enlightenment/efl
Eolian: add API to retrieve the file name of a class
This commit is contained in:
parent
17debde44b
commit
183ecab18b
|
@ -192,6 +192,15 @@ EAPI Eina_Bool eolian_show(const char *class_name);
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eolian_class_find_by_file(const char *file_name);
|
eolian_class_find_by_file(const char *file_name);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @brief Returns the name of the file containing the given class.
|
||||||
|
*
|
||||||
|
* @param[in] class_name name of the class.
|
||||||
|
* @return the name of the file on success or NULL otherwise.
|
||||||
|
*/
|
||||||
|
EAPI const char *
|
||||||
|
eolian_class_file_get(const char *class_name);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief Returns the class type of the given class
|
* @brief Returns the class type of the given class
|
||||||
*
|
*
|
||||||
|
|
|
@ -238,6 +238,13 @@ database_class_file_set(const char *class_name, const char *file_name)
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI const char *
|
||||||
|
eolian_class_file_get(const char *class_name)
|
||||||
|
{
|
||||||
|
Class_desc *cl = _class_get(class_name);
|
||||||
|
return cl ? cl->file : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eolian_class_find_by_file(const char *file_name)
|
eolian_class_find_by_file(const char *file_name)
|
||||||
{
|
{
|
||||||
|
|
|
@ -156,6 +156,7 @@ START_TEST(eolian_simple_parsing)
|
||||||
/* Parsing */
|
/* Parsing */
|
||||||
fail_if(!eolian_eo_file_parse(PACKAGE_DATA_DIR"/data/class_simple.eo"));
|
fail_if(!eolian_eo_file_parse(PACKAGE_DATA_DIR"/data/class_simple.eo"));
|
||||||
fail_if(strcmp(eolian_class_find_by_file(PACKAGE_DATA_DIR"/data/class_simple.eo"), class_name));
|
fail_if(strcmp(eolian_class_find_by_file(PACKAGE_DATA_DIR"/data/class_simple.eo"), class_name));
|
||||||
|
fail_if(strcmp(eolian_class_file_get(class_name), PACKAGE_DATA_DIR"/data/class_simple.eo"));
|
||||||
|
|
||||||
/* Class */
|
/* Class */
|
||||||
fail_if(!eolian_class_exists(class_name));
|
fail_if(!eolian_class_exists(class_name));
|
||||||
|
|
Loading…
Reference in New Issue