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

187 lines
15 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-2006</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-2006</span>
<a name="l00005"></a>00005 <span class="comment"> * Progress Software Corporation. All rights reserved.</span>
<a name="l00006"></a>00006 <span class="comment"> * Copyright (c) 2004-2006</span>
<a name="l00007"></a>00007 <span class="comment"> * Oracle. All rights reserved.</span>
<a name="l00008"></a>00008 <span class="comment"> *</span>
<a name="l00009"></a>00009 <span class="comment"> * See the file LICENSE for redistribution information.</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * $Id: ContextHelpers.hpp,v 1.4 2007/07/10 16:28:57 jpcs Exp $</span>
<a name="l00012"></a>00012 <span class="comment"> */</span>
<a name="l00013"></a>00013
<a name="l00014"></a>00014 <span class="preprocessor">#ifndef CONTEXTHELPERS_HPP</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor">#define CONTEXTHELPERS_HPP</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;xqilla/framework/XQillaExport.hpp&gt;</span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;<a class="code" href="DynamicContext_8hpp.html">xqilla/context/DynamicContext.hpp</a>&gt;</span>
<a name="l00019"></a>00019
<a name="l00020"></a><a class="code" href="classAutoNodeSetOrderingReset.html">00020</a> <span class="keyword">class </span>XQILLA_API <a class="code" href="classAutoNodeSetOrderingReset.html">AutoNodeSetOrderingReset</a>
<a name="l00021"></a>00021 {
<a name="l00022"></a>00022 <span class="keyword">public</span>:
<a name="l00023"></a><a class="code" href="classAutoNodeSetOrderingReset.html#8712620fa53a028c935c1e2b207860a6">00023</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="l00024"></a>00024 {
<a name="l00025"></a>00025 context_ = context;
<a name="l00026"></a>00026 ordering_ = context-&gt;<a class="code" href="classStaticContext.html#fd0424746a15ecf3a8b99f15a3ecb036">getNodeSetOrdering</a>();
<a name="l00027"></a>00027 context-&gt;<a class="code" href="classStaticContext.html#e36546cd177c71fccf416c3c007ea75c">setNodeSetOrdering</a>(ordering);
<a name="l00028"></a>00028 }
<a name="l00029"></a>00029
<a name="l00030"></a><a class="code" href="classAutoNodeSetOrderingReset.html#1a24ceb1c309541ec5962a94497e5b9e">00030</a> ~<a class="code" href="classAutoNodeSetOrderingReset.html">AutoNodeSetOrderingReset</a>()
<a name="l00031"></a>00031 {
<a name="l00032"></a>00032 context_-&gt;setNodeSetOrdering(ordering_);
<a name="l00033"></a>00033 }
<a name="l00034"></a>00034
<a name="l00035"></a>00035 <span class="keyword">protected</span>:
<a name="l00036"></a><a class="code" href="classAutoNodeSetOrderingReset.html#bf1285a927bd48d23a457f89e3635ea0">00036</a> <a class="code" href="classStaticContext.html">StaticContext</a>* context_;
<a name="l00037"></a><a class="code" href="classAutoNodeSetOrderingReset.html#1d8e19b8fe8939ec993884dae65ab457">00037</a> <a class="code" href="classStaticContext.html#b8bafb380375462baaed1f97db7314cd">StaticContext::NodeSetOrdering</a> ordering_;
<a name="l00038"></a>00038 };
<a name="l00039"></a>00039
<a name="l00040"></a><a class="code" href="classAutoContextItemTypeReset.html">00040</a> <span class="keyword">class </span>XQILLA_API AutoContextItemTypeReset
<a name="l00041"></a>00041 {
<a name="l00042"></a>00042 <span class="keyword">public</span>:
<a name="l00043"></a><a class="code" href="classAutoContextItemTypeReset.html#0b60a30ce21a5e47b3a620c80fccca98">00043</a> AutoContextItemTypeReset(<a class="code" href="classStaticContext.html">StaticContext</a>* context, <span class="keyword">const</span> StaticType &amp;sType)
<a name="l00044"></a>00044 {
<a name="l00045"></a>00045 context_ = context;
<a name="l00046"></a>00046 sType_ = context-&gt;<a class="code" href="classStaticContext.html#c2ac8fb630c5c5a7a9023ef6511653bf">getContextItemType</a>();
<a name="l00047"></a>00047 context-&gt;<a class="code" href="classStaticContext.html#35d3b2eef9afe340b5c0d39e87bb7e68">setContextItemType</a>(sType);
<a name="l00048"></a>00048 }
<a name="l00049"></a>00049
<a name="l00050"></a><a class="code" href="classAutoContextItemTypeReset.html#2ba43e89c2aba5f2c5107de4cdbe981f">00050</a> ~AutoContextItemTypeReset()
<a name="l00051"></a>00051 {
<a name="l00052"></a>00052 context_-&gt;setContextItemType(sType_);
<a name="l00053"></a>00053 }
<a name="l00054"></a>00054
<a name="l00055"></a>00055 <span class="keyword">protected</span>:
<a name="l00056"></a><a class="code" href="classAutoContextItemTypeReset.html#ce7f80abbbc5c20b406cf05fd492aded">00056</a> <a class="code" href="classStaticContext.html">StaticContext</a>* context_;
<a name="l00057"></a><a class="code" href="classAutoContextItemTypeReset.html#22aa431e65ccc96c43dddc66916dadaf">00057</a> StaticType sType_;
<a name="l00058"></a>00058 };
<a name="l00059"></a>00059
<a name="l00060"></a><a class="code" href="classAutoNsScopeReset.html">00060</a> <span class="keyword">class </span>XQILLA_API AutoNsScopeReset
<a name="l00061"></a>00061 {
<a name="l00062"></a>00062 <span class="keyword">public</span>:
<a name="l00063"></a><a class="code" href="classAutoNsScopeReset.html#0b459d9b331589eaa0068e0fe1426cd2">00063</a> AutoNsScopeReset(<a class="code" href="classStaticContext.html">StaticContext</a>* context, XERCES_CPP_NAMESPACE_QUALIFIER DOMXPathNSResolver* newResolver)
<a name="l00064"></a>00064 {
<a name="l00065"></a>00065 _context=context;
<a name="l00066"></a>00066 _oldNSResolver=_context-&gt;<a class="code" href="classStaticContext.html#84f5db272b59da8096db220d15ae4dd4">getNSResolver</a>();
<a name="l00067"></a>00067 _defaultElementAndTypeNS=context-&gt;<a class="code" href="classStaticContext.html#ab185f84bf729f653f60027547c671d8">getDefaultElementAndTypeNS</a>();
<a name="l00068"></a>00068 _context-&gt;setNSResolver(newResolver);
<a name="l00069"></a>00069 }
<a name="l00070"></a>00070
<a name="l00071"></a><a class="code" href="classAutoNsScopeReset.html#230b8010acb9f3278e3f1232882de073">00071</a> ~AutoNsScopeReset()
<a name="l00072"></a>00072 {
<a name="l00073"></a>00073 _context-&gt;setNSResolver(_oldNSResolver);
<a name="l00074"></a>00074 _context-&gt;setDefaultElementAndTypeNS(_defaultElementAndTypeNS);
<a name="l00075"></a>00075 }
<a name="l00076"></a>00076
<a name="l00077"></a>00077 <span class="keyword">protected</span>:
<a name="l00078"></a><a class="code" href="classAutoNsScopeReset.html#39b94f902fd874049c915d88a73a6f18">00078</a> <a class="code" href="classStaticContext.html">StaticContext</a>* _context;
<a name="l00079"></a><a class="code" href="classAutoNsScopeReset.html#75e7d1df70701cccc9d35b46d4155865">00079</a> <span class="keyword">const</span> XERCES_CPP_NAMESPACE_QUALIFIER DOMXPathNSResolver* _oldNSResolver;
<a name="l00080"></a><a class="code" href="classAutoNsScopeReset.html#45fc3c96ca3566119940aebb0228d56f">00080</a> <span class="keyword">const</span> XMLCh *_defaultElementAndTypeNS;
<a name="l00081"></a>00081
<a name="l00082"></a>00082 };
<a name="l00083"></a>00083
<a name="l00084"></a><a class="code" href="classAutoContextInfoReset.html">00084</a> <span class="keyword">class </span>XQILLA_API AutoContextInfoReset
<a name="l00085"></a>00085 {
<a name="l00086"></a>00086 <span class="keyword">public</span>:
<a name="l00087"></a><a class="code" href="classAutoContextInfoReset.html#9b562482b7a7f91957f7b60769061575">00087</a> AutoContextInfoReset(<a class="code" href="classDynamicContext.html">DynamicContext</a>* context)
<a name="l00088"></a>00088 : oldContextItem(context-&gt;getContextItem()),
<a name="l00089"></a>00089 oldContextPosition(context-&gt;getContextPosition()),
<a name="l00090"></a>00090 oldContextSize(context-&gt;getContextSize()),
<a name="l00091"></a>00091 context_(context)
<a name="l00092"></a>00092 {
<a name="l00093"></a>00093 }
<a name="l00094"></a>00094
<a name="l00095"></a><a class="code" href="classAutoContextInfoReset.html#b1a61085c5a470d0807109d8db6c2124">00095</a> ~AutoContextInfoReset()
<a name="l00096"></a>00096 {
<a name="l00097"></a>00097 resetContextInfo();
<a name="l00098"></a>00098 }
<a name="l00099"></a>00099
<a name="l00100"></a><a class="code" href="classAutoContextInfoReset.html#7738ac81fa2e3964d678b0b4454647d3">00100</a> <span class="keywordtype">void</span> resetContextInfo()
<a name="l00101"></a>00101 {
<a name="l00102"></a>00102 context_-&gt;setContextItem(oldContextItem);
<a name="l00103"></a>00103 context_-&gt;setContextPosition(oldContextPosition);
<a name="l00104"></a>00104 context_-&gt;setContextSize(oldContextSize);
<a name="l00105"></a>00105 }
<a name="l00106"></a>00106
<a name="l00107"></a><a class="code" href="classAutoContextInfoReset.html#6d430e6532df783691cd2cba063d07cd">00107</a> <a class="code" href="classRefCountPointer.html">Item::Ptr</a> oldContextItem;
<a name="l00108"></a><a class="code" href="classAutoContextInfoReset.html#53d88476c224d18b8081cb6384c5500b">00108</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> oldContextPosition;
<a name="l00109"></a><a class="code" href="classAutoContextInfoReset.html#a3a2e675e0bab3f051f8e69ab05ad37c">00109</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> oldContextSize;
<a name="l00110"></a>00110
<a name="l00111"></a>00111 <span class="keyword">private</span>:
<a name="l00112"></a>00112 <a class="code" href="classDynamicContext.html">DynamicContext</a>* context_;
<a name="l00113"></a>00113 };
<a name="l00114"></a>00114
<a name="l00115"></a><a class="code" href="classAutoDocumentCacheReset.html">00115</a> <span class="keyword">class </span>XQILLA_API AutoDocumentCacheReset
<a name="l00116"></a>00116 {
<a name="l00117"></a>00117 <span class="keyword">public</span>:
<a name="l00118"></a><a class="code" href="classAutoDocumentCacheReset.html#2a02fae6f17c4ba91bfdb80f64a94d4e">00118</a> AutoDocumentCacheReset(<a class="code" href="classDynamicContext.html">DynamicContext</a>* context)
<a name="l00119"></a>00119 : oldDC(const_cast&lt;DocumentCache*&gt;(context-&gt;getDocumentCache())),
<a name="l00120"></a>00120 context_ (context)
<a name="l00121"></a>00121 {
<a name="l00122"></a>00122 }
<a name="l00123"></a>00123
<a name="l00124"></a><a class="code" href="classAutoDocumentCacheReset.html#e09e539475cde761223c56de5f9b74bf">00124</a> ~AutoDocumentCacheReset()
<a name="l00125"></a>00125 {
<a name="l00126"></a>00126 context_-&gt;setDocumentCache(oldDC);
<a name="l00127"></a>00127 }
<a name="l00128"></a>00128
<a name="l00129"></a><a class="code" href="classAutoDocumentCacheReset.html#b5a50b8b1393ff16151f86806bb959d4">00129</a> DocumentCache *oldDC;
<a name="l00130"></a>00130
<a name="l00131"></a>00131 <span class="keyword">protected</span>:
<a name="l00132"></a><a class="code" href="classAutoDocumentCacheReset.html#f958239a0d69f253c1cfbafa2911063e">00132</a> <a class="code" href="classDynamicContext.html">DynamicContext</a>* context_;
<a name="l00133"></a>00133 };
<a name="l00134"></a>00134
<a name="l00135"></a><a class="code" href="classAutoVariableStoreReset.html">00135</a> <span class="keyword">class </span>XQILLA_API AutoVariableStoreReset
<a name="l00136"></a>00136 {
<a name="l00137"></a>00137 <span class="keyword">public</span>:
<a name="l00138"></a><a class="code" href="classAutoVariableStoreReset.html#23db674812c33e34be243c9e8919ea51">00138</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="l00139"></a>00139 {
<a name="l00140"></a>00140 _context = context;
<a name="l00141"></a>00141 _oldVarStore = _context-&gt;<a class="code" href="classDynamicContext.html#928be86b35facdcd0ae18faf9dc732d3">getVariableStore</a>();
<a name="l00142"></a>00142 <span class="keywordflow">if</span>(store)
<a name="l00143"></a>00143 _context-&gt;setVariableStore(store);
<a name="l00144"></a>00144 }
<a name="l00145"></a>00145
<a name="l00146"></a><a class="code" href="classAutoVariableStoreReset.html#93215d55189ab612323b6c76346ccb88">00146</a> ~AutoVariableStoreReset()
<a name="l00147"></a>00147 {
<a name="l00148"></a>00148 _context-&gt;setVariableStore(_oldVarStore);
<a name="l00149"></a>00149 }
<a name="l00150"></a>00150
<a name="l00151"></a><a class="code" href="classAutoVariableStoreReset.html#1aedc284d880dca82bc66763cf623960">00151</a> <span class="keywordtype">void</span> reset()
<a name="l00152"></a>00152 {
<a name="l00153"></a>00153 _context-&gt;setVariableStore(_oldVarStore);
<a name="l00154"></a>00154 }
<a name="l00155"></a>00155
<a name="l00156"></a>00156 <span class="keyword">protected</span>:
<a name="l00157"></a><a class="code" href="classAutoVariableStoreReset.html#c31f61e97449ef34e1b84d3ffee249fa">00157</a> <a class="code" href="classDynamicContext.html">DynamicContext</a> *_context;
<a name="l00158"></a><a class="code" href="classAutoVariableStoreReset.html#7951bfa91a8575a876a9ec569240a5ab">00158</a> <span class="keyword">const</span> <a class="code" href="classVariableStore.html">VariableStore</a> *_oldVarStore;
<a name="l00159"></a>00159
<a name="l00160"></a>00160 };
<a name="l00161"></a>00161
<a name="l00162"></a>00162 <span class="preprocessor">#endif</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Aug 31 14:37:35 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>