Qt 4.8
|
Bridges a QPatternist::SequenceIterator to QAbstractXmlPullProvider. More...
#include <qpullbridge_p.h>
Public Functions | |
virtual QVariant | atomicValue () const |
virtual QHash< QXmlName, QXmlItem > | attributeItems () |
virtual QHash< QXmlName, QString > | attributes () |
If the current() is Element, the attributes of the element are returned, an empty list of attributes otherwise. More... | |
virtual Event | current () const |
Returns the event that next() returned the last time it was called. More... | |
QXmlNodeModelIndex | index () const |
virtual QXmlName | name () const |
If the current event is StartElement, EndElement, ProcessingInstruction, Attribute, or Namespace, the node's name is returned. More... | |
virtual Event | next () |
Advances this AbstractXmlPullProvider, and returns the new event. More... | |
PullBridge (const QXmlNodeModelIndex::Iterator::Ptr &it) | |
QSourceLocation | sourceLocation () const |
virtual QString | stringValue () const |
If current() is Text, the text node's value is returned. More... | |
Public Functions inherited from QPatternist::AbstractXmlPullProvider | |
AbstractXmlPullProvider () | |
Constucts a AbstractXmlPullProvider instance. More... | |
virtual | ~AbstractXmlPullProvider () |
Destructs this AbstractXmlPullProvider. More... | |
Private Types | |
typedef QStack< QPair< Event, QXmlNodeModelIndex::Iterator::Ptr > > | IteratorStack |
Properties | |
Event | m_current |
QXmlNodeModelIndex | m_index |
IteratorStack | m_iterators |
Additional Inherited Members | |
Public Types inherited from QPatternist::AbstractXmlPullProvider | |
enum | Event { StartOfInput = 1, AtomicValue = 1 << 1, StartDocument = 1 << 2, EndDocument = 1 << 3, StartElement = 1 << 4, EndElement = 1 << 5, Text = 1 << 6, ProcessingInstruction = 1 << 7, Comment = 1 << 8, Attribute = 1 << 9, Namespace = 1 << 10, EndOfInput = 1 << 11 } |
Bridges a QPatternist::SequenceIterator to QAbstractXmlPullProvider.
The approach of this class is rather straight forward since QPatternist::SequenceIterator and QAbstractXmlPullProvider are conceptually similar. While QPatternist::SequenceIterator only delivers top level items(since it's not an event stream, it's a list of items), PullBridge needs to recursively iterate the children of nodes too, which is achieved through the stack m_iterators.
Definition at line 68 of file qpullbridge_p.h.
|
private |
Definition at line 92 of file qpullbridge_p.h.
|
inline |
Definition at line 71 of file qpullbridge_p.h.
|
virtual |
Returns always an empty QVariant.
Implements QPatternist::AbstractXmlPullProvider.
Definition at line 188 of file qpullbridge.cpp.
Referenced by PullBridge().
Implements QPatternist::AbstractXmlPullProvider.
Definition at line 216 of file qpullbridge.cpp.
Referenced by PullBridge(), and QPatternist::XsdInstanceReader::readNext().
If the current() is Element, the attributes of the element are returned, an empty list of attributes otherwise.
Implements QPatternist::AbstractXmlPullProvider.
Definition at line 198 of file qpullbridge.cpp.
Referenced by attributeItems(), PullBridge(), and QPatternist::XsdInstanceReader::readNext().
|
virtual |
Returns the event that next() returned the last time it was called.
It doesn't alter this AbstractXmlPullProvider.
current() may not modify this AbstractXmlPullProvider's state. Subsequent calls to current() must return the same value.
Implements QPatternist::AbstractXmlPullProvider.
Definition at line 168 of file qpullbridge.cpp.
Referenced by QPatternist::XsdInstanceReader::atEnd(), QPatternist::XsdInstanceReader::isEndElement(), QPatternist::XsdInstanceReader::isStartElement(), PullBridge(), and QPatternist::XsdInstanceReader::readNext().
QXmlNodeModelIndex PullBridge::index | ( | ) | const |
Definition at line 173 of file qpullbridge.cpp.
Referenced by attributeItems(), attributes(), QPatternist::XsdInstanceReader::hasChildElement(), QPatternist::XsdInstanceReader::hasChildText(), PullBridge(), QPatternist::XsdInstanceReader::readNext(), and QPatternist::XsdInstanceReader::text().
|
virtual |
If the current event is StartElement, EndElement, ProcessingInstruction, Attribute, or Namespace, the node's name is returned.
If the current event is ProcessingInstruction, the processing instruction target is in in the local name.
If the current event is Namespace, the name's namespace URI is the namespace, and the local name is the prefix the name is binding to.
In all other cases, an invalid QName is returned.
Implements QPatternist::AbstractXmlPullProvider.
Definition at line 183 of file qpullbridge.cpp.
Referenced by QPatternist::XsdInstanceReader::name(), and PullBridge().
|
virtual |
Advances this AbstractXmlPullProvider, and returns the new event.
Implements QPatternist::AbstractXmlPullProvider.
Definition at line 73 of file qpullbridge.cpp.
Referenced by PullBridge(), and QPatternist::XsdInstanceReader::readNext().
QSourceLocation PullBridge::sourceLocation | ( | ) | const |
Definition at line 178 of file qpullbridge.cpp.
Referenced by PullBridge(), and QPatternist::XsdInstanceReader::readNext().
|
virtual |
If current() is Text, the text node's value is returned.
If the current() event is Comment, its value is returned. The subclasser guarantees it does not contain the string "-->".
If the current() event is ProcessingInstruction, its data is returned. The subclasser guarantees the data does not contain the string "?>".
In other cases, it returns a default constructed string.
Implements QPatternist::AbstractXmlPullProvider.
Definition at line 193 of file qpullbridge.cpp.
Referenced by PullBridge().
|
private |
Definition at line 95 of file qpullbridge_p.h.
Referenced by attributeItems(), attributes(), current(), and next().
|
private |
Definition at line 94 of file qpullbridge_p.h.
Referenced by attributeItems(), attributes(), index(), name(), next(), and sourceLocation().
|
private |
Definition at line 93 of file qpullbridge_p.h.
Referenced by next(), and PullBridge().