20 #ifndef CONTEXTHELPERS_HPP
21 #define CONTEXTHELPERS_HPP
23 #include <xqilla/framework/XQillaExport.hpp>
41 context_->setNodeSetOrdering(ordering_);
73 context_->setContextItemType(sType_);
91 context_->setNSResolver(newResolver);
98 context_->setNSResolver(_oldNSResolver);
99 context_->setDefaultElementAndTypeNS(_defaultElementAndTypeNS);
114 : oldContextItem(context->getContextItem()),
115 oldContextPosition(context->getContextPosition()),
116 oldContextSize(context->getContextSize()),
122 : oldContextItem(context->getContextItem()),
123 oldContextPosition(context->getContextPosition()),
124 oldContextSize(context->getContextSize()),
139 context_->setContextItem(oldContextItem);
140 context_->setContextPosition(oldContextPosition);
141 context_->setContextSize(oldContextSize);
156 : oldDC(const_cast<
DocumentCache*>(context->getDocumentCache())),
163 context_->setDocumentCache(oldDC);
180 context_->setVariableStore(store);
185 context_->setVariableStore(_oldVarStore);
190 context_->setVariableStore(_oldVarStore);
206 context_->setRegexGroupStore(store);
211 context_->setRegexGroupStore(_oldRegexStore);
216 context_->setRegexGroupStore(_oldRegexStore);
239 context_->setMessageListener(listener_);
255 context_->setStackFrame(frame);
260 context_->setStackFrame(_oldFrame);
265 context_->setStackFrame(_oldFrame);
~AutoContextInfoReset()
Definition: ContextHelpers.hpp:132
void resetContextInfo()
Definition: ContextHelpers.hpp:137
NodeSetOrdering
Definition: StaticContext.hpp:60
MessageListener * listener_
Definition: ContextHelpers.hpp:245
size_t oldContextPosition
Definition: ContextHelpers.hpp:145
void reset()
Definition: ContextHelpers.hpp:263
StaticContext * context_
Definition: ContextHelpers.hpp:46
Expression Context is a storage for contexts.
Definition: DocumentCache.hpp:52
AutoDocumentCacheReset(DynamicContext *context)
Definition: ContextHelpers.hpp:155
~AutoDocumentCacheReset()
Definition: ContextHelpers.hpp:161
T & orig_
Definition: ContextHelpers.hpp:293
virtual const xercesc::DOMXPathNSResolver * getNSResolver() const =0
Get the NS resolver.
AutoVariableStoreReset(DynamicContext *context, const VariableStore *store=0)
Definition: ContextHelpers.hpp:175
~AutoNodeSetOrderingReset()
Definition: ContextHelpers.hpp:38
~AutoMessageListenerReset()
Definition: ContextHelpers.hpp:236
DynamicContext * context_
Definition: ContextHelpers.hpp:269
virtual void setContextItemType(const StaticType &st)=0
Set the static type of the context item.
~AutoNsScopeReset()
Definition: ContextHelpers.hpp:95
A class that represents an item in a query call stack.
Definition: StackFrame.hpp:45
AutoNsScopeReset(StaticContext *context, xercesc::DOMXPathNSResolver *newResolver)
Definition: ContextHelpers.hpp:85
const StackFrame * _oldFrame
Definition: ContextHelpers.hpp:270
AutoContextItemTypeReset(StaticContext *context, const StaticType &sType)
Definition: ContextHelpers.hpp:61
virtual void setContextSize(size_t size)=0
Set the context size.
AutoReset(T &orig)
Definition: ContextHelpers.hpp:276
AutoRegexGroupStoreReset(DynamicContext *context, const RegexGroupStore *store=0)
Definition: ContextHelpers.hpp:201
virtual const RegexGroupStore * getRegexGroupStore() const =0
get the regex group store
Definition: ContextHelpers.hpp:172
The parse time static context interface.
Definition: StaticContext.hpp:57
Item::Ptr oldContextItem
Definition: ContextHelpers.hpp:144
~AutoContextItemTypeReset()
Definition: ContextHelpers.hpp:70
virtual void setMessageListener(MessageListener *listener)=0
Set the listener for warning and trace messages.
StaticContext * context_
Definition: ContextHelpers.hpp:104
virtual void setNodeSetOrdering(NodeSetOrdering newOrder)=0
Set the ordering method for node sets.
virtual const StackFrame * getStackFrame() const =0
Gets the listener for debug messages.
size_t oldContextSize
Definition: ContextHelpers.hpp:146
~AutoReset()
Definition: ContextHelpers.hpp:282
Definition: ContextHelpers.hpp:152
Definition: ContextHelpers.hpp:110
virtual const XMLCh * getDefaultElementAndTypeNS() const =0
get the value of the default namespace for elements and types
Definition: ContextHelpers.hpp:82
Definition: ContextHelpers.hpp:26
void reset()
Definition: ContextHelpers.hpp:188
Definition: StaticContext.hpp:62
Definition: ContextHelpers.hpp:198
AutoContextInfoReset(DynamicContext *context)
Definition: ContextHelpers.hpp:113
virtual MessageListener * getMessageListener() const =0
Gets the listener for warning and trace messages.
virtual void setContextItem(const Item::Ptr &item)=0
Set the context item to item.
Definition: ContextHelpers.hpp:273
DynamicContext * context_
Definition: ContextHelpers.hpp:220
Definition: ContextHelpers.hpp:248
AutoContextItemTypeReset(StaticContext *context)
Definition: ContextHelpers.hpp:53
A class used to listen for warnings or trace information.
Definition: MessageListener.hpp:33
StaticType sType_
Definition: ContextHelpers.hpp:79
const VariableStore * _oldVarStore
Definition: ContextHelpers.hpp:195
Definition: ContextHelpers.hpp:224
AutoStackFrameReset(DynamicContext *context, const StackFrame *frame)
Definition: ContextHelpers.hpp:251
AutoMessageListenerReset(StaticContext *context, MessageListener *listener=0)
Definition: ContextHelpers.hpp:227
The execution time dynamic context interface.
Definition: DynamicContext.hpp:38
The pure virtual base class for accessing regular expression group values at runtime.
Definition: RegexGroupStore.hpp:30
The pure virtual base class for accessing variables at runtime.
Definition: VariableStore.hpp:31
const xercesc::DOMXPathNSResolver * _oldNSResolver
Definition: ContextHelpers.hpp:105
DynamicContext * context_
Definition: ContextHelpers.hpp:169
~AutoVariableStoreReset()
Definition: ContextHelpers.hpp:183
const RegexGroupStore * _oldRegexStore
Definition: ContextHelpers.hpp:221
AutoNodeSetOrderingReset(StaticContext *context, StaticContext::NodeSetOrdering ordering=StaticContext::ORDERING_UNORDERED)
Definition: ContextHelpers.hpp:29
StaticContext::NodeSetOrdering ordering_
Definition: ContextHelpers.hpp:47
AutoContextInfoReset(DynamicContext *context, const Item::Ptr &contextItem, size_t contextPosition=0, size_t contextSize=0)
Definition: ContextHelpers.hpp:121
void reset()
Definition: ContextHelpers.hpp:287
StaticContext * context_
Definition: ContextHelpers.hpp:78
virtual void setContextPosition(size_t pos)=0
Set the context position.
DocumentCache * oldDC
Definition: ContextHelpers.hpp:166
virtual const StaticType & getContextItemType() const =0
Get the static type of the context item.
Class that represents the static type of an expression.
Definition: StaticType.hpp:33
~AutoRegexGroupStoreReset()
Definition: ContextHelpers.hpp:209
DynamicContext * context_
Definition: ContextHelpers.hpp:194
~AutoStackFrameReset()
Definition: ContextHelpers.hpp:258
void reset()
Definition: ContextHelpers.hpp:214
virtual const VariableStore * getVariableStore() const =0
get the variable store
StaticContext * context_
Definition: ContextHelpers.hpp:244
T old_
Definition: ContextHelpers.hpp:294
Definition: ContextHelpers.hpp:50
const XMLCh * _defaultElementAndTypeNS
Definition: ContextHelpers.hpp:106
virtual NodeSetOrdering getNodeSetOrdering() const =0
Return the ordering method for node sets.