81 , m_documentURI(docURI)
100 pDebug() <<
"+---------------+-------+-------+---------------+-------+--------------+-------+";
101 pDebug() <<
"| Pre number | Depth | Size | Post Number | Kind | Name | Value |";
102 pDebug() <<
"+---------------+-------+-------+---------------+-------+--------------+-------+";
103 for(
int i = 0; i < len; ++i)
107 <<
"\t\t|" << v.
depth()
124 pDebug() <<
"+---------------+-------+-------+---------------+-------+--------------+";
127 QHashIterator<PreNumber, QVector<QXmlName> >
it(
namespaces);
133 for(
int i = 0; i < it.value().count(); ++i)
151 while(!next.isNull())
155 const QUrl candidate(next.stringValue());
158 if(!candidate.isValid())
160 else if(candidate.isRelative())
196 return par.baseUri();
223 "The API docs guarantees the two nodes are from the same model");
262 switch(
kind(preNumber))
271 return makeSingletonIterator(ni);
287 return makeEmptyIterator<QXmlNodeModelIndex>();
294 return makeEmptyIterator<QXmlNodeModelIndex>();
303 return makeEmptyIterator<QXmlNodeModelIndex>();
310 return makeEmptyIterator<QXmlNodeModelIndex>();
317 return makeEmptyIterator<QXmlNodeModelIndex>();
324 return makeSingletonIterator(ni);
332 return makeEmptyIterator<QXmlNodeModelIndex>();
337 return makeEmptyIterator<QXmlNodeModelIndex>();
346 return makeEmptyIterator<QXmlNodeModelIndex>();
353 return makeEmptyIterator<QXmlNodeModelIndex>();
358 return makeEmptyIterator<QXmlNodeModelIndex>();
402 bool hasUndeclaration =
false;
407 const int len = forNode.
size();
408 bool stopInheritance =
false;
410 for(
int i = 0; i < len; ++i)
416 stopInheritance =
true;
423 hasUndeclaration =
true;
458 while(!next.isNull())
471 const int len = nss.
count();
472 bool stopInheritance =
false;
474 for(
int i = 0; i < len; ++i)
480 stopInheritance =
true;
484 if(!alreadySent.contains(name.
prefix()))
486 alreadySent.append(name.
prefix());
502 switch(
kind(preNumber))
514 for(; pn <= stop; ++pn)
563 "A node type that doesn't exist in the XPath Data Model was encountered.");
578 for(
int i = 0; i <
size; ++i)
597 switch(
kind(preNumber))
616 "in the XPath Data Model was encountered.").arg(
kind(preNumber))));
638 outputted.
push(Binding());
655 outputted.
top().insert(elementName.prefix(), elementName.namespaceURI());
660 while(!attr.isNull())
662 const QXmlName &attrName = attr.name();
664 attr = attributes->next();
667 Binding::const_iterator
it(outputted.
top().constBegin());
668 const Binding::const_iterator
end(outputted.
top().constEnd());
679 while(!attribute.isNull())
681 const QString &v = attribute.stringValue();
704 receiver->
item(node);
727 while(!child.isNull())
730 child = children->next();
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QVariant class acts like a union for the most common Qt data types.
QString displayName(const QXmlName qName) const
The QXmlNodeModelIndex class identifies a node in an XML node model subclassed from QAbstractXmlNodeM...
A push interface for the XPath Data Model. Similar to SAX's ContentHandler.
Iterates along the ancestor or ancestor-or-self axis in an AccelTree.
#define QT_END_NAMESPACE
This macro expands to.
bool isNull() const
Returns true if this QXmlNodeModelIndex is a default constructed value, otherwise false...
virtual void namespaceBinding(const QXmlName &nb)=0
Signals the presence of the namespace declaration nb.
QString toString(FormattingOptions options=None) const
Returns the human-displayable string representation of the URL.
#define it(className, varName)
Implements axis attribute for the AccelTree.
static bool hasPrefix(const QVector< QXmlName > &nbs, const QXmlName::PrefixCode prefix)
Iterates along the sibling axes in an AccelTree.
int count(const T &t) const
Returns the number of occurrences of value in the vector.
bool isEmpty() const
Returns true if the URL has no data; otherwise returns false.
virtual QXmlNodeModelIndex::DocumentOrder compareOrder(const QXmlNodeModelIndex &ni1, const QXmlNodeModelIndex &ni2) const
This function returns the relative document order for the nodes indexed by ni1 and ni2...
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
virtual void copyNodeTo(const QXmlNodeModelIndex &node, QAbstractXmlReceiver *const receiver, const NodeCopySettings &settings) const
AccelTreePrivate(AccelTree *accelTree)
virtual QXmlNodeModelIndex::Iterator::Ptr iterate(const QXmlNodeModelIndex &ni, QXmlNodeModelIndex::Axis axis) const
Performs navigation, starting from ni, by returning an QAbstractXmlForwardIterator that returns nodes...
bool testFlag(Enum f) const
Returns true if the flag is set, otherwise false.
The QStack class is a template class that provides a stack.
virtual void startElement(const QXmlName name)=0
Signals the start of an element by name name.
virtual void startDocument()=0
Contains macros for debugging.
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
virtual void sendNamespaces(const QXmlNodeModelIndex &n, QAbstractXmlReceiver *const receiver) const
virtual void endElement()=0
Signals the end of the current element.
QHash< PreNumber, QVector< QXmlName > > namespaces
The QVector class is a template class that provides a dynamic array.
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
static UntypedAtomic::Ptr fromValue(const QString &value)
bool isCompressed(const PreNumber pre) const
static AtomicString::Ptr fromValue(const QString &value)
QString prefix(const QXmlNamePool &query) const
Returns the prefix.
const T value(const Key &key) const
Returns the value associated with the key.
virtual QXmlNodeModelIndex root(const QXmlNodeModelIndex &n) const
Returns the root node.
PreNumber toPreNumber(const QXmlNodeModelIndex n) const
void reserve(int size)
Ensures that the QHash's internal hash table consists of at least size buckets.
QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< T > > Ptr
A smart pointer wrapping an instance of a QAbstractXmlForwardIterator subclass.
T pop()
Removes the top item from the stack and returns it.
const QString & stringForPrefix(const QXmlName::PrefixCode code) const
bool hasParent(const PreNumber pre) const
#define QT_BEGIN_NAMESPACE
This macro expands to.
qint64 data() const
Returns the first data value.
QVector< BasicNodeData > basicData
The QAbstractXmlNodeModel class is an abstract base class for modeling non-XML data to look like XML ...
DocumentOrder
Identifies the specific node comparison operator that should be used.
The namespace for the internal API of QtXmlPatterns.
void append(const T &t)
Inserts value at the end of the vector.
Implements axis following for the AccelTree.
virtual QVector< QXmlName > namespaceBindings(const QXmlNodeModelIndex &n) const
Returns the in-scope namespaces of n.
bool hasChildren(const PreNumber pre) const
Returns true if the node identified by pre has child nodes(in the sense of the XDM), but also if it has namespace nodes, or attribute nodes.
The QSourceLocation class identifies a location in a resource by URI, line, and column.
virtual void item(const Item &item)=0
Sends an Item to this QAbstractXmlReceiver that may be a QXmlNodeModelIndex or an AtomicValue...
QHash< PreNumber, QString > data
const QAbstractXmlNodeModel * model() const
Returns the QAbstractXmlNodeModel that this node index refers to.
The Binding element allows arbitrary property bindings to be created.
void push(const T &t)
Adds element t to the top of the stack.
The QStringRef class provides a thin wrapper around QString substrings.
const T & at(int i) const
Returns the item at index position i in the vector.
Implements axis preceding for the AccelTree.
virtual QXmlNodeModelIndex elementById(const QXmlName &id) const
Returns the index of the element identified as id.
NamespaceCode namespaceURI() const
#define Q_ASSERT_X(cond, where, what)
Implements axis descendant and descendant-or-self for the AccelTree.
The QXmlName class represents the name of an XML node, in an efficient, namespace-aware way...
virtual QXmlNodeModelIndex::NodeKind kind(const QXmlNodeModelIndex &ni) const
Returns a value indicating the kind of node identified by ni.
Represents an item in the XPath 2.0 Data Model.
Stores an XML document using the XPath Accelerator scheme, also known as pre/post numbering...
NodeKind
Identifies a kind of node.
void sendNamespaces(QAbstractXmlReceiver *const receiver) const
QXmlNodeModelIndex createIndex(qint64 data) const
Creates a node index with data as its internal data.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
SimpleAxis
Four axes that each contain one node only.
virtual QVariant typedValue(const QXmlNodeModelIndex &n) const
Returns the typed value for node node.
QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< QXmlNodeModelIndex > > iterate(const Axis axis) const
void printStats(const NamePool::Ptr &np) const
const QString & stringForNamespace(const QXmlName::NamespaceCode code) const
virtual QString stringValue(const QXmlNodeModelIndex &n) const
Returns the string value for node n.
PostNumber postNumber(const PreNumber pre) const
AccelTree(const QUrl &docURI, const QUrl &bURI)
virtual QVector< QXmlNodeModelIndex > attributes(const QXmlNodeModelIndex &element) const
Returns the attributes of element.
virtual QVector< QXmlNodeModelIndex > nodesByIdref(const QXmlName &idref) const
Returns the elements and/or attributes that have an IDREF value equal to idref.
Axis
Identify the axes emanating from a node.
int count(const Key &key) const
Returns the number of items associated with the key.
virtual QXmlName name(const QXmlNodeModelIndex &ni) const
Returns the name of ni.
virtual QXmlNodeModelIndex parent(const QXmlNodeModelIndex &ni) const
Iterates along the child axis in an AccelTree.
Houses data for a node, and that all node kinds have.
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
The QFlags class provides a type-safe way of storing OR-combinations of enum values.
PreNumber maximumPreNumber() const
void copyChildren(const QXmlNodeModelIndex &node, QAbstractXmlReceiver *const receiver, const NodeCopySettings &settings) const
static QPatternist::ItemTypePtr typeFromKind(const QXmlNodeModelIndex::NodeKind nodeKind)
PreNumber size(const PreNumber pre) const
static QString decompress(const QString &input)
Decompresses input into a usual QString.
QUrl resolved(const QUrl &relative) const
Returns the result of the merge of this URL with relative.
virtual void attribute(const QXmlName name, const QString &value)=0
Signals the presence of an attribute node.
static const KeyPair *const end
virtual void endDocument()=0
#define qPrintable(string)
virtual QXmlNodeModelIndex nextFromSimpleAxis(QAbstractXmlNodeModel::SimpleAxis, const QXmlNodeModelIndex &) const
When QtXmlPatterns evaluate path expressions, it emulate them through a combination of calls with QSi...
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
int size() const
Returns the number of items in the vector.
virtual QSourceLocation sourceLocation(const QXmlNodeModelIndex &index) const
virtual Item::Iterator::Ptr sequencedTypedValue(const QXmlNodeModelIndex &n) const
QSourceLocation sourceLocation(const QXmlNodeModelIndex &index) const
bool isNull() const
Returns true if this QXmlName is not initialized with a valid combination of {namespace URI}...
QHash< QXmlName::LocalNameCode, PreNumber > m_IDs
T & top()
Returns a reference to the stack's top item.
QHash< PreNumber, QPair< qint64, qint64 > > sourcePositions
QXmlNodeModelIndex::NodeKind kind() const
virtual ItemType::Ptr type(const QXmlNodeModelIndex &ni) const