Functions
-
template <typename T>bool VisitProperties (const inspect::Hierarchy & hierarchyconst std::vector<std::string_view> & property_selectorfit::function<void (const std::vector<std::string_view> &, const T &)> visitor)Visit properties of a given type using a property selector.
The property_selector defines the list of node names to follow, and it always ends in a
property name. Special values inspect::kPathWildcard and inspect::kPathRecursive may be
set to match all children/properties of a node or recurse to all child nodes respectively.
Examples:
{"child", "value"} - Match only root/child/value.
{"child", "*"} - Match all properties of root/child
{"child", "*", "value"} - Match all properties of children of root/child that are
called "value". Such as root/child/a/value and
root/child/b/value
{"child", "**"} - Match all values under the subtree rooted at root/child.
Note that this function may be called for a specific type only, it will need to be called
multiple times to match multiple types.
Examples:
IntPropertyValue
IntArrayValue
StringPropertyValue
The visitor obtains the matching path (not including root) to each matching property as well
as the decoded property itself.
Returns true if all eligible properties were visited, and false if there was an error with the
property selector.
Defined at line 50 of file ../../sdk/lib/inspect/contrib/cpp/read_visitor.h