XQuilla/docs/simple-api/ContextHelpers_8hpp-source.html
2020-02-17 22:12:51 +01:00

195 lines
16 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>XQilla Simple API Documentation</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<a style="float:right;" href="http://sourceforge.net/projects/xqilla"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=152021&amp;type=2" border="0" alt="SourceForge.net Logo" /></a>
<!-- Generated by Doxygen 1.5.1 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="classes.html"><span>Classes</span></a></li>
<li id="current"><a href="files.html"><span>Files</span></a></li>
</ul></div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul></div>
<h1>ContextHelpers.hpp</h1><a href="ContextHelpers_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (c) 2001-2007</span>
<a name="l00003"></a>00003 <span class="comment"> * DecisionSoft Limited. All rights reserved.</span>
<a name="l00004"></a>00004 <span class="comment"> * Copyright (c) 2004-2007</span>
<a name="l00005"></a>00005 <span class="comment"> * Oracle. All rights reserved.</span>
<a name="l00006"></a>00006 <span class="comment"> *</span>
<a name="l00007"></a>00007 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span>
<a name="l00008"></a>00008 <span class="comment"> * you may not use this file except in compliance with the License.</span>
<a name="l00009"></a>00009 <span class="comment"> * You may obtain a copy of the License at</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
<a name="l00014"></a>00014 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span>
<a name="l00015"></a>00015 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<a name="l00016"></a>00016 <span class="comment"> * See the License for the specific language governing permissions and</span>
<a name="l00017"></a>00017 <span class="comment"> * limitations under the License.</span>
<a name="l00018"></a>00018 <span class="comment"> *</span>
<a name="l00019"></a>00019 <span class="comment"> * $Id: ContextHelpers.hpp,v 1.6 2007/11/28 13:13:20 jpcs Exp $</span>
<a name="l00020"></a>00020 <span class="comment"> */</span>
<a name="l00021"></a>00021
<a name="l00022"></a>00022 <span class="preprocessor">#ifndef CONTEXTHELPERS_HPP</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define CONTEXTHELPERS_HPP</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;xqilla/framework/XQillaExport.hpp&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;<a class="code" href="DynamicContext_8hpp.html">xqilla/context/DynamicContext.hpp</a>&gt;</span>
<a name="l00027"></a>00027
<a name="l00028"></a><a class="code" href="classAutoNodeSetOrderingReset.html">00028</a> <span class="keyword">class </span>XQILLA_API <a class="code" href="classAutoNodeSetOrderingReset.html">AutoNodeSetOrderingReset</a>
<a name="l00029"></a>00029 {
<a name="l00030"></a>00030 <span class="keyword">public</span>:
<a name="l00031"></a><a class="code" href="classAutoNodeSetOrderingReset.html#8712620fa53a028c935c1e2b207860a6">00031</a> <a class="code" href="classAutoNodeSetOrderingReset.html">AutoNodeSetOrderingReset</a>(<a class="code" href="classStaticContext.html">StaticContext</a>* context, <a class="code" href="classStaticContext.html#b8bafb380375462baaed1f97db7314cd">StaticContext::NodeSetOrdering</a> ordering = <a class="code" href="classStaticContext.html#b8bafb380375462baaed1f97db7314cd11863f7ffef852eb2467b9c3b0236f86">StaticContext::ORDERING_UNORDERED</a>)
<a name="l00032"></a>00032 {
<a name="l00033"></a>00033 context_ = context;
<a name="l00034"></a>00034 ordering_ = context-&gt;<a class="code" href="classStaticContext.html#fd0424746a15ecf3a8b99f15a3ecb036">getNodeSetOrdering</a>();
<a name="l00035"></a>00035 context-&gt;<a class="code" href="classStaticContext.html#e36546cd177c71fccf416c3c007ea75c">setNodeSetOrdering</a>(ordering);
<a name="l00036"></a>00036 }
<a name="l00037"></a>00037
<a name="l00038"></a><a class="code" href="classAutoNodeSetOrderingReset.html#1a24ceb1c309541ec5962a94497e5b9e">00038</a> ~<a class="code" href="classAutoNodeSetOrderingReset.html">AutoNodeSetOrderingReset</a>()
<a name="l00039"></a>00039 {
<a name="l00040"></a>00040 context_-&gt;setNodeSetOrdering(ordering_);
<a name="l00041"></a>00041 }
<a name="l00042"></a>00042
<a name="l00043"></a>00043 <span class="keyword">protected</span>:
<a name="l00044"></a><a class="code" href="classAutoNodeSetOrderingReset.html#bf1285a927bd48d23a457f89e3635ea0">00044</a> <a class="code" href="classStaticContext.html">StaticContext</a>* context_;
<a name="l00045"></a><a class="code" href="classAutoNodeSetOrderingReset.html#1d8e19b8fe8939ec993884dae65ab457">00045</a> <a class="code" href="classStaticContext.html#b8bafb380375462baaed1f97db7314cd">StaticContext::NodeSetOrdering</a> ordering_;
<a name="l00046"></a>00046 };
<a name="l00047"></a>00047
<a name="l00048"></a><a class="code" href="classAutoContextItemTypeReset.html">00048</a> <span class="keyword">class </span>XQILLA_API AutoContextItemTypeReset
<a name="l00049"></a>00049 {
<a name="l00050"></a>00050 <span class="keyword">public</span>:
<a name="l00051"></a><a class="code" href="classAutoContextItemTypeReset.html#0b60a30ce21a5e47b3a620c80fccca98">00051</a> AutoContextItemTypeReset(<a class="code" href="classStaticContext.html">StaticContext</a>* context, <span class="keyword">const</span> StaticType &amp;sType)
<a name="l00052"></a>00052 {
<a name="l00053"></a>00053 context_ = context;
<a name="l00054"></a>00054 sType_ = context-&gt;<a class="code" href="classStaticContext.html#c2ac8fb630c5c5a7a9023ef6511653bf">getContextItemType</a>();
<a name="l00055"></a>00055 context-&gt;<a class="code" href="classStaticContext.html#35d3b2eef9afe340b5c0d39e87bb7e68">setContextItemType</a>(sType);
<a name="l00056"></a>00056 }
<a name="l00057"></a>00057
<a name="l00058"></a><a class="code" href="classAutoContextItemTypeReset.html#2ba43e89c2aba5f2c5107de4cdbe981f">00058</a> ~AutoContextItemTypeReset()
<a name="l00059"></a>00059 {
<a name="l00060"></a>00060 context_-&gt;setContextItemType(sType_);
<a name="l00061"></a>00061 }
<a name="l00062"></a>00062
<a name="l00063"></a>00063 <span class="keyword">protected</span>:
<a name="l00064"></a><a class="code" href="classAutoContextItemTypeReset.html#ce7f80abbbc5c20b406cf05fd492aded">00064</a> <a class="code" href="classStaticContext.html">StaticContext</a>* context_;
<a name="l00065"></a><a class="code" href="classAutoContextItemTypeReset.html#22aa431e65ccc96c43dddc66916dadaf">00065</a> StaticType sType_;
<a name="l00066"></a>00066 };
<a name="l00067"></a>00067
<a name="l00068"></a><a class="code" href="classAutoNsScopeReset.html">00068</a> <span class="keyword">class </span>XQILLA_API AutoNsScopeReset
<a name="l00069"></a>00069 {
<a name="l00070"></a>00070 <span class="keyword">public</span>:
<a name="l00071"></a><a class="code" href="classAutoNsScopeReset.html#0b459d9b331589eaa0068e0fe1426cd2">00071</a> AutoNsScopeReset(<a class="code" href="classStaticContext.html">StaticContext</a>* context, XERCES_CPP_NAMESPACE_QUALIFIER DOMXPathNSResolver* newResolver)
<a name="l00072"></a>00072 {
<a name="l00073"></a>00073 _context=context;
<a name="l00074"></a>00074 _oldNSResolver=_context-&gt;<a class="code" href="classStaticContext.html#84f5db272b59da8096db220d15ae4dd4">getNSResolver</a>();
<a name="l00075"></a>00075 _defaultElementAndTypeNS=context-&gt;<a class="code" href="classStaticContext.html#ab185f84bf729f653f60027547c671d8">getDefaultElementAndTypeNS</a>();
<a name="l00076"></a>00076 _context-&gt;setNSResolver(newResolver);
<a name="l00077"></a>00077 }
<a name="l00078"></a>00078
<a name="l00079"></a><a class="code" href="classAutoNsScopeReset.html#230b8010acb9f3278e3f1232882de073">00079</a> ~AutoNsScopeReset()
<a name="l00080"></a>00080 {
<a name="l00081"></a>00081 _context-&gt;setNSResolver(_oldNSResolver);
<a name="l00082"></a>00082 _context-&gt;setDefaultElementAndTypeNS(_defaultElementAndTypeNS);
<a name="l00083"></a>00083 }
<a name="l00084"></a>00084
<a name="l00085"></a>00085 <span class="keyword">protected</span>:
<a name="l00086"></a><a class="code" href="classAutoNsScopeReset.html#39b94f902fd874049c915d88a73a6f18">00086</a> <a class="code" href="classStaticContext.html">StaticContext</a>* _context;
<a name="l00087"></a><a class="code" href="classAutoNsScopeReset.html#75e7d1df70701cccc9d35b46d4155865">00087</a> <span class="keyword">const</span> XERCES_CPP_NAMESPACE_QUALIFIER DOMXPathNSResolver* _oldNSResolver;
<a name="l00088"></a><a class="code" href="classAutoNsScopeReset.html#45fc3c96ca3566119940aebb0228d56f">00088</a> <span class="keyword">const</span> XMLCh *_defaultElementAndTypeNS;
<a name="l00089"></a>00089
<a name="l00090"></a>00090 };
<a name="l00091"></a>00091
<a name="l00092"></a><a class="code" href="classAutoContextInfoReset.html">00092</a> <span class="keyword">class </span>XQILLA_API AutoContextInfoReset
<a name="l00093"></a>00093 {
<a name="l00094"></a>00094 <span class="keyword">public</span>:
<a name="l00095"></a><a class="code" href="classAutoContextInfoReset.html#9b562482b7a7f91957f7b60769061575">00095</a> AutoContextInfoReset(<a class="code" href="classDynamicContext.html">DynamicContext</a>* context)
<a name="l00096"></a>00096 : oldContextItem(context-&gt;getContextItem()),
<a name="l00097"></a>00097 oldContextPosition(context-&gt;getContextPosition()),
<a name="l00098"></a>00098 oldContextSize(context-&gt;getContextSize()),
<a name="l00099"></a>00099 context_(context)
<a name="l00100"></a>00100 {
<a name="l00101"></a>00101 }
<a name="l00102"></a>00102
<a name="l00103"></a><a class="code" href="classAutoContextInfoReset.html#b1a61085c5a470d0807109d8db6c2124">00103</a> ~AutoContextInfoReset()
<a name="l00104"></a>00104 {
<a name="l00105"></a>00105 resetContextInfo();
<a name="l00106"></a>00106 }
<a name="l00107"></a>00107
<a name="l00108"></a><a class="code" href="classAutoContextInfoReset.html#7738ac81fa2e3964d678b0b4454647d3">00108</a> <span class="keywordtype">void</span> resetContextInfo()
<a name="l00109"></a>00109 {
<a name="l00110"></a>00110 context_-&gt;setContextItem(oldContextItem);
<a name="l00111"></a>00111 context_-&gt;setContextPosition(oldContextPosition);
<a name="l00112"></a>00112 context_-&gt;setContextSize(oldContextSize);
<a name="l00113"></a>00113 }
<a name="l00114"></a>00114
<a name="l00115"></a><a class="code" href="classAutoContextInfoReset.html#6d430e6532df783691cd2cba063d07cd">00115</a> <a class="code" href="classRefCountPointer.html">Item::Ptr</a> oldContextItem;
<a name="l00116"></a><a class="code" href="classAutoContextInfoReset.html#22fd51d7dadabb9c595c028e96d2ac98">00116</a> size_t oldContextPosition;
<a name="l00117"></a><a class="code" href="classAutoContextInfoReset.html#4030e4f537336e3a19f54c9e0ac91f4e">00117</a> size_t oldContextSize;
<a name="l00118"></a>00118
<a name="l00119"></a>00119 <span class="keyword">private</span>:
<a name="l00120"></a>00120 <a class="code" href="classDynamicContext.html">DynamicContext</a>* context_;
<a name="l00121"></a>00121 };
<a name="l00122"></a>00122
<a name="l00123"></a><a class="code" href="classAutoDocumentCacheReset.html">00123</a> <span class="keyword">class </span>XQILLA_API AutoDocumentCacheReset
<a name="l00124"></a>00124 {
<a name="l00125"></a>00125 <span class="keyword">public</span>:
<a name="l00126"></a><a class="code" href="classAutoDocumentCacheReset.html#2a02fae6f17c4ba91bfdb80f64a94d4e">00126</a> AutoDocumentCacheReset(<a class="code" href="classDynamicContext.html">DynamicContext</a>* context)
<a name="l00127"></a>00127 : oldDC(const_cast&lt;DocumentCache*&gt;(context-&gt;getDocumentCache())),
<a name="l00128"></a>00128 context_ (context)
<a name="l00129"></a>00129 {
<a name="l00130"></a>00130 }
<a name="l00131"></a>00131
<a name="l00132"></a><a class="code" href="classAutoDocumentCacheReset.html#e09e539475cde761223c56de5f9b74bf">00132</a> ~AutoDocumentCacheReset()
<a name="l00133"></a>00133 {
<a name="l00134"></a>00134 context_-&gt;setDocumentCache(oldDC);
<a name="l00135"></a>00135 }
<a name="l00136"></a>00136
<a name="l00137"></a><a class="code" href="classAutoDocumentCacheReset.html#b5a50b8b1393ff16151f86806bb959d4">00137</a> DocumentCache *oldDC;
<a name="l00138"></a>00138
<a name="l00139"></a>00139 <span class="keyword">protected</span>:
<a name="l00140"></a><a class="code" href="classAutoDocumentCacheReset.html#f958239a0d69f253c1cfbafa2911063e">00140</a> <a class="code" href="classDynamicContext.html">DynamicContext</a>* context_;
<a name="l00141"></a>00141 };
<a name="l00142"></a>00142
<a name="l00143"></a><a class="code" href="classAutoVariableStoreReset.html">00143</a> <span class="keyword">class </span>XQILLA_API AutoVariableStoreReset
<a name="l00144"></a>00144 {
<a name="l00145"></a>00145 <span class="keyword">public</span>:
<a name="l00146"></a><a class="code" href="classAutoVariableStoreReset.html#23db674812c33e34be243c9e8919ea51">00146</a> AutoVariableStoreReset(<a class="code" href="classDynamicContext.html">DynamicContext</a> *context, <span class="keyword">const</span> <a class="code" href="classVariableStore.html">VariableStore</a> *store = 0)
<a name="l00147"></a>00147 {
<a name="l00148"></a>00148 _context = context;
<a name="l00149"></a>00149 _oldVarStore = _context-&gt;<a class="code" href="classDynamicContext.html#928be86b35facdcd0ae18faf9dc732d3">getVariableStore</a>();
<a name="l00150"></a>00150 <span class="keywordflow">if</span>(store)
<a name="l00151"></a>00151 _context-&gt;setVariableStore(store);
<a name="l00152"></a>00152 }
<a name="l00153"></a>00153
<a name="l00154"></a><a class="code" href="classAutoVariableStoreReset.html#93215d55189ab612323b6c76346ccb88">00154</a> ~AutoVariableStoreReset()
<a name="l00155"></a>00155 {
<a name="l00156"></a>00156 _context-&gt;setVariableStore(_oldVarStore);
<a name="l00157"></a>00157 }
<a name="l00158"></a>00158
<a name="l00159"></a><a class="code" href="classAutoVariableStoreReset.html#1aedc284d880dca82bc66763cf623960">00159</a> <span class="keywordtype">void</span> reset()
<a name="l00160"></a>00160 {
<a name="l00161"></a>00161 _context-&gt;setVariableStore(_oldVarStore);
<a name="l00162"></a>00162 }
<a name="l00163"></a>00163
<a name="l00164"></a>00164 <span class="keyword">protected</span>:
<a name="l00165"></a><a class="code" href="classAutoVariableStoreReset.html#c31f61e97449ef34e1b84d3ffee249fa">00165</a> <a class="code" href="classDynamicContext.html">DynamicContext</a> *_context;
<a name="l00166"></a><a class="code" href="classAutoVariableStoreReset.html#7951bfa91a8575a876a9ec569240a5ab">00166</a> <span class="keyword">const</span> <a class="code" href="classVariableStore.html">VariableStore</a> *_oldVarStore;
<a name="l00167"></a>00167
<a name="l00168"></a>00168 };
<a name="l00169"></a>00169
<a name="l00170"></a>00170 <span class="preprocessor">#endif</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Dec 12 20:16:43 2007 for XQilla Simple API by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address>
</body>
</html>