Eolian: Improve support (still incomplete) for namespaces.

This commit is contained in:
Tom Hacohen 2014-06-19 15:56:38 +01:00
parent bd65b5db5d
commit 8a4849b1eb
1 changed files with 17 additions and 2 deletions

View File

@ -1389,6 +1389,22 @@ eolian_directory_scan(const char *dir)
return EINA_TRUE; return EINA_TRUE;
} }
static char *
_eolian_class_to_filename(const char *filename)
{
char *ret;
Eina_Strbuf *strbuf = eina_strbuf_new();
eina_strbuf_append(strbuf, filename);
eina_strbuf_replace_all(strbuf, "::", "_");
ret = eina_strbuf_string_steal(strbuf);
eina_strbuf_free(strbuf);
eina_str_tolower(&ret);
return ret;
}
EAPI Eina_Bool eolian_eo_file_parse(const char *filepath) EAPI Eina_Bool eolian_eo_file_parse(const char *filepath)
{ {
const Eina_List *itr; const Eina_List *itr;
@ -1409,8 +1425,7 @@ EAPI Eina_Bool eolian_eo_file_parse(const char *filepath)
{ {
if (!eolian_class_find_by_name(inherit_name)) if (!eolian_class_find_by_name(inherit_name))
{ {
char *filename = strdup(inherit_name); char *filename = _eolian_class_to_filename(inherit_name);
eina_str_tolower(&filename);
filepath = eina_hash_find(_filenames, filename); filepath = eina_hash_find(_filenames, filename);
if (!filepath) if (!filepath)
{ {