summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vytree.ml2
-rw-r--r--src/vytree.mli2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/vytree.ml b/src/vytree.ml
index 93d3d71..b5dcba6 100644
--- a/src/vytree.ml
+++ b/src/vytree.ml
@@ -97,6 +97,8 @@ let rec get node path =
| [name] -> find_or_fail node name
| name :: names -> get (find_or_fail node name) names
+let get_data node path = data_of_node @@ get node path
+
let exists node path =
try ignore (get node path); true
with Nonexistent_path -> false
diff --git a/src/vytree.mli b/src/vytree.mli
index e912922..6a7eda1 100644
--- a/src/vytree.mli
+++ b/src/vytree.mli
@@ -31,4 +31,6 @@ val get : 'a t -> string list -> 'a t
val get_existent_path : 'a t -> string list -> string list
+val get_data : 'a t -> string list -> 'a
+
val exists : 'a t -> string list -> bool