From 0782e96c36d1886c62852399baa93f18769acdf3 Mon Sep 17 00:00:00 2001 From: Daniel Zaoui Date: Wed, 14 May 2014 14:26:50 +0300 Subject: [PATCH] Eolian/Generator: fix the class description generation. The class description was not used during the generation of the legacy and Eo headers. --- src/bin/eolian/eo1_generator.c | 14 ++++++++++++++ src/bin/eolian/legacy_generator.c | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/bin/eolian/eo1_generator.c b/src/bin/eolian/eo1_generator.c index 3ccc9b3..7570842 100644 --- a/src/bin/eolian/eo1_generator.c +++ b/src/bin/eolian/eo1_generator.c @@ -249,6 +249,20 @@ eo_header_generate(const char *classname, Eina_Strbuf *buf) return EINA_FALSE; } + const char *desc = eolian_class_description_get(classname); + Eina_Strbuf *linedesc = eina_strbuf_new(); + eina_strbuf_append(linedesc, "/**\n"); + if (desc) + { + eina_strbuf_append(linedesc, desc); + eina_strbuf_replace_all(linedesc, "\n", "\n * "); + } + + eina_strbuf_append(linedesc, "\n */\n"); + eina_strbuf_replace_all(linedesc, " * \n", " *\n"); /* Remove trailing whitespaces */ + eina_strbuf_append(buf, eina_strbuf_string_get(linedesc)); + eina_strbuf_free(linedesc); + _template_fill(str_hdr, tmpl_eo_obj_header, classname, "", EINA_TRUE); eina_strbuf_replace_all(str_hdr, "@#EOPREFIX", current_eo_prefix_upper); diff --git a/src/bin/eolian/legacy_generator.c b/src/bin/eolian/legacy_generator.c index b6d865c..8c43792 100644 --- a/src/bin/eolian/legacy_generator.c +++ b/src/bin/eolian/legacy_generator.c @@ -356,6 +356,20 @@ legacy_header_generate(const char *classname, Eina_Strbuf *buf) return EINA_FALSE; } + const char *desc = eolian_class_description_get(classname); + Eina_Strbuf *linedesc = eina_strbuf_new(); + eina_strbuf_append(linedesc, "/**\n"); + if (desc) + { + eina_strbuf_append(linedesc, desc); + eina_strbuf_replace_all(linedesc, "\n", "\n * "); + } + + eina_strbuf_append(linedesc, "\n */\n"); + eina_strbuf_replace_all(linedesc, " * \n", " *\n"); /* Remove trailing whitespaces */ + eina_strbuf_append(buf, eina_strbuf_string_get(linedesc)); + eina_strbuf_free(linedesc); + int i; for (i = 0; i < 2; i++) EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, ftype_order[i]), l, data) -- 2.7.4