libcamera: value_node: Support looking up descendant node by path
Looking up a descendant node based on a path is a common operation. Add a helper function to do so, to avoid loops in the callers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
This commit is contained in:
@@ -237,6 +237,7 @@ public:
|
||||
bool contains(std::string_view key) const;
|
||||
ValueNode *at(std::string_view key);
|
||||
const ValueNode &operator[](std::string_view key) const;
|
||||
const ValueNode &operator[](std::initializer_list<std::string_view> path) const;
|
||||
|
||||
ValueNode *add(std::unique_ptr<ValueNode> &&child);
|
||||
ValueNode *add(std::string key, std::unique_ptr<ValueNode> &&child);
|
||||
|
||||
Reference in New Issue
Block a user