#include <Reader.h>
Inheritance diagram for zypp::xml::Reader:

Public Types | |
| typedef function< bool(Reader &)> | ProcessNode |
Public Member Functions | |
| Reader (const InputStream &stream_r, const Validate &validate_r=Validate::none()) | |
| Ctor. | |
| ~Reader () | |
| Dtor. | |
| bool | nextNode () |
| bool | nextNodeAttribute () |
| bool | nextNodeOrAttribute () |
| bool | atEnd () const |
| const Node & | operator * () const |
| const Node *const | operator-> () const |
| bool | foreachNode (ProcessNode fnc_r) |
| bool | foreachNodeAttribute (ProcessNode fnc_r) |
| bool | foreachNodeOrAttribute (ProcessNode fnc_r) |
| bool | seekToNode (int depth_r, const std::string &name_r) |
| bool | seekToEndNode (int depth_r, const std::string &name_r) |
Private Member Functions | |
| void | close () |
Private Attributes | |
| InputStream | _stream |
| xmlTextReaderPtr | _reader |
| Node | _node |
// Consume a node. bool consumeNode( XML::Reader & reader_r ) { DBG << *reader_r << endl; return true; } // Consume all nodes (omitting attributes) void example() { try { XML::Reader reader( "/Local/repodata/repomd.xml" ); reader.foreachNode( consumeNode ); } catch ( const Exception & ) { ; } // parse error }
// Consume a node. bool consumeNodeAndAttribute( XML::Reader & reader_r ) { consumeNode( reader_r ); return reader_r.foreachNodeAttribute( consumeNode ); } // Consume all nodes and thair attributes. void example() { Pathname repodata( "/Local/repodata/repomd.xml" ); try { XML::Reader reader( "/Local/repodata/repomd.xml" ); reader.foreachNode( consumeNodeAndAttribute ); // or: // reader.foreachNodeOrAttribute( consumeNode ) } catch ( const Exception & ) { ; } // parse error }
Definition at line 95 of file Reader.h.
| typedef function<bool( Reader & )> zypp::xml::Reader::ProcessNode |
| zypp::xml::Reader::Reader | ( | const InputStream & | stream_r, | |
| const Validate & | validate_r = Validate::none() | |||
| ) |
Ctor.
Setup xmlTextReader and advance to the 1st Node.
Definition at line 86 of file Reader.cc.
References _reader, nextNode(), zypp::InputStream::stream(), zypp::xml::structuredErrorFunc(), and ZYPP_THROW.
| bool zypp::xml::Reader::nextNode | ( | ) |
Definition at line 121 of file Reader.cc.
References _reader, and ZYPP_THROW.
Referenced by foreachNode(), nextNodeOrAttribute(), Reader(), seekToEndNode(), seekToNode(), and zypp::xml::ParseDef::Impl::take().
| bool zypp::xml::Reader::nextNodeAttribute | ( | ) |
Definition at line 141 of file Reader.cc.
References _reader, and ZYPP_THROW.
Referenced by foreachNodeAttribute(), and nextNodeOrAttribute().
| bool zypp::xml::Reader::nextNodeOrAttribute | ( | ) | [inline] |
Definition at line 113 of file Reader.h.
References nextNode(), and nextNodeAttribute().
Referenced by foreachNodeOrAttribute().
| bool zypp::xml::Reader::atEnd | ( | ) | const [inline] |
Definition at line 117 of file Reader.h.
References _node, and zypp::xml::Node::readState().
Referenced by foreachNode(), foreachNodeOrAttribute(), seekToEndNode(), and seekToNode().
| const Node& zypp::xml::Reader::operator * | ( | ) | const [inline] |
| const Node* const zypp::xml::Reader::operator-> | ( | ) | const [inline] |
| bool zypp::xml::Reader::foreachNode | ( | ProcessNode | fnc_r | ) | [inline] |
Definition at line 133 of file Reader.h.
References _node, atEnd(), zypp::xml::Node::isAttribute(), and nextNode().
| bool zypp::xml::Reader::foreachNodeAttribute | ( | ProcessNode | fnc_r | ) | [inline] |
Definition at line 146 of file Reader.h.
References _node, zypp::xml::Node::isAttribute(), and nextNodeAttribute().
| bool zypp::xml::Reader::foreachNodeOrAttribute | ( | ProcessNode | fnc_r | ) | [inline] |
| bool zypp::xml::Reader::seekToNode | ( | int | depth_r, | |
| const std::string & | name_r | |||
| ) |
Definition at line 173 of file Reader.cc.
References _node, atEnd(), zypp::xml::Node::depth(), zypp::xml::Node::name(), nextNode(), and zypp::xml::Node::nodeType().
| bool zypp::xml::Reader::seekToEndNode | ( | int | depth_r, | |
| const std::string & | name_r | |||
| ) |
Definition at line 193 of file Reader.cc.
References _node, atEnd(), zypp::xml::Node::depth(), zypp::xml::Node::isEmptyElement(), zypp::xml::Node::name(), nextNode(), and zypp::xml::Node::nodeType().
Referenced by zypp::xml::ParseDef::Impl::skipNode().
| void zypp::xml::Reader::close | ( | ) | [private] |
InputStream zypp::xml::Reader::_stream [private] |
xmlTextReaderPtr zypp::xml::Reader::_reader [private] |
Definition at line 181 of file Reader.h.
Referenced by close(), nextNode(), nextNodeAttribute(), Reader(), and ~Reader().
Node zypp::xml::Reader::_node [private] |
Definition at line 182 of file Reader.h.
Referenced by atEnd(), foreachNode(), foreachNodeAttribute(), operator *(), operator->(), seekToEndNode(), and seekToNode().
1.5.0