diff options
| author | Daniil Baturin <daniil@baturin.org> | 2016-12-20 17:19:21 +0700 |
|---|---|---|
| committer | Daniil Baturin <daniil@baturin.org> | 2016-12-20 17:19:21 +0700 |
| commit | f0eeeead03cd27c375ca28161dab603bee56341c (patch) | |
| tree | 00dbf4d4c828daed1ab3421acf8339b40bd9897b /src/config_tree.ml | |
| parent | b85abf9de8c388e5d3d10b144f76d0a16b175543 (diff) | |
| download | vyconf-f0eeeead03cd27c375ca28161dab603bee56341c.tar.gz vyconf-f0eeeead03cd27c375ca28161dab603bee56341c.zip | |
T224: add node comment functionality to the config tree.
Diffstat (limited to 'src/config_tree.ml')
| -rw-r--r-- | src/config_tree.ml | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/config_tree.ml b/src/config_tree.ml index cdcbd1c..b97f150 100644 --- a/src/config_tree.ml +++ b/src/config_tree.ml @@ -7,14 +7,14 @@ exception Useless_set type config_node_data = { values: string list; - comment: string; + comment: string option; } type t = config_node_data Vytree.t let default_data = { values = []; - comment = ""; + comment = None; } let make name = Vytree.make default_data name @@ -77,3 +77,10 @@ let delete node path value = | None -> Vytree.delete node path +let set_comment node path comment = + let data = Vytree.get_data node path in + Vytree.update node path {data with comment=comment} + +let get_comment node path = + let data = Vytree.get_data node path in + data.comment |
