|
virtual bool | addExternalFunctionParam (const String &aName, void *aValue)=0 |
| Add a name-value pair to this context. More...
|
|
virtual bool | addExternalFunctionParameter (const String &aName, ExternalFunctionParameter *aParam) const =0 |
| Add a name-value pair to this context. More...
|
|
virtual bool | getContextItem (Item &aItem) const =0 |
| Returns the current value of the context item. More...
|
|
virtual bool | getContextPosition (Item &aItem) const =0 |
| Returns the current value of the context item position. More...
|
|
virtual bool | getContextSize (Item &aItem) const =0 |
| Returns the current value of the context item size. More...
|
|
virtual Item | getCurrentDateTime () const =0 |
| Retrieve the dateTime Item used at the time the query is executed (see setCurrentDateTime()). More...
|
|
virtual Item | getDefaultCollection () const =0 |
| Return the value of the default collection that is used when calling the fn:collection function without a parameter. More...
|
|
virtual bool | getExternalFunctionParam (const String &aName, void *&aValue) const =0 |
| Get the value of a pair that was registered using the addExternalFunctionParam method. More...
|
|
virtual ExternalFunctionParameter * | getExternalFunctionParameter (const String &aName) const =0 |
| Get the value of a pair that was registered using the addExternalFunctionParam method. More...
|
|
virtual int | getImplicitTimezone () const =0 |
| Retrieve the implicit timezone used in comparisons or arithmetic operations of date, time, or dateTime values. More...
|
|
virtual bool | getVariable (const String &aNamespace, const String &aLocalname, Item &aItem, Iterator_t &aIterator) const =0 |
| Returns the current value of an external variable. More...
|
|
virtual bool | isBoundContextItem () const =0 |
| Returns true if a context item has been bound to the Dynamic Context. More...
|
|
virtual bool | isBoundExternalVariable (const String &aNamespace, const String &aLocalname) const =0 |
| Returns true if the variable is bound to a value. More...
|
|
virtual bool | setContextItem (const Item &aItem)=0 |
| Defines the context item. More...
|
|
virtual bool | setContextPosition (const Item &aItem)=0 |
| Defines the context item position. More...
|
|
virtual bool | setContextSize (const Item &aItem)=0 |
| Defines the context item size. More...
|
|
virtual bool | setCurrentDateTime (const Item &aDateTimeItem)=0 |
| Defines the value of the current date time that can be accessed by the fn:current-dateTime() function at the time the query is executed. More...
|
|
virtual bool | setDefaultCollection (const Item &aCollectionUri)=0 |
| Defines the value of the default collection that is used when calling the fn:collection function without a parameter. More...
|
|
virtual bool | setImplicitTimezone (int aTimezone)=0 |
| Defines the variable of the implicit timezone to be used when a date, time, or dateTime value that does not have a timezone is used in a comparison or arithmetic operation. More...
|
|
virtual bool | setVariable (const String &aQName, const Item &aItem)=0 |
| Defines the external variable identified by aQName and assigns it the value of aItem. More...
|
|
virtual bool | setVariable (const String &aQName, const Iterator_t &aIterator)=0 |
| Defines the external variable identified by aQName and assigns it the sequence that is returned by evaluating aIterator. More...
|
|
virtual bool | setVariable (const String &aNamespace, const String &aLocalname, const Iterator_t &aIterator)=0 |
| Defines the external variable identified by an expanded QName and assigns it the sequence that is returned by evaluating aIterator. More...
|
|
Instances of the class DynamicContext contain the information that is available at the time the query is executed.
The class contains the information that is defined in the XQuery specification (see http://www.w3.org/TR/xquery/#eval_context).
A dynamic context always belongs to a particular query and, hence, can be retrieved by calling getDynamicContext on a compiled query (see XQuery::getDynamicContext()).
- Examples:
- context.cpp, external_functions.cpp, and simple.cpp.
Definition at line 43 of file dynamic_context.h.
virtual bool zorba::DynamicContext::setVariable |
( |
const String & |
aQName, |
|
|
const Item & |
aItem |
|
) |
| |
|
pure virtual |
Defines the external variable identified by aQName and assigns it the value of aItem.
aQName may be in one of two forms: A lexical QName (eg. "ns:foo"), or a James Clark-style universal name (eg. "{nsuri}:foo"). If it is a universal name, then this method will find the named external variable in the main query or in any modules imported directly or indirectly by the query. If it is a lexical QName, then it is only possible to resolve the prefix in the the context of the main query, hence only external variables in the main query or those in directly-imported modules may be bound.
- Parameters
-
aQName | the QName that identifies the external variable. |
aItem | the Item that is used as value for the variable. |
- Returns
- true if the variable has been set, false otherwise.
- Exceptions
-
- Examples:
- context.cpp, and simple.cpp.
virtual bool zorba::DynamicContext::setVariable |
( |
const String & |
aQName, |
|
|
const Iterator_t & |
aIterator |
|
) |
| |
|
pure virtual |
Defines the external variable identified by aQName and assigns it the sequence that is returned by evaluating aIterator.
aQName may be in one of two forms: A lexical QName (eg. "ns:foo"), or a James Clark-style universal name (eg. "{nsuri}:foo"). If it is a universal name, then this method will find the named external variable in the main query or in any modules imported directly or indirectly by the query. If it is a lexical QName, then it is only possible to resolve the prefix in the the context of the main query, hence only external variables in the main query or those in directly-imported modules may be bound.
- Parameters
-
aQName | the QName that identifies the external variable. |
aIterator | the Iterator producing the sequence that is assigned to the variable. |
- Returns
- true if the variable has been set successfully, false otherwise.
- Exceptions
-