diff --git a/repos/base/include/util/xml_node.h b/repos/base/include/util/xml_node.h index 75de24118..6ae83a8b6 100644 --- a/repos/base/include/util/xml_node.h +++ b/repos/base/include/util/xml_node.h @@ -16,11 +16,13 @@ #include #include +#include #include namespace Genode { class Xml_attribute; class Xml_node; + class Xml_unquoted; } @@ -276,6 +278,8 @@ class Genode::Xml_node */ class Tag; + friend class Xml_unquoted; + public: /********************* @@ -1105,4 +1109,38 @@ class Genode::Xml_node } }; + +class Genode::Xml_unquoted : Noncopyable +{ + private: + + struct + { + char const *base; + size_t len; + } const _content_ptr; + + public: + + template + Xml_unquoted(String const &string) + : _content_ptr({ string.string(), string.length() - 1}) + { } + + void print(Output &out) const + { + char const *src = _content_ptr.base; + size_t len = _content_ptr.len; + + while (len > 0) { + Xml_node::Decoded_character const decoded_character(src, len); + + Genode::print(out, Char(decoded_character.character)); + + src += decoded_character.encoded_len; + len -= decoded_character.encoded_len; + } + } +}; + #endif /* _INCLUDE__UTIL__XML_NODE_H_ */