From 2f483500b0a337f5d5389880c3ae8e13ad386df7 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 19 Nov 2013 14:18:08 +0100 Subject: [PATCH] Add 'Xml_node::has_sub_node' accessor --- os/include/util/xml_node.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/os/include/util/xml_node.h b/os/include/util/xml_node.h index 9474092f1..c6d4b4029 100644 --- a/os/include/util/xml_node.h +++ b/os/include/util/xml_node.h @@ -705,6 +705,15 @@ namespace Genode { try { attribute(type); return true; } catch (...) { } return false; } + + /** + * Return true if sub node of specified type exists + */ + inline bool has_sub_node(char const *type) const + { + try { sub_node(type); return true; } catch (...) { } + return false; + } }; }