cleanup, docs
This commit is contained in:
@@ -5,6 +5,7 @@ StringList DValue::keys() const
|
||||
return value : child keys for map/list values; empty for scalars
|
||||
|
||||
:see
|
||||
>types
|
||||
0_DValue
|
||||
2_DValue_each
|
||||
0_StringList
|
||||
@@ -12,6 +13,8 @@ return value : child keys for map/list values; empty for scalars
|
||||
:content
|
||||
Returns the keys produced by `each()`. Scalar values have no child key, so the result is empty. List-shaped values return their numeric keys as strings.
|
||||
|
||||
```cpp
|
||||
StringList names = context.props["user"].keys();
|
||||
```
|
||||
:example
|
||||
DValue user;
|
||||
user["name"] = "Ada";
|
||||
user["role"] = "admin";
|
||||
print(join(user.keys().sort(), ","), "\n");
|
||||
|
||||
Reference in New Issue
Block a user