mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
Xml_node: replace value(T *out) by value(T &out)
Promote the use of references instead of pointers. Issue #1987
This commit is contained in:
parent
98a75b1a78
commit
fdbf30fc4c
@ -152,7 +152,7 @@ class Genode::Xml_attribute
|
||||
* conversion failed
|
||||
*/
|
||||
template <typename T>
|
||||
bool value(T *out) const
|
||||
bool value(T &out) const
|
||||
{
|
||||
/*
|
||||
* The '_value' token starts with a quote, which we
|
||||
@ -160,9 +160,17 @@ class Genode::Xml_attribute
|
||||
* the length, we have to consider both the starting
|
||||
* and the trailing quote character.
|
||||
*/
|
||||
return ascii_to(_value.start() + 1, *out) == _value.len() - 2;
|
||||
return ascii_to(_value.start() + 1, out) == _value.len() - 2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return attribute value as typed value
|
||||
*
|
||||
* \deprecated use 'value(T &out)' instead
|
||||
*/
|
||||
template <typename T>
|
||||
bool value(T *out) const { return value(*out); }
|
||||
|
||||
/**
|
||||
* Return attribute value as Genode::String
|
||||
*/
|
||||
@ -625,8 +633,15 @@ class Genode::Xml_node
|
||||
* \return true on success
|
||||
*/
|
||||
template <typename T>
|
||||
bool value(T *out) const {
|
||||
return ascii_to(content_addr(), *out) == content_size(); }
|
||||
bool value(T &out) const {
|
||||
return ascii_to(content_addr(), out) == content_size(); }
|
||||
|
||||
/**
|
||||
* Read content as typed value from XML node
|
||||
*
|
||||
* \deprecated use 'value(T &out)' instead
|
||||
*/
|
||||
template <typename T> bool value(T *out) const { return value(*out); }
|
||||
|
||||
/**
|
||||
* Return begin of node including the start tag
|
||||
|
Loading…
x
Reference in New Issue
Block a user