From 9cffcca10c0319b6b603afce33aab0bdea1cdddc Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 9 Feb 2015 02:57:32 +0600 Subject: Add list_children function. --- src/vyconf_tree.ml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/vyconf_tree.ml b/src/vyconf_tree.ml index 08bb652..71a7272 100644 --- a/src/vyconf_tree.ml +++ b/src/vyconf_tree.ml @@ -48,6 +48,14 @@ let replace_child node child = let find_child node name = find_child_in_list node.children name +let rec extract_names children = + match children with + | [] -> [] + | c :: cs -> c.name :: extract_names cs + +let list_children node = + extract_names node.children + let rec insert_child default_data node path data = match path with | [] -> raise Empty_path -- cgit v1.2.3