#include <XMLNodeIterator.h>

Public Member Functions | |
| XMLNodeIterator (std::istream &input, const std::string &baseUrl, const char *validationPath=0) | |
| XMLNodeIterator (ENTRYTYPE &entry) | |
| XMLNodeIterator () | |
| virtual | ~XMLNodeIterator () |
| ENTRYTYPE & | operator * () const |
| ENTRYTYPE * | operator() () const |
| XMLNodeIterator < ENTRYTYPE > & | operator++ () |
| XMLNodeIterator | operator++ (int) |
| const ENTRYTYPE * | operator-> () |
Protected Member Functions | |
| virtual bool | isInterested (const xmlNodePtr nodePtr)=0 |
| virtual ENTRYTYPE | process (const xmlTextReaderPtr readerPtr)=0 |
| void | _process (const xmlTextReaderPtr readerPtr) |
Private Member Functions | |
| void | setCurrent (const void *data) |
| void * | getCurrent () const |
Private Attributes | |
| std::auto_ptr < ENTRYTYPE > | _current |
| XMLNodeIterator< ENTRYTYPE >::XMLNodeIterator | ( | std::istream & | input, | |
| const std::string & | baseUrl, | |||
| const char * | validationPath = 0 | |||
| ) | [inline] |
Constructor. Derived classes must call fetchNext() here.
| input | is the input stream (contains the xml stuff) | |
| baseUrl | is the base URL of the xml document FIXME: use XMLParserError::operator<< instead of doing it on my own. |
| XMLNodeIterator< ENTRYTYPE >::XMLNodeIterator | ( | ENTRYTYPE & | entry | ) | [inline] |
Constructor for a trivial iterator. A trivial iterator contains only one element. This is at least needed internally for the postinc (iter++) operator
| entry | is the one and only element of this iterator. |
| XMLNodeIterator< ENTRYTYPE >::XMLNodeIterator | ( | ) | [inline] |
Constructor for an empty iterator. An empty iterator is already at its end. This is what end() returns ...
| virtual XMLNodeIterator< ENTRYTYPE >::~XMLNodeIterator | ( | ) | [inline, virtual] |
Destructor
| ENTRYTYPE& XMLNodeIterator< ENTRYTYPE >::operator * | ( | ) | const [inline] |
Fetch a pointer to the current element
| ENTRYTYPE* XMLNodeIterator< ENTRYTYPE >::operator() | ( | ) | const [inline] |
Fetch the current element
| XMLNodeIterator<ENTRYTYPE>& XMLNodeIterator< ENTRYTYPE >::operator++ | ( | ) | [inline] |
Go to the next element and return it
| XMLNodeIterator XMLNodeIterator< ENTRYTYPE >::operator++ | ( | int | ) | [inline] |
remember the current element, go to next and return remembered one. avoid this, usually you need the preinc operator (++iter) This function may throw ParserError if something is fundamentally wrong with the input.
| const ENTRYTYPE* XMLNodeIterator< ENTRYTYPE >::operator-> | ( | ) | [inline] |
similar to operator*, allows direct member access
| virtual bool XMLNodeIterator< ENTRYTYPE >::isInterested | ( | const xmlNodePtr | nodePtr | ) | [protected, pure 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 XMLNodeIteratorBase.
| virtual ENTRYTYPE XMLNodeIterator< ENTRYTYPE >::process | ( | const xmlTextReaderPtr | readerPtr | ) | [protected, pure 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. |
| void XMLNodeIterator< ENTRYTYPE >::_process | ( | const xmlTextReaderPtr | readerPtr | ) | [inline, protected, virtual] |
process an xml node and set it as next element 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 XMLNodeIteratorBase.
| void XMLNodeIterator< ENTRYTYPE >::setCurrent | ( | const void * | data | ) | [inline, private, virtual] |
Implements XMLNodeIteratorBase.
| void* XMLNodeIterator< ENTRYTYPE >::getCurrent | ( | ) | const [inline, private, virtual] |
Implements XMLNodeIteratorBase.
std::auto_ptr<ENTRYTYPE> XMLNodeIterator< ENTRYTYPE >::_current [private] |
contains the current element of the iterator. a pointer is used to be able to handle non-assigneable ENTRYTYPEs. The iterator owns the element until the next ++ operation. It can be 0 when the end has been reached.
1.5.3