#include <YUMGroupParser.h>
Inheritance diagram for zypp::parser::yum::YUMGroupParser:

Public Member Functions | |
| YUMGroupParser (std::istream &is, const std::string &baseUrl, parser::ParserProgress::Ptr progress=parser::ParserProgress::Ptr()) | |
| YUMGroupParser () | |
| YUMGroupParser (YUMGroupData_Ptr &entry) | |
| virtual | ~YUMGroupParser () |
Private Member Functions | |
| virtual bool | isInterested (const xmlNodePtr nodePtr) |
| filter for the xml nodes The derived class decides which xml nodes it is actually interested in. | |
| virtual YUMGroupData_Ptr | process (const xmlTextReaderPtr reader) |
| process an xml node The derived class has to produce the ENTRYTYPE object here. | |
| void | parseGrouplist (YUMGroupData_Ptr dataPtr, xmlNodePtr node) |
| void | parsePackageList (YUMGroupData_Ptr dataPtr, xmlNodePtr node) |
Private Attributes | |
| LibXMLHelper | _helper |
Use this class as an iterator that produces, one after one, YUMGroupData_Ptr(s) for the XML group elements. Here's an example:
for (YUMGroupParser iter(anIstream, baseUrl), iter != YUMFileListParser.end(), // or: iter() != 0, or ! iter.atEnd() ++iter) { doSomething(*iter) }
The iterator owns the pointer (i.e., caller must not delete it) until the next ++ operator is called. At this time, it will be destroyed (and a new ENTRYTYPE is created.)
If the input is fundamentally flawed so that it makes no sense to continue parsing, XMLNodeIterator will log it and consider the input as finished. You can query the exit status with errorStatus().
Definition at line 52 of file YUMGroupParser.h.
| zypp::parser::yum::YUMGroupParser::YUMGroupParser | ( | std::istream & | is, | |
| const std::string & | baseUrl, | |||
| parser::ParserProgress::Ptr | progress = parser::ParserProgress::Ptr() | |||
| ) |
Definition at line 167 of file YUMGroupParser.cc.
References zypp::parser::XMLNodeIteratorBase::fetchNext().
| zypp::parser::yum::YUMGroupParser::YUMGroupParser | ( | ) |
Definition at line 31 of file YUMGroupParser.cc.
| zypp::parser::yum::YUMGroupParser::YUMGroupParser | ( | YUMGroupData_Ptr & | entry | ) |
Definition at line 34 of file YUMGroupParser.cc.
| zypp::parser::yum::YUMGroupParser::~YUMGroupParser | ( | ) | [virtual] |
Definition at line 39 of file YUMGroupParser.cc.
| bool zypp::parser::yum::YUMGroupParser::isInterested | ( | const xmlNodePtr | nodePtr | ) | [private, virtual] |
filter for the xml nodes The derived class decides which xml nodes it is actually interested in.
For each that is selected, process() will be called an the resulting ENTRYTYPE object used as the next value for the iterator. Documentation for the node structure can be found in the libxml2 documentation. Have a look at LibXMLHelper to access node attributes and contents.
| nodePtr | points to the xml node in question. Only the node is available, not the subtree. See libxml2 documentation. |
Implements zypp::parser::XMLNodeIterator< YUMGroupData_Ptr >.
Definition at line 45 of file YUMGroupParser.cc.
References _helper, zypp::parser::LibXMLHelper::isElement(), and zypp::parser::LibXMLHelper::name().
| YUMGroupData_Ptr zypp::parser::yum::YUMGroupParser::process | ( | const xmlTextReaderPtr | reader | ) | [private, virtual] |
process an xml node The derived class has to produce the ENTRYTYPE object here.
Details about the xml reader is in the libxml2 documentation. You'll most probably want to use xmlTextReaderExpand(reader) to request the full subtree, and then use the links in the resulting node structure to traverse, and class LibXMLHelper to access the attributes and element contents. fetchNext() cannot throw an error since it will be called in the constructor. Instead, in case of a fundamental syntax error the error is saved and will be thrown with the next checkError().
| readerPtr | points to the xmlTextReader that reads the xml stream. |
Implements zypp::parser::XMLNodeIterator< YUMGroupData_Ptr >.
Definition at line 52 of file YUMGroupParser.cc.
References _helper, zypp::parser::LibXMLHelper::attribute(), zypp::parser::LibXMLHelper::content(), ERR, zypp::parser::LibXMLHelper::isElement(), zypp::parser::LibXMLHelper::name(), name, parseGrouplist(), parsePackageList(), zypp::parser::LibXMLHelper::positionInfo(), WAR, and xml_assert.
| void zypp::parser::yum::YUMGroupParser::parseGrouplist | ( | YUMGroupData_Ptr | dataPtr, | |
| xmlNodePtr | node | |||
| ) | [private] |
Definition at line 105 of file YUMGroupParser.cc.
References _helper, zypp::parser::LibXMLHelper::attribute(), zypp::parser::LibXMLHelper::content(), zypp::parser::LibXMLHelper::isElement(), zypp::parser::LibXMLHelper::name(), name, zypp::parser::LibXMLHelper::positionInfo(), WAR, and xml_assert.
Referenced by process().
| void zypp::parser::yum::YUMGroupParser::parsePackageList | ( | YUMGroupData_Ptr | dataPtr, | |
| xmlNodePtr | node | |||
| ) | [private] |
Definition at line 134 of file YUMGroupParser.cc.
References _helper, zypp::parser::LibXMLHelper::attribute(), zypp::parser::LibXMLHelper::content(), zypp::parser::LibXMLHelper::isElement(), zypp::parser::LibXMLHelper::name(), name, zypp::parser::LibXMLHelper::positionInfo(), WAR, and xml_assert.
Referenced by process().
Definition at line 68 of file YUMGroupParser.h.
Referenced by isInterested(), parseGrouplist(), parsePackageList(), and process().
1.5.0