diff options
Diffstat (limited to 'src/analysis/types/template.c')
-rw-r--r-- | src/analysis/types/template.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/analysis/types/template.c b/src/analysis/types/template.c index 29d39bc..f26e038 100644 --- a/src/analysis/types/template.c +++ b/src/analysis/types/template.c @@ -64,6 +64,9 @@ static GDataType *g_template_type_dup(const GTemplateType *); /* Décrit le type fourni sous forme de caractères. */ static char *g_template_type_to_string(const GTemplateType *); +/* Procède à l'impression de la description d'un type. */ +static void g_template_type_output(const GTemplateType *, GLangOutput *, GBufferLine *, bool, bool); + /* Indique le type défini pour un type reposant sur des gabarits. */ @@ -109,6 +112,7 @@ static void g_template_type_init(GTemplateType *type) data_type->dup = (type_dup_fc)g_template_type_dup; data_type->to_string = (type_to_string_fc)g_template_type_to_string; + data_type->output = (output_type_fc)g_template_type_output; ce_type = G_CLASS_ENUM_TYPE(type); @@ -216,6 +220,44 @@ static char *g_template_type_to_string(const GTemplateType *type) /****************************************************************************** * * +* Paramètres : type = type à afficher. * +* lang = langage à utiliser pour la sortie humaine. * +* buffer = tampon mis à disposition pour la sortie. * +* info = nature du cadre de destination. * +* full = besoin de descriptions étendues ? * +* * +* Description : Procède à l'impression de la description d'un type. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_template_type_output(const GTemplateType *type, GLangOutput *lang, GBufferLine *line, bool info, bool full) +{ + size_t i; /* Boucle de parcours */ + + g_class_enum_type_output(G_CLASS_ENUM_TYPE(type), lang, line, info, full); + + g_buffer_line_insert_text(line, BLC_LAST_USED, "<", 1, info ? RTT_COMMENT : RTT_LTGT); + + for (i = 0; i < type->models_count; i++) + { + if (i > 0) + g_buffer_line_insert_text(line, BLC_LAST_USED, ", ", 2, info ? RTT_COMMENT : RTT_SIGNS); + + g_data_type_output(type->models[i], lang, line, info, full); + + } + + g_buffer_line_insert_text(line, BLC_LAST_USED, ">", 1, info ? RTT_COMMENT : RTT_LTGT); + +} + + +/****************************************************************************** +* * * Paramètres : type = type à mettre à jour. * * list = élements du modèle sur lequel doit reposer le type. * * * |