#include <YUMPrimaryParser.h>
Inheritance diagram for zypp::parser::yum::YUMPrimaryParser:
Public Member Functions | |
YUMPrimaryParser (std::istream &is, const std::string &baseUrl) | |
YUMPrimaryParser () | |
YUMPrimaryParser (YUMPrimaryData_Ptr &entry) | |
virtual | ~YUMPrimaryParser () |
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 YUMPrimaryData_Ptr | process (const xmlTextReaderPtr reader) |
process an xml node The derived class has to produce the ENTRYTYPE object here. | |
void | parseFormatNode (YUMPrimaryData_Ptr dataPtr, xmlNodePtr formatNode) |
void | parseDependencyEntries (std::list< YUMDependency > *depList, xmlNodePtr depNode) |
void | parseAuthorEntries (std::list< std::string > *authors, xmlNodePtr node) |
void | parseKeywordEntries (std::list< std::string > *keywords, xmlNodePtr node) |
void | parseDirsizeEntries (std::list< YUMDirSize > *sizes, xmlNodePtr node) |
Private Attributes | |
LibXMLHelper | _helper |
Arch | _zypp_architecture |
Friends | |
class | YUMPatchParser |
class | YUMProductParser |
class | YUMPatternParser |
Here's an example:
for (YUMPrimaryParser iter(anIstream, baseUrl), iter != YUMOtherParser.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 48 of file YUMPrimaryParser.h.
|
|
|
Definition at line 41 of file YUMPrimaryParser.cc. |
|
Definition at line 45 of file YUMPrimaryParser.cc. |
|
Definition at line 51 of file YUMPrimaryParser.cc. |
|
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.
Implements zypp::parser::XMLNodeIterator< YUMPrimaryData_Ptr >. Definition at line 60 of file YUMPrimaryParser.cc. References _helper, zypp::parser::LibXMLHelper::isElement(), and zypp::parser::LibXMLHelper::name(). |
|
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().
Implements zypp::parser::XMLNodeIterator< YUMPrimaryData_Ptr >. Definition at line 70 of file YUMPrimaryParser.cc. References _helper, _zypp_architecture, zypp::parser::LibXMLHelper::attribute(), zypp::parser::LibXMLHelper::content(), DBG, zypp::parser::LibXMLHelper::isElement(), zypp::parser::LibXMLHelper::name(), name, parseFormatNode(), zypp::parser::LibXMLHelper::positionInfo(), WAR, xml_assert, and ZYPP_CAUGHT. |
|
Definition at line 158 of file YUMPrimaryParser.cc. References _helper, zypp::parser::LibXMLHelper::attribute(), zypp::parser::LibXMLHelper::content(), zypp::parser::LibXMLHelper::isElement(), zypp::parser::LibXMLHelper::name(), name, parseAuthorEntries(), parseDependencyEntries(), parseDirsizeEntries(), parseKeywordEntries(), zypp::parser::LibXMLHelper::positionInfo(), WAR, and xml_assert. Referenced by process(). |
|
|
Referenced by parseFormatNode(), and zypp::parser::yum::YUMPatchParser::parseFormatNode(). |
|
Referenced by parseFormatNode(), and zypp::parser::yum::YUMPatchParser::parseFormatNode(). |
|
Referenced by parseFormatNode(), and zypp::parser::yum::YUMPatchParser::parseFormatNode(). |
|
Definition at line 58 of file YUMPrimaryParser.h. |
|
Definition at line 59 of file YUMPrimaryParser.h. |
|
Definition at line 60 of file YUMPrimaryParser.h. |
|
Definition at line 74 of file YUMPrimaryParser.h. Referenced by isInterested(), parseFormatNode(), and process(). |
|
Definition at line 75 of file YUMPrimaryParser.h. Referenced by process(). |