From 6389434222007c31147f49670e7450b94ebb5b83 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 11 Apr 2018 11:52:18 +0200 Subject: [PATCH] input_filter: rm input selection in output node This patch largely reverts the feature of selecting parts of input nodes from within the output node (as originally introduced by commit 7263cae5a18b4f1f2293d031f9bafcf05ba51146). The selection of content should be consistently performed by input nodes instead. The principle ability of copying input nodes verbatim into the output stays available. Issue #2691 --- repos/os/src/server/rom_filter/README | 4 ++-- .../os/src/server/rom_filter/input_rom_registry.h | 9 ++++----- repos/os/src/server/rom_filter/main.cc | 14 ++------------ 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/repos/os/src/server/rom_filter/README b/repos/os/src/server/rom_filter/README index db4d559657..6e142d28f2 100644 --- a/repos/os/src/server/rom_filter/README +++ b/repos/os/src/server/rom_filter/README @@ -36,8 +36,8 @@ The '' node can contain the following sub nodes: nodes as the '' node. :'': - Copies all sub nodes named by the 'sub_node' attribute of the input ROM - specified by the 'name' attribute to the output node. + Copies the content of the input specified by the 'name' attribute to the + output node. :'': Adds an attribute with the specified 'name' and 'value'. If the node diff --git a/repos/os/src/server/rom_filter/input_rom_registry.h b/repos/os/src/server/rom_filter/input_rom_registry.h index 43eb0cc1d9..6727b146b4 100644 --- a/repos/os/src/server/rom_filter/input_rom_registry.h +++ b/repos/os/src/server/rom_filter/input_rom_registry.h @@ -429,18 +429,17 @@ class Rom_filter::Input_rom_registry } /** - * Lookup content of input with specified name + * Generate content of the specifed input * - * \throw Nonexistent_input_value + * \throw Nonexistent_input_node */ - Xml_node xml(Input_name const &input_name) const + void gen_xml(Input_name const &input_name, Genode::Xml_generator &xml) { Entry const *e = _lookup_entry_by_name(input_name); - if (!e) throw Nonexistent_input_node(); - return e->node(); + xml.append(e->node().addr(), e->node().size()); } }; diff --git a/repos/os/src/server/rom_filter/main.cc b/repos/os/src/server/rom_filter/main.cc index 184085ab50..75026c56da 100644 --- a/repos/os/src/server/rom_filter/main.cc +++ b/repos/os/src/server/rom_filter/main.cc @@ -345,23 +345,13 @@ void Rom_filter::Main::_evaluate_node(Xml_node node, Xml_generator &xml) } else if (node.has_type("input")) { - typedef Genode::String<128> String; Input_name const input_name = node.attribute_value("name", Input_name()); - String const sub_node = - node.attribute_value("sub_node", String()); - - if (!sub_node.valid()) - return; - try { - Xml_node input_node = _input_rom_registry.xml(input_name); - - input_node.for_each_sub_node(sub_node.string(), - [&] (Xml_node node) { xml.append(node.addr(), node.size()); }); - } catch (...) { } + _input_rom_registry.gen_xml(input_name, xml); } + catch (...) { } } };