#include <qvariableloader_p.h>
|
void | addBinding (const QXmlName &name, const QVariant &value) |
|
virtual QPatternist::SequenceType::Ptr | announceExternalVariable (const QXmlName name, const QPatternist::SequenceType::Ptr &declaredType) |
|
virtual QPatternist::Item::Iterator::Ptr | evaluateSequence (const QXmlName name, const QPatternist::DynamicContext::Ptr &) |
|
virtual QPatternist::Item | evaluateSingleton (const QXmlName name, const QPatternist::DynamicContext::Ptr &) |
|
bool | hasBinding (const QXmlName &name) const |
|
bool | invalidationRequired (const QXmlName &name, const QVariant &variant) const |
|
bool | isSameType (const QVariant &v1, const QVariant &v2) const |
|
void | removeBinding (const QXmlName &name) |
|
QVariant | valueFor (const QXmlName &name) const |
|
| VariableLoader (const NamePool::Ptr &np, const VariableLoader::Ptr &previousLoader=VariableLoader::Ptr()) |
|
virtual bool | evaluateEBV (const QXmlName name, const QExplicitlySharedDataPointer< DynamicContext > &context) |
|
virtual Item::Iterator::Ptr | evaluateSequence (const QXmlName name, const QExplicitlySharedDataPointer< DynamicContext > &context) |
|
virtual Item | evaluateSingleton (const QXmlName name, const QExplicitlySharedDataPointer< DynamicContext > &context) |
|
| ExternalVariableLoader () |
|
virtual | ~ExternalVariableLoader () |
|
| QSharedData () |
| Constructs a QSharedData object with a reference count of 0. More...
|
|
| QSharedData (const QSharedData &) |
| Constructs a QSharedData object with reference count 0. More...
|
|
Definition at line 68 of file qvariableloader_p.h.
◆ BindingHash
◆ Ptr
◆ VariableLoader()
Definition at line 74 of file qvariableloader_p.h.
VariableLoader::Ptr m_previousLoader
const NamePool::Ptr m_namePool
◆ addBinding()
void VariableLoader::addBinding |
( |
const QXmlName & |
name, |
|
|
const QVariant & |
value |
|
) |
| |
Definition at line 251 of file qvariableloader.cpp.
Referenced by VariableLoader().
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
BindingHash m_bindingHash
◆ announceExternalVariable()
Called when Patternist encounters an external variable in the query. It is guaranteed to be called once for each external variable appearing in a query module.
- Parameters
-
name | the name of the variable. Quaranteed to never be null . |
declaredType | the type that the user declared the variable to be of. Whether this type matches the actual value of the variable or not is irrelevant. Patternist will do the necessary error handling based on the sequence type that is returned from this function. If the user didn't declare a type, the type is item()* (zero or more items). Quaranteed to never be null . |
- Returns
- the sequence type of the value this ExternalVariableLoader actually supplies. However, if the ExternalVariableLoader knows it cannot supply a variable by this name,
null
should be returned.
Reimplemented from QPatternist::ExternalVariableLoader.
Definition at line 121 of file qvariableloader.cpp.
Referenced by VariableLoader().
130 else if(variant.
userType() == qMetaTypeId<QIODevice *>())
132 else if(variant.
userType() == qMetaTypeId<QXmlQuery>())
134 const QXmlQuery variableQuery(qvariant_cast<QXmlQuery>(variant));
135 return variableQuery.d->expression()->staticType();
The QVariant class acts like a union for the most common Qt data types.
bool isNull() const
Returns true if this is a NULL variant, false otherwise.
const T value(const Key &key) const
Returns the value associated with the key.
static const SequenceType::Ptr ExactlyOneAnyURI
int userType() const
Returns the storage type of the value stored in the variant.
static Cardinality exactlyOne()
static ItemType::Ptr qtToXDMType(const QXmlItem &item)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
BindingHash m_bindingHash
The QXmlQuery class performs XQueries on XML data, or on non-XML data modeled to look like XML...
◆ evaluateSequence()
Definition at line 144 of file qvariableloader.cpp.
Referenced by VariableLoader().
150 "We assume that we have a binding.");
153 if(variant.
userType() == qMetaTypeId<QIODevice *>())
155 else if(variant.
userType() == qMetaTypeId<QXmlQuery>())
157 const QXmlQuery variableQuery(qvariant_cast<QXmlQuery>(variant));
162 const QVariant v(qvariant_cast<QXmlItem>(variant).toAtomicValue());
The QVariant class acts like a union for the most common Qt data types.
bool isNull() const
Returns true if this is a NULL variant, false otherwise.
const T value(const Key &key) const
Returns the value associated with the key.
QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< Item > > Ptr
A smart pointer wrapping an instance of a QAbstractXmlForwardIterator subclass.
#define Q_ASSERT_X(cond, where, what)
int userType() const
Returns the storage type of the value stored in the variant.
QPatternist::Item itemForName(const QXmlName &name) const
BindingHash m_bindingHash
The QXmlQuery class performs XQueries on XML data, or on non-XML data modeled to look like XML...
◆ evaluateSingleton()
◆ hasBinding()
bool VariableLoader::hasBinding |
( |
const QXmlName & |
name | ) |
const |
Definition at line 235 of file qvariableloader.cpp.
Referenced by VariableLoader().
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
VariableLoader::Ptr m_previousLoader
bool hasBinding(const QXmlName &name) const
BindingHash m_bindingHash
◆ invalidationRequired()
bool VariableLoader::invalidationRequired |
( |
const QXmlName & |
name, |
|
|
const QVariant & |
variant |
|
) |
| const |
Definition at line 257 of file qvariableloader.cpp.
Referenced by VariableLoader().
QVariant valueFor(const QXmlName &name) const
bool hasBinding(const QXmlName &name) const
bool isSameType(const QVariant &v1, const QVariant &v2) const
◆ isSameType()
bool VariableLoader::isSameType |
( |
const QVariant & |
v1, |
|
|
const QVariant & |
v2 |
|
) |
| const |
Definition at line 205 of file qvariableloader.cpp.
Referenced by VariableLoader().
213 const QXmlItem i1(qvariant_cast<QXmlItem>(v1));
214 const QXmlItem i2(qvariant_cast<QXmlItem>(v2));
221 else if(i2.isAtomicValue())
222 return i1.toAtomicValue().type() == i2.toAtomicValue().type();
The QXmlItem class contains either an XML node or an atomic value.
int userType() const
Returns the storage type of the value stored in the variant.
◆ itemForName()
Item VariableLoader::itemForName |
( |
const QXmlName & |
name | ) |
const |
|
inlineprivate |
Definition at line 175 of file qvariableloader.cpp.
Referenced by VariableLoader().
179 if(variant.
userType() == qMetaTypeId<QIODevice *>())
182 const QXmlItem item(qvariant_cast<QXmlItem>(variant));
188 const QVariant atomicValue(item.toAtomicValue());
192 if(atomicValue.isNull())
const QString & stringForLocalName(const QXmlName::LocalNameCode code) const
The QVariant class acts like a union for the most common Qt data types.
The QXmlItem class contains either an XML node or an atomic value.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
const T value(const Key &key) const
Returns the value associated with the key.
const NamePool::Ptr m_namePool
QString localName(const QXmlNamePool &query) const
Returns the local name.
int userType() const
Returns the storage type of the value stored in the variant.
Represents an item in the XPath 2.0 Data Model.
static Item fromPublic(const QXmlItem &i)
static Item toXDM(const QVariant &value)
BindingHash m_bindingHash
static AnyURI::Ptr fromValue(const QString &value)
◆ removeBinding()
void VariableLoader::removeBinding |
( |
const QXmlName & |
name | ) |
|
Definition at line 230 of file qvariableloader.cpp.
Referenced by VariableLoader().
int remove(const Key &key)
Removes all the items that have the key from the hash.
BindingHash m_bindingHash
◆ valueFor()
Definition at line 241 of file qvariableloader.cpp.
Referenced by QPatternist::URILoader::createRequest(), and VariableLoader().
The QVariant class acts like a union for the most common Qt data types.
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
VariableLoader::Ptr m_previousLoader
const T value(const Key &key) const
Returns the value associated with the key.
QVariant valueFor(const QXmlName &name) const
BindingHash m_bindingHash
◆ m_bindingHash
◆ m_namePool
◆ m_previousLoader
The documentation for this class was generated from the following files: