Qt 4.8
|
The QSimpleXmlNodeModel class is an implementation of QAbstractXmlNodeModel sufficient for many common cases. More...
#include <qsimplexmlnodemodel.h>
Public Functions | |
virtual QUrl | baseUri (const QXmlNodeModelIndex &node) const |
Returns the base URI for node. More... | |
virtual QXmlNodeModelIndex | elementById (const QXmlName &id) const |
Always returns a default constructed QXmlNodeModelIndex instance, regardless of id. More... | |
QXmlNamePool & | namePool () const |
Returns the name pool associated with this model. More... | |
virtual QVector< QXmlName > | namespaceBindings (const QXmlNodeModelIndex &) const |
Always returns an empty QVector. More... | |
virtual QVector< QXmlNodeModelIndex > | nodesByIdref (const QXmlName &idref) const |
Always returns an empty vector, regardless of idref. More... | |
QSimpleXmlNodeModel (const QXmlNamePool &namePool) | |
Constructs a QSimpleXmlNodeModel for use with with the specified namePool. More... | |
virtual QString | stringValue (const QXmlNodeModelIndex &node) const |
If node is an element or attribute, typedValue() is called, and the return value converted to a string, as per XQuery's rules. More... | |
virtual | ~QSimpleXmlNodeModel () |
Destructor. More... | |
Public Functions inherited from QAbstractXmlNodeModel | |
virtual QXmlNodeModelIndex::DocumentOrder | compareOrder (const QXmlNodeModelIndex &ni1, const QXmlNodeModelIndex &ni2) const =0 |
This function returns the relative document order for the nodes indexed by ni1 and ni2. More... | |
virtual void | copyNodeTo (const QXmlNodeModelIndex &node, QAbstractXmlReceiver *const receiver, const NodeCopySettings &) const |
virtual QUrl | documentUri (const QXmlNodeModelIndex &ni) const =0 |
Returns the document URI of n. More... | |
virtual bool | isDeepEqual (const QXmlNodeModelIndex &ni1, const QXmlNodeModelIndex &ni2) const |
Determines whether ni1 is deep equal to ni2. More... | |
virtual QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< QXmlNodeModelIndex > > | iterate (const QXmlNodeModelIndex &ni, QXmlNodeModelIndex::Axis axis) const |
Performs navigation, starting from ni, by returning an QAbstractXmlForwardIterator that returns nodes the axis emanating from ni. More... | |
virtual QXmlNodeModelIndex::NodeKind | kind (const QXmlNodeModelIndex &ni) const =0 |
Returns a value indicating the kind of node identified by ni. More... | |
virtual QXmlName | name (const QXmlNodeModelIndex &ni) const =0 |
Returns the name of ni. More... | |
virtual QXmlName::NamespaceCode | namespaceForPrefix (const QXmlNodeModelIndex &ni, const QXmlName::PrefixCode prefix) const |
Returns the namespace URI on ni that corresponds to prefix. More... | |
QAbstractXmlNodeModel () | |
Default constructor. More... | |
virtual QXmlNodeModelIndex | root (const QXmlNodeModelIndex &n) const =0 |
Returns the root node of the tree that contains the node whose index is n. More... | |
virtual void | sendNamespaces (const QXmlNodeModelIndex &n, QAbstractXmlReceiver *const receiver) const |
Sends the namespaces declared on n to receiver. More... | |
virtual QPatternist::ItemIteratorPtr | sequencedTypedValue (const QXmlNodeModelIndex &ni) const |
QSourceLocation | sourceLocation (const QXmlNodeModelIndex &index) const |
Returns the source location for the object with the given index or a default constructed QSourceLocation in case no location information is available. More... | |
virtual QPatternist::ItemTypePtr | type (const QXmlNodeModelIndex &ni) const |
virtual QVariant | typedValue (const QXmlNodeModelIndex &n) const =0 |
Returns the typed value for node node. More... | |
virtual | ~QAbstractXmlNodeModel () |
Destructor. More... | |
Public Functions inherited from QSharedData | |
QSharedData () | |
Constructs a QSharedData object with a reference count of 0. More... | |
QSharedData (const QSharedData &) | |
Constructs a QSharedData object with reference count 0. More... | |
Additional Inherited Members | |
Public Types inherited from QAbstractXmlNodeModel | |
typedef QList< Ptr > | List |
A list of smart pointers to instances of QAbstractXmlNodeModel. More... | |
enum | NodeCopySetting { InheritNamespaces = 0x1, PreserveNamespaces = 0x2 } |
typedef QFlags< NodeCopySetting > | NodeCopySettings |
typedef QExplicitlySharedDataPointer< QAbstractXmlNodeModel > | Ptr |
A QExplicitlySharedDataPointer {smart pointer} to an instance of QAbstractXmlNodeModel. More... | |
enum | SimpleAxis { Parent, FirstChild, PreviousSibling, NextSibling } |
Four axes that each contain one node only. More... | |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Protected Functions inherited from QAbstractXmlNodeModel | |
virtual QVector< QXmlNodeModelIndex > | attributes (const QXmlNodeModelIndex &element) const =0 |
Returns the attributes of element. More... | |
QXmlNodeModelIndex | createIndex (qint64 data) const |
Creates a node index with data as its internal data. More... | |
QXmlNodeModelIndex | createIndex (void *pointer, qint64 additionalData=0) const |
Creates a node index with pointer and additionalData as its internal data. More... | |
QXmlNodeModelIndex | createIndex (qint64 data, qint64 additionalData) const |
Creates a QXmlNodeModelIndex containing data and additionalData. More... | |
virtual QXmlNodeModelIndex | nextFromSimpleAxis (SimpleAxis axis, const QXmlNodeModelIndex &origin) const =0 |
When QtXmlPatterns evaluate path expressions, it emulate them through a combination of calls with QSimpleXmlNodeModel::SimpleAxis values. More... | |
QAbstractXmlNodeModel (QAbstractXmlNodeModelPrivate *d) | |
Protected Variables inherited from QAbstractXmlNodeModel | |
QScopedPointer< QAbstractXmlNodeModelPrivate > | d_ptr |
The QSimpleXmlNodeModel class is an implementation of QAbstractXmlNodeModel sufficient for many common cases.
Subclassing QAbstractXmlNodeModel can be a significant task, because it requires implementing several, complex member functions. QSimpleXmlNodeModel provides default implementations of these member functions that are suitable for a wide range of node models.
Subclasses of QSimpleXmlNodeModel must be thread-safe.
Definition at line 56 of file qsimplexmlnodemodel.h.
QSimpleXmlNodeModel::QSimpleXmlNodeModel | ( | const QXmlNamePool & | namePool | ) |
Constructs a QSimpleXmlNodeModel for use with with the specified namePool.
Definition at line 89 of file qsimplexmlnodemodel.cpp.
|
virtual |
|
virtual |
Returns the base URI for node.
This is always the document URI.
Implements QAbstractXmlNodeModel.
Definition at line 134 of file qsimplexmlnodemodel.cpp.
|
virtual |
Always returns a default constructed QXmlNodeModelIndex instance, regardless of id.
This effectively means the model has no elements that have an id.
Implements QAbstractXmlNodeModel.
Definition at line 167 of file qsimplexmlnodemodel.cpp.
QXmlNamePool & QSimpleXmlNodeModel::namePool | ( | ) | const |
Returns the name pool associated with this model.
The implementation of name() will use this name pool to create names.
Definition at line 144 of file qsimplexmlnodemodel.cpp.
|
virtual |
Always returns an empty QVector.
This signals that no namespace bindings are in scope for node.
Implements QAbstractXmlNodeModel.
Definition at line 155 of file qsimplexmlnodemodel.cpp.
|
virtual |
Always returns an empty vector, regardless of idref.
This effectively means the model has no elements or attributes of type IDREF
.
Implements QAbstractXmlNodeModel.
Definition at line 179 of file qsimplexmlnodemodel.cpp.
|
virtual |
If node is an element or attribute, typedValue() is called, and the return value converted to a string, as per XQuery's rules.
If node is another type of node, the empty string is returned.
If this function is overridden for comments or processing instructions, it is important to remember to call it (for elements and attributes having values not of type xs:string
) to ensure that the values are formatted according to XQuery.
Implements QAbstractXmlNodeModel.
Definition at line 113 of file qsimplexmlnodemodel.cpp.