zypp::parser::xmlstore::XMLPatternParser Class Reference

#include <XMLPatternParser.h>

Inheritance diagram for zypp::parser::xmlstore::XMLPatternParser:
[legend]

List of all members.

Public Member Functions

 XMLPatternParser (std::istream &is, const std::string &baseUrl)
 XMLPatternParser ()
 XMLPatternParser (XMLPatternData_Ptr &entry)
virtual ~XMLPatternParser ()

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
XMLPatternData_Ptr 
process (const xmlTextReaderPtr reader)
 process an xml node The derived class has to produce the ENTRYTYPE object here.

Private Attributes

LibXMLHelper _helper


Detailed Description

Definition at line 28 of file XMLPatternParser.h.


Constructor & Destructor Documentation

zypp::parser::xmlstore::XMLPatternParser::XMLPatternParser ( std::istream &  is,
const std::string &  baseUrl 
)

Definition at line 88 of file XMLPatternParser.cc.

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

zypp::parser::xmlstore::XMLPatternParser::XMLPatternParser (  ) 

Definition at line 30 of file XMLPatternParser.cc.

zypp::parser::xmlstore::XMLPatternParser::XMLPatternParser ( XMLPatternData_Ptr &  entry  ) 

Definition at line 33 of file XMLPatternParser.cc.

zypp::parser::xmlstore::XMLPatternParser::~XMLPatternParser (  )  [virtual]

Definition at line 38 of file XMLPatternParser.cc.


Member Function Documentation

bool zypp::parser::xmlstore::XMLPatternParser::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.

Parameters:
nodePtr points to the xml node in question. Only the node is available, not the subtree. See libxml2 documentation.
Returns:
true if interested

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

Definition at line 44 of file XMLPatternParser.cc.

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

XMLPatternData_Ptr zypp::parser::xmlstore::XMLPatternParser::process ( const xmlTextReaderPtr  readerPtr  )  [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().

Parameters:
readerPtr points to the xmlTextReader that reads the xml stream.
Returns:

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

Definition at line 51 of file XMLPatternParser.cc.

References _helper, zypp::parser::LibXMLHelper::content(), zypp::parser::LibXMLHelper::isElement(), zypp::parser::LibXMLHelper::name(), name, zypp::parser::xmlstore::XMLResObjectParser::parseDependencies(), zypp::parser::xmlstore::XMLResObjectParser::parseResObjectCommonData(), and xml_assert.


Member Data Documentation

LibXMLHelper zypp::parser::xmlstore::XMLPatternParser::_helper [private]

Reimplemented from zypp::parser::xmlstore::XMLResObjectParser.

Definition at line 40 of file XMLPatternParser.h.

Referenced by isInterested(), and process().


The documentation for this class was generated from the following files:
Generated on Tue Sep 25 19:23:23 2007 for libzypp by  doxygen 1.5.3