summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2015-02-09 02:57:32 +0600
committerDaniil Baturin <daniil@baturin.org>2015-02-09 02:57:32 +0600
commit9cffcca10c0319b6b603afce33aab0bdea1cdddc (patch)
tree971130421e535b2bbe76f8fdb02c41fdb5931457
parent72569f0c5562d7ba7522b6456241567c0fcd32ac (diff)
downloadvyconf-9cffcca10c0319b6b603afce33aab0bdea1cdddc.tar.gz
vyconf-9cffcca10c0319b6b603afce33aab0bdea1cdddc.zip
Add list_children function.
-rw-r--r--src/vyconf_tree.ml8
1 files changed, 8 insertions, 0 deletions
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