mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-11 03:41:43 +00:00
rom_filter: allow use of input as attribute value
This commit is contained in:
parent
1514667b42
commit
e204b9532b
@ -34,6 +34,11 @@ The '<output>' node can contain the following sub nodes:
|
|||||||
Copies all sub nodes named by the 'sub_node' attribute of the input ROM
|
Copies all sub nodes named by the 'sub_node' attribute of the input ROM
|
||||||
specified by the 'name' attribute to the output node.
|
specified by the 'name' attribute to the output node.
|
||||||
|
|
||||||
|
:'<attribute>':
|
||||||
|
Adds an attribute with the specified 'name' and 'value'. If the node
|
||||||
|
has an 'input' attribute, the content of the specified input is taken
|
||||||
|
as attribute value.
|
||||||
|
|
||||||
|
|
||||||
Conditions
|
Conditions
|
||||||
----------
|
----------
|
||||||
|
@ -283,10 +283,31 @@ void Rom_filter::Main::_evaluate_node(Xml_node node, Xml_generator &xml)
|
|||||||
} else
|
} else
|
||||||
|
|
||||||
if (node.has_type("attribute")) {
|
if (node.has_type("attribute")) {
|
||||||
|
|
||||||
typedef Genode::String<128> String;
|
typedef Genode::String<128> String;
|
||||||
xml.attribute(
|
|
||||||
node.attribute_value("name", String()).string(),
|
/* assign input value to attribute value */
|
||||||
node.attribute_value("value", String()).string());
|
if (node.has_attribute("input")) {
|
||||||
|
|
||||||
|
Input_name const input_name =
|
||||||
|
node.attribute_value("input", Input_name());
|
||||||
|
try {
|
||||||
|
Input_value const input_value =
|
||||||
|
_input_rom_registry.query_value(_config.xml(), input_name);
|
||||||
|
|
||||||
|
xml.attribute(node.attribute_value("name", String()).string(),
|
||||||
|
input_value);
|
||||||
|
}
|
||||||
|
catch (Input_rom_registry::Nonexistent_input_value) {
|
||||||
|
Genode::warning("could not obtain input value for input ", input_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* assign fixed attribute value */
|
||||||
|
else {
|
||||||
|
xml.attribute(node.attribute_value("name", String()).string(),
|
||||||
|
node.attribute_value("value", String()).string());
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
|
|
||||||
if (node.has_type("inline")) {
|
if (node.has_type("inline")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user