cleanup, docs

This commit is contained in:
root
2026-06-16 12:21:31 +00:00
parent dff1959341
commit ea08d5f28b
296 changed files with 1571 additions and 1940 deletions
+8 -5
View File
@@ -6,6 +6,7 @@ f : callback invoked for each child, or once for a scalar value
return value : none
:see
>types
0_DValue
2_DValue_map
2_DValue_filter
@@ -16,8 +17,10 @@ Iterates a `DValue` without modifying it. References are dereferenced before ite
For map-shaped values, the callback receives each child and its key. List-shaped maps iterate in numeric index order (`0`, `1`, `2`, ...); ordinary maps iterate in `std::map` string-key order. Scalar values invoke the callback once with the current value and an empty key.
```cpp
rows.each([&](const DValue& row, String key) {
print(key, ": ", row.get_by_path("title").to_string("Untitled"), "\n");
});
```
:example
DValue user;
user["name"] = "Ada";
user["role"] = "admin";
StringList keys;
user.each([&](const DValue& item, String key) { keys.push_back(key); });
print(join(keys.sort(), ","), "\n");