mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 13:47:56 +00:00
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:
parent
14357b0b44
commit
fc90c5f8f0
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user