43 #include <QStringList> 104 , m_modelStorage(modelStorage)
111 m_modelStorage->addNodeModel(nodeModel);
130 else if(variant.
userType() == qMetaTypeId<QIODevice *>())
132 else if(variant.
userType() == qMetaTypeId<QXmlQuery>())
134 const QXmlQuery variableQuery(qvariant_cast<QXmlQuery>(variant));
150 "We assume that we have a binding.");
153 if(variant.
userType() == qMetaTypeId<QIODevice *>())
154 return makeSingletonIterator(itemForName(name));
155 else if(variant.
userType() == qMetaTypeId<QXmlQuery>())
157 const QXmlQuery variableQuery(qvariant_cast<QXmlQuery>(variant));
162 const QVariant v(qvariant_cast<QXmlItem>(variant).toAtomicValue());
171 return makeSingletonIterator(itemForName(name));
179 if(variant.
userType() == qMetaTypeId<QIODevice *>())
182 const QXmlItem item(qvariant_cast<QXmlItem>(variant));
188 const QVariant atomicValue(item.toAtomicValue());
192 if(atomicValue.isNull())
202 return itemForName(name);
213 const QXmlItem i1(qvariant_cast<QXmlItem>(v1));
214 const QXmlItem i2(qvariant_cast<QXmlItem>(v2));
232 m_bindingHash.remove(name);
237 return m_bindingHash.contains(name)
238 || (m_previousLoader && m_previousLoader->hasBinding(name));
243 if(m_bindingHash.contains(name))
244 return m_bindingHash.
value(name);
245 else if(m_previousLoader)
246 return m_previousLoader->valueFor(name);
254 m_bindingHash.insert(name, value);
260 return hasBinding(name) && !isSameType(valueFor(name), variant);
The QVariant class acts like a union for the most common Qt data types.
VariantListIterator(const QVariantList &list)
static Item inputToOutputItem(const QString &inputType)
#define QT_END_NAMESPACE
This macro expands to.
TemporaryTreesRedirectingContext(const DynamicContext::Ptr &other, const DynamicContext::Ptr &modelStorage)
bool isNull() const
Returns true if this is a NULL variant, false otherwise.
const DynamicContext::Ptr m_modelStorage
Due to strong interdependencies, this file contains the definitions for the classes Item...
The QXmlItem class contains either an XML node or an atomic value.
QList< QVariant > toList() const
Returns the variant as a QVariantList if the variant has type() List or StringList ; otherwise return...
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
static AtomicString::Ptr fromValue(const QString &value)
QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< Item > > Ptr
A smart pointer wrapping an instance of a QAbstractXmlForwardIterator subclass.
virtual QPatternist::Item::Iterator::Ptr evaluateSequence(const QXmlName name, const QPatternist::DynamicContext::Ptr &)
virtual QPatternist::Item evaluateSingleton(const QXmlName name, const QPatternist::DynamicContext::Ptr &)
QStringList toStringList() const
Returns the variant as a QStringList if the variant has type() StringList, String ...
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool isNode() const
Returns true if this item is a Node.
static const SequenceType::Ptr ExactlyOneAnyURI
void removeBinding(const QXmlName &name)
Base class for dynamic contexts that are created from an existing one.
The QStringList class provides a list of strings.
The namespace for the internal API of QtXmlPatterns.
QVariant valueFor(const QXmlName &name) const
bool invalidationRequired(const QXmlName &name, const QVariant &variant) const
void addBinding(const QXmlName &name, const QVariant &value)
QVariant toAtomicValue() const
If this QXmlItem represents an atomic value, it is converted to an appropriate QVariant and returned...
bool hasBinding(const QXmlName &name) const
QString localName(const QXmlNamePool &query) const
Returns the local name.
virtual SequenceType::Ptr staticType() const =0
#define Q_ASSERT_X(cond, where, what)
int userType() const
Returns the storage type of the value stored in the variant.
The QXmlName class represents the name of an XML node, in an efficient, namespace-aware way...
Represents an item in the XPath 2.0 Data Model.
virtual void addNodeModel(const QAbstractXmlNodeModel::Ptr &nodeModel)
Item inputToOutputItem(const QVariant &inputType) const
Type type() const
Returns the storage type of the value stored in the variant.
bool isAtomicValue() const
Returns true if this item is an atomic value.
StringListIterator(const QStringList &list)
virtual QPatternist::SequenceType::Ptr announceExternalVariable(const QXmlName name, const QPatternist::SequenceType::Ptr &declaredType)
QPatternist::Item itemForName(const QXmlName &name) const
static Item fromPublic(const QXmlItem &i)
static Cardinality exactlyOne()
QPatternist::Expression::Ptr expression(QIODevice *const queryDevice=0)
bool isSameType(const QVariant &v1, const QVariant &v2) const
T value() const
Returns the stored value converted to the template type T.
static ItemType::Ptr qtToXDMType(const QXmlItem &item)
static Item toXDM(const QVariant &value)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
QPatternist::DynamicContext::Ptr dynamicContext(QAbstractXmlReceiver *const callback=0)
static AnyURI::Ptr fromValue(const QString &value)
The QXmlQuery class performs XQueries on XML data, or on non-XML data modeled to look like XML...
virtual Item::Iterator::Ptr evaluateSequence(const DynamicContext::Ptr &context) const