forked from enlightenment/efl
eolian: eolian_file_parse -> eolian_state_file_parse
This commit is contained in:
parent
436f2d3363
commit
9f79d4ff22
|
@ -530,6 +530,22 @@ EAPI Eina_Bool eolian_state_directory_add(Eolian_State *state, const char *dir);
|
|||
*/
|
||||
EAPI Eina_Bool eolian_state_system_directory_add(Eolian_State *state);
|
||||
|
||||
/*
|
||||
* @brief Parse the given .eo or .eot file and fill the database.
|
||||
*
|
||||
* The input can be either a full path to the file or only a filename.
|
||||
* If it's a filename, it must be scanned for first.
|
||||
*
|
||||
* @param[in] state The Eolian state.
|
||||
* @param[in] filepath Path to the file to parse.
|
||||
* @return The unit corresponding to the parsed file or NULL.
|
||||
*
|
||||
* @see eolian_state_directory_add
|
||||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI const Eolian_Unit *eolian_state_file_parse(Eolian_State *state, const char *filepath);
|
||||
|
||||
/*
|
||||
* @brief Get an Eolian unit by file name.
|
||||
*
|
||||
|
@ -582,22 +598,6 @@ EAPI Eina_Iterator *eolian_unit_children_get(const Eolian_Unit *unit);
|
|||
*/
|
||||
EAPI const char *eolian_unit_file_get(const Eolian_Unit *unit);
|
||||
|
||||
/*
|
||||
* @brief Parse the given .eo or .eot file and fill the database.
|
||||
*
|
||||
* The input can be either a full path to the file or only a filename.
|
||||
* If it's a filename, it must be scanned for first.
|
||||
*
|
||||
* @param[in] state The Eolian state.
|
||||
* @param[in] filepath Path to the file to parse.
|
||||
* @return The unit corresponding to the parsed file or NULL.
|
||||
*
|
||||
* @see eolian_directory_scan
|
||||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI const Eolian_Unit *eolian_file_parse(Eolian_State *state, const char *filepath);
|
||||
|
||||
/*
|
||||
* @brief Get an iterator to all .eo file names with paths.
|
||||
*
|
||||
|
@ -2668,6 +2668,10 @@ EAPI Eina_Bool eolian_directory_scan(Eolian_State *state, const char *dir);
|
|||
/* DEPRECATED */
|
||||
EAPI Eina_Bool eolian_system_directory_scan(Eolian_State *state);
|
||||
|
||||
/* DEPRECATED */
|
||||
EAPI const Eolian_Unit *eolian_file_parse(Eolian_State *state, const char *filepath);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -662,54 +662,6 @@ eolian_system_directory_scan(Eolian_State *state)
|
|||
return eolian_state_system_directory_add(state);
|
||||
}
|
||||
|
||||
EAPI const Eolian_Unit *
|
||||
eolian_state_unit_by_file_get(const Eolian_State *state, const char *file_name)
|
||||
{
|
||||
if (!state) return NULL;
|
||||
Eina_Stringshare *shr = eina_stringshare_add(file_name);
|
||||
Eolian_Unit *unit = eina_hash_find(state->units, shr);
|
||||
eina_stringshare_del(shr);
|
||||
return unit;
|
||||
}
|
||||
|
||||
EAPI Eina_Iterator *
|
||||
eolian_state_units_get(const Eolian_State *state)
|
||||
{
|
||||
if (!state) return NULL;
|
||||
return eina_hash_iterator_data_new(state->units);
|
||||
}
|
||||
|
||||
EAPI Eina_Iterator *
|
||||
eolian_unit_children_get(const Eolian_Unit *unit)
|
||||
{
|
||||
if (!unit) return NULL;
|
||||
return eina_hash_iterator_data_new(unit->children);
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
eolian_unit_file_get(const Eolian_Unit *unit)
|
||||
{
|
||||
if (!unit) return NULL;
|
||||
return unit->file;
|
||||
}
|
||||
|
||||
char *
|
||||
database_class_to_filename(const char *cname)
|
||||
{
|
||||
char *ret;
|
||||
Eina_Strbuf *strbuf = eina_strbuf_new();
|
||||
eina_strbuf_append(strbuf, cname);
|
||||
eina_strbuf_replace_all(strbuf, ".", "_");
|
||||
eina_strbuf_append(strbuf, ".eo");
|
||||
|
||||
ret = eina_strbuf_string_steal(strbuf);
|
||||
eina_strbuf_free(strbuf);
|
||||
|
||||
eina_str_tolower(&ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static Eolian_Unit *
|
||||
_eolian_file_parse_nodep(Eolian_Unit *parent, const char *filepath)
|
||||
{
|
||||
|
@ -814,7 +766,7 @@ _merge_units(Eolian_Unit *unit)
|
|||
}
|
||||
|
||||
EAPI const Eolian_Unit *
|
||||
eolian_file_parse(Eolian_State *state, const char *filepath)
|
||||
eolian_state_file_parse(Eolian_State *state, const char *filepath)
|
||||
{
|
||||
if (!state)
|
||||
return NULL;
|
||||
|
@ -831,6 +783,12 @@ eolian_file_parse(Eolian_State *state, const char *filepath)
|
|||
return &state->unit;
|
||||
}
|
||||
|
||||
EAPI const Eolian_Unit *
|
||||
eolian_file_parse(Eolian_State *state, const char *filepath)
|
||||
{
|
||||
return eolian_state_file_parse(state, filepath);
|
||||
}
|
||||
|
||||
typedef struct _Parse_Data
|
||||
{
|
||||
Eolian_State *state;
|
||||
|
@ -895,6 +853,54 @@ eolian_all_eo_files_parse(Eolian_State *state)
|
|||
return pd.ret;
|
||||
}
|
||||
|
||||
EAPI const Eolian_Unit *
|
||||
eolian_state_unit_by_file_get(const Eolian_State *state, const char *file_name)
|
||||
{
|
||||
if (!state) return NULL;
|
||||
Eina_Stringshare *shr = eina_stringshare_add(file_name);
|
||||
Eolian_Unit *unit = eina_hash_find(state->units, shr);
|
||||
eina_stringshare_del(shr);
|
||||
return unit;
|
||||
}
|
||||
|
||||
EAPI Eina_Iterator *
|
||||
eolian_state_units_get(const Eolian_State *state)
|
||||
{
|
||||
if (!state) return NULL;
|
||||
return eina_hash_iterator_data_new(state->units);
|
||||
}
|
||||
|
||||
EAPI Eina_Iterator *
|
||||
eolian_unit_children_get(const Eolian_Unit *unit)
|
||||
{
|
||||
if (!unit) return NULL;
|
||||
return eina_hash_iterator_data_new(unit->children);
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
eolian_unit_file_get(const Eolian_Unit *unit)
|
||||
{
|
||||
if (!unit) return NULL;
|
||||
return unit->file;
|
||||
}
|
||||
|
||||
char *
|
||||
database_class_to_filename(const char *cname)
|
||||
{
|
||||
char *ret;
|
||||
Eina_Strbuf *strbuf = eina_strbuf_new();
|
||||
eina_strbuf_append(strbuf, cname);
|
||||
eina_strbuf_replace_all(strbuf, ".", "_");
|
||||
eina_strbuf_append(strbuf, ".eo");
|
||||
|
||||
ret = eina_strbuf_string_steal(strbuf);
|
||||
eina_strbuf_free(strbuf);
|
||||
|
||||
eina_str_tolower(&ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
EAPI Eina_Iterator *
|
||||
eolian_all_eot_files_get(const Eolian_State *state)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue