summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2015-08-28 07:01:18 +0600
committerDaniil Baturin <daniil@baturin.org>2015-08-28 07:01:18 +0600
commit25138074b99e0bb3dbc89018ca40ddcbc3c6a702 (patch)
tree97ca541c6c7125bb1aa587cac97524b709631efd /src
parent8caa65f953642cd8fe12ca6493b25a463093f30b (diff)
downloadvyconf-25138074b99e0bb3dbc89018ca40ddcbc3c6a702.tar.gz
vyconf-25138074b99e0bb3dbc89018ca40ddcbc3c6a702.zip
Add is_multi function to the reference tree module.
This is important for decision is set should add or replace a value.
Diffstat (limited to 'src')
-rw-r--r--src/reference_tree.ml4
-rw-r--r--src/reference_tree.mli2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/reference_tree.ml b/src/reference_tree.ml
index f7a2ffb..28a87a6 100644
--- a/src/reference_tree.ml
+++ b/src/reference_tree.ml
@@ -167,3 +167,7 @@ let rec validate_path validators node path =
| Some c -> aux c ps (p :: acc)
| None -> raise (Validation_error ((Printf.sprintf "Path %s is incomplete" (show_path acc))))))
in aux node path []
+
+let is_multi reftree path =
+ let data = Vytree.get_data reftree path in
+ data.multi
diff --git a/src/reference_tree.mli b/src/reference_tree.mli
index 5171203..c24b6f2 100644
--- a/src/reference_tree.mli
+++ b/src/reference_tree.mli
@@ -19,3 +19,5 @@ val default_data : ref_node_data
val load_from_xml : t -> string -> t
val validate_path : (string, string) Hashtbl.t -> t -> string list -> string list * string option
+
+val is_multi : t -> string list -> bool