libcamera: value_node: Add functions to erase child nodes

There will be a need to erase child nodes when implementing support for
overriding configuration options. Add two erase() functions to the
ValueNode class, mimicking the add() API.

More erase() overloads could be added, for instance taking iterators as
parameters, to improve efficiency. This should be considered later, when
usage of the ValueNode class will expand, based on the actual usage
patterns.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
This commit is contained in:
Laurent Pinchart
2026-03-26 17:16:19 +02:00
parent bb1f1f1da9
commit 52e65c9f38
2 changed files with 57 additions and 0 deletions
+3
View File
@@ -244,6 +244,9 @@ public:
ValueNode *add(std::initializer_list<std::string_view> path,
std::unique_ptr<ValueNode> &&child);
void erase(std::string_view key);
void erase(std::initializer_list<std::string_view> path);
private:
LIBCAMERA_DISABLE_COPY_AND_MOVE(ValueNode)