session_label: make typedef String public

Internally, Genode::Session_label has a typedef from String<capacity()> to
String. To have this typedef public is especially useful when reading a
label from an XML node. This can then be written as

! Session_label label = node.attribute_value("label", Session_label::String());

instead of

! Session_label label = node.attribute_value("label", String<160>());

which would be less generic (Session_label cannot be used directly as there
is no appropriate ascii_to implementation).

Issue #2840
This commit is contained in:
Martin Stein 2018-06-05 13:52:26 +02:00 committed by Norman Feske
parent 14357b0b44
commit fc90c5f8f0

View File

@ -25,13 +25,12 @@ struct Genode::Session_label : String<160>
{ {
private: private:
typedef String<capacity()> String;
static char const *_separator() { return " -> "; } static char const *_separator() { return " -> "; }
static size_t _separator_len() { return 4; } static size_t _separator_len() { return 4; }
public: public:
using String = String<capacity()>;
using String::String; using String::String;
Session_label last_element() const Session_label last_element() const