zypp::parser::yum::YUMFileListParser Class Reference

Parser for YUM filelists files Use this class as an iterator that produces, one after one, YUMFileListData_Ptr(s) for the XML package elements. More...

#include <YUMFileListParser.h>

Inheritance diagram for zypp::parser::yum::YUMFileListParser:

zypp::parser::XMLNodeIterator< YUMFileListData_Ptr > zypp::parser::XMLNodeIteratorBase iterator List of all members.

Public Member Functions

 YUMFileListParser (std::istream &is, const std::string &baseUrl)
 Constructor.
 YUMFileListParser ()
 YUMFileListParser (YUMFileListData_Ptr &entry)
virtual ~YUMFileListParser ()
 Destructor.

Private Member Functions

virtual bool isInterested (const xmlNodePtr nodePtr)
 decides if the parser is interested in the node (and subtree) of an element.
virtual YUMFileListData_Ptr process (const xmlTextReaderPtr reader)
 creates a new object from the xml subtree

Private Attributes

LibXMLHelper _helper
 converts the xml stuff to c++ stuff and filters the right namespaces
Arch _zypp_architecture

Detailed Description

Parser for YUM filelists files Use this class as an iterator that produces, one after one, YUMFileListData_Ptr(s) for the XML package elements.

Here's an example:

for (YUMFileListParser 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 48 of file YUMFileListParser.h.


Constructor & Destructor Documentation

zypp::parser::yum::YUMFileListParser::YUMFileListParser std::istream &  is,
const std::string &  baseUrl
 

Constructor.

Parameters:
is the istream to read from
baseUrl the base URL of the XML document. Can be left empty.

zypp::parser::yum::YUMFileListParser::YUMFileListParser  ) 
 

Definition at line 42 of file YUMFileListParser.cc.

zypp::parser::yum::YUMFileListParser::YUMFileListParser YUMFileListData_Ptr &  entry  ) 
 

Definition at line 46 of file YUMFileListParser.cc.

zypp::parser::yum::YUMFileListParser::~YUMFileListParser  )  [virtual]
 

Destructor.

Definition at line 53 of file YUMFileListParser.cc.


Member Function Documentation

bool zypp::parser::yum::YUMFileListParser::isInterested const xmlNodePtr  nodePtr  )  [private, virtual]
 

decides if the parser is interested in the node (and subtree) of an element.

Parameters:
nodePtr the XML node
Returns:
true if the parser is interested.

Implements zypp::parser::XMLNodeIterator< YUMFileListData_Ptr >.

Definition at line 62 of file YUMFileListParser.cc.

References _helper, zypp::parser::LibXMLHelper::isElement(), and zypp::parser::LibXMLHelper::name().

YUMFileListData_Ptr zypp::parser::yum::YUMFileListParser::process const xmlTextReaderPtr  reader  )  [private, virtual]
 

creates a new object from the xml subtree

Parameters:
reader 
Returns:

Implements zypp::parser::XMLNodeIterator< YUMFileListData_Ptr >.

Definition at line 72 of file YUMFileListParser.cc.

References _helper, _zypp_architecture, zypp::parser::LibXMLHelper::attribute(), and xml_assert.


Member Data Documentation

LibXMLHelper zypp::parser::yum::YUMFileListParser::_helper [private]
 

converts the xml stuff to c++ stuff and filters the right namespaces

Definition at line 84 of file YUMFileListParser.h.

Referenced by isInterested(), and process().

Arch zypp::parser::yum::YUMFileListParser::_zypp_architecture [private]
 

Definition at line 85 of file YUMFileListParser.h.

Referenced by process().


The documentation for this class was generated from the following files:
Generated on Thu Jul 6 00:07:33 2006 for zypp by  doxygen 1.4.6