zypp::parser::yum::YUMOtherParser Class Reference

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

#include <YUMOtherParser.h>

Inheritance diagram for zypp::parser::yum::YUMOtherParser:

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

Public Member Functions

 YUMOtherParser (std::istream &is, const std::string &baseUrl, parser::ParserProgress::Ptr progress=parser::ParserProgress::Ptr())
 Constructor.
 YUMOtherParser ()
 YUMOtherParser (YUMOtherData_Ptr &entry)
virtual ~YUMOtherParser ()
 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 YUMOtherData_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 other.xml files Use this class as an iterator that produces, one after one, YUMOtherData_Ptr(s) for the XML package elements.

Here's an example:

for (YUMOtherParser 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 51 of file YUMOtherParser.h.


Constructor & Destructor Documentation

zypp::parser::yum::YUMOtherParser::YUMOtherParser ( std::istream &  is,
const std::string &  baseUrl,
parser::ParserProgress::Ptr  progress = parser::ParserProgress::Ptr() 
)

Constructor.

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

Definition at line 36 of file YUMOtherParser.cc.

References zypp::parser::XMLNodeIteratorBase::fetchNext().

zypp::parser::yum::YUMOtherParser::YUMOtherParser (  ) 

Definition at line 43 of file YUMOtherParser.cc.

zypp::parser::yum::YUMOtherParser::YUMOtherParser ( YUMOtherData_Ptr &  entry  ) 

Definition at line 47 of file YUMOtherParser.cc.

zypp::parser::yum::YUMOtherParser::~YUMOtherParser (  )  [virtual]

Destructor.

Definition at line 54 of file YUMOtherParser.cc.


Member Function Documentation

bool zypp::parser::yum::YUMOtherParser::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< YUMOtherData_Ptr >.

Definition at line 62 of file YUMOtherParser.cc.

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

YUMOtherData_Ptr zypp::parser::yum::YUMOtherParser::process ( const xmlTextReaderPtr  reader  )  [private, virtual]

creates a new object from the xml subtree

Parameters:
reader 
Returns:

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

Definition at line 72 of file YUMOtherParser.cc.

References _helper, _zypp_architecture, zypp::parser::LibXMLHelper::attribute(), zypp::parser::LibXMLHelper::content(), DBG, zypp::parser::LibXMLHelper::isElement(), zypp::parser::LibXMLHelper::name(), name, zypp::parser::LibXMLHelper::positionInfo(), WAR, xml_assert, and ZYPP_CAUGHT.


Member Data Documentation

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

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

Definition at line 87 of file YUMOtherParser.h.

Referenced by isInterested(), and process().

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

Definition at line 88 of file YUMOtherParser.h.

Referenced by process().


The documentation for this class was generated from the following files:
Generated on Tue Nov 28 16:49:39 2006 for zypp by  doxygen 1.5.0