RAII writing a nodes start/end tag.
More...
#include <Xml.h>
|
| NON_COPYABLE_BUT_MOVE (Node) |
|
| Node (std::ostream &out_r, std::string name_r, const std::initializer_list< Attr > &attrs_r={}) |
| Ctor taking nodename and attribute list. More...
|
|
| Node (std::ostream &out_r, std::string name_r, Attr attr_r) |
| Convenience ctor for one attribute pair. More...
|
|
| Node (std::ostream &out_r, std::string name_r, OptionalContentType, const std::initializer_list< Attr > &attrs_r={}) |
| Optional content ctor taking nodename and attribute list. More...
|
|
| Node (std::ostream &out_r, std::string name_r, OptionalContentType, Attr attr_r) |
| Optional content Convenience ctor for one attribute pair. More...
|
|
Node & | addAttr (const std::initializer_list< Attr > &attrs_r={}) |
| Add additional attributes (requires OptionalContentType) More...
|
|
Node & | addAttr (const Attr &attr_r) |
|
std::ostream & | operator* () |
| Return the output stream. More...
|
|
|
(Note that these are not member functions.)
|
std::ostream & | node (std::ostream &out_r, const std::string &name_r, const std::initializer_list< Node::Attr > &attrs_r={}) |
|
RAII writing a nodes start/end tag.
{
Node node( std::cout,
"node", {
"attr",
"val" } );
*
node <<
"write nodes body...."
}
- Note
- If the optionalContent flag is passed to the
ctor
, the start node is kept open, until the first call to operator*. The start node is closed before returning the stream. {
}
{
*
node <<
"write nodes body...."
}
-
If the nodename is empty or starts with an
!
, a comment is written.
Definition at line 84 of file Xml.h.
Definition at line 87 of file Xml.h.
zypp::xmlout::Node::Node |
( |
std::ostream & |
out_r, |
|
|
std::string |
name_r, |
|
|
const std::initializer_list< Attr > & |
attrs_r = {} |
|
) |
| |
|
inline |
Ctor taking nodename and attribute list.
Definition at line 93 of file Xml.h.
zypp::xmlout::Node::Node |
( |
std::ostream & |
out_r, |
|
|
std::string |
name_r, |
|
|
Attr |
attr_r |
|
) |
| |
|
inline |
Convenience ctor for one attribute pair.
Definition at line 98 of file Xml.h.
zypp::xmlout::Node::Node |
( |
std::ostream & |
out_r, |
|
|
std::string |
name_r, |
|
|
OptionalContentType |
, |
|
|
const std::initializer_list< Attr > & |
attrs_r = {} |
|
) |
| |
|
inline |
Optional content ctor taking nodename and attribute list.
Definition at line 103 of file Xml.h.
Optional content Convenience ctor for one attribute pair.
Definition at line 108 of file Xml.h.
zypp::xmlout::Node::NON_COPYABLE_BUT_MOVE |
( |
Node |
| ) |
|
Node& zypp::xmlout::Node::addAttr |
( |
const std::initializer_list< Attr > & |
attrs_r = {} | ) |
|
|
inline |
Add additional attributes (requires OptionalContentType)
- Exceptions
-
HasContentException | If start node is already closed |
Definition at line 132 of file Xml.h.
Node& zypp::xmlout::Node::addAttr |
( |
const Attr & |
attr_r | ) |
|
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 141 of file Xml.h.
std::ostream& zypp::xmlout::Node::operator* |
( |
| ) |
|
|
inline |
Return the output stream.
Definition at line 146 of file Xml.h.
void zypp::xmlout::Node::printStart |
( |
const std::initializer_list< Attr > & |
attrs_r | ) |
|
|
inlineprivate |
void zypp::xmlout::Node::printAttr |
( |
const std::initializer_list< Attr > & |
attrs_r | ) |
|
|
inlineprivate |
bool zypp::xmlout::Node::isComment |
( |
| ) |
const |
|
inlineprivate |
std::ostream & node |
( |
std::ostream & |
out_r, |
|
|
const std::string & |
name_r, |
|
|
const std::initializer_list< Node::Attr > & |
attrs_r = {} |
|
) |
| |
|
related |
Write a leaf node without PCDATA
Definition at line 197 of file Xml.h.
Definition at line 90 of file Xml.h.
std::ostream& zypp::xmlout::Node::_out |
|
private |
std::string zypp::xmlout::Node::_name |
|
private |
bool zypp::xmlout::Node::_hasContent |
|
private |
The documentation for this class was generated from the following file: