summaryrefslogtreecommitdiff
path: root/plugins/yaml/pair.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/yaml/pair.h')
-rw-r--r--plugins/yaml/pair.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/plugins/yaml/pair.h b/plugins/yaml/pair.h
index 986fef7..5265392 100644
--- a/plugins/yaml/pair.h
+++ b/plugins/yaml/pair.h
@@ -2,7 +2,7 @@
/* Chrysalide - Outil d'analyse de fichiers binaires
* pair.h - prototypes pour un noeud Yaml de paire clef/valeur
*
- * Copyright (C) 2020 Cyrille Bagard
+ * Copyright (C) 2020-2023 Cyrille Bagard
*
* This file is part of Chrysalide.
*
@@ -30,7 +30,6 @@
#include "collection.h"
-#include "line.h"
#include "node.h"
@@ -49,23 +48,42 @@ typedef struct _GYamlPair GYamlPair;
typedef struct _GYamlPairClass GYamlPairClass;
+/* Format d'origine des éléments du couple clef/valeur */
+typedef enum _YamlOriginalStyle
+{
+ YOS_PLAIN, /* Mode brut, par défaut */
+ YOS_SINGLE_QUOTED, /* Encadré simplement */
+ YOS_DOUBLE_QUOTED, /* ENcadré avec des guillemets */
+
+} YamlOriginalStyle;
+
+
/* Indique le type défini pour un noeud d'arborescence Yaml. */
GType g_yaml_pair_get_type(void);
/* Construit un noeud d'arborescence Yaml. */
-GYamlPair *g_yaml_pair_new(GYamlLine *);
+GYamlPair *g_yaml_pair_new(const char *, YamlOriginalStyle, const char *, YamlOriginalStyle);
/* Fournit la clef représentée dans une paire en Yaml. */
const char *g_yaml_pair_get_key(const GYamlPair *);
+/* Indique le format d'origine YAML associé à la clef. */
+YamlOriginalStyle g_yaml_pair_get_key_style(const GYamlPair *);
+
/* Fournit l'éventuelle valeur d'une paire en Yaml. */
const char *g_yaml_pair_get_value(const GYamlPair *);
+/* Indique le format d'origine YAML associé à la valeur. */
+YamlOriginalStyle g_yaml_pair_get_value_style(const GYamlPair *);
+
+/* Rassemble une éventuelle séquence de valeurs attachées. */
+char *g_yaml_pair_aggregate_value(const GYamlPair *);
+
/* Attache une collection de noeuds Yaml à un noeud. */
-void g_yaml_pair_set_collection(GYamlPair *, GYamlCollection *);
+void g_yaml_pair_set_children(GYamlPair *, GYamlCollection *);
/* Fournit une éventuelle collection rattachée à un noeud. */
-GYamlCollection *g_yaml_pair_get_collection(const GYamlPair *);
+GYamlCollection *g_yaml_pair_get_children(const GYamlPair *);