refactor: rename DTree to DValue
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
:sig
|
||||
DTree DTree::get_by_path(String path, String delim = "/") const
|
||||
DValue DValue::get_by_path(String path, String delim = "/") const
|
||||
|
||||
:params
|
||||
path : slash-delimited path to traverse
|
||||
delim : optional path separator
|
||||
return value : the resolved child node, or an empty `DTree` when the path cannot be followed
|
||||
return value : the resolved child node, or an empty `DValue` when the path cannot be followed
|
||||
|
||||
:see
|
||||
0_DTree
|
||||
0_DValue
|
||||
0_Request
|
||||
>types
|
||||
json_decode
|
||||
@@ -15,9 +15,9 @@ has
|
||||
to_string
|
||||
|
||||
:content
|
||||
Traverses a nested `DTree` without creating missing keys. This is a read accessor: it is `const` and never modifies the tree, unlike `operator[]`, which creates missing entries.
|
||||
Traverses a nested `DValue` without creating missing keys. This is a read accessor: it is `const` and never modifies the tree, unlike `operator[]`, which creates missing entries.
|
||||
|
||||
Empty path segments are ignored, so leading and trailing `/` characters are harmless. If any intermediate node is not a map or a segment is missing, `get_by_path()` returns an empty `DTree`.
|
||||
Empty path segments are ignored, so leading and trailing `/` characters are harmless. If any intermediate node is not a map or a segment is missing, `get_by_path()` returns an empty `DValue`.
|
||||
|
||||
A missing path therefore reads like an empty value — combine it with the `to_*` default arguments to express a fallback in one call:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user