<HTML><HEAD><SCRIPT language="JavaScript" src="../resources/script.js" type="text/javascript"></SCRIPT><TITLE>Xerces-C++: PlatformUtils.hpp Source File</TITLE><link href="XercesApi.css" rel="stylesheet" type="text/css"></HEAD><BODY alink="#ff0000" bgcolor="#ffffff" leftmargin="4" link="#0000ff" marginheight="4" marginwidth="4" text="#000000" topmargin="4" vlink="#0000aa"><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD align="left" height="60" rowspan="3" valign="top" width="135"><IMG border="0" height="60" hspace="0" src="../resources/logo.gif" vspace="0" width="135"></TD><TD align="left" colspan="4" height="5" valign="top" width="456"><IMG border="0" height="5" hspace="0" src="../resources/line.gif" vspace="0" width="456"></TD><TD align="left" height="60" rowspan="3" valign="top" width="29"><IMG border="0" height="60" hspace="0" src="../resources/right.gif" vspace="0" width="29"></TD></TR><TR><TD align="left" bgcolor="#0086b2" colspan="4" height="35" valign="top" width="456"><IMG alt="" border="0" height="35" hspace="0" src="../graphics/api-header.jpg" vspace="0" width="456"></TD></TR><TR><TD align="left" height="20" valign="top" width="168"><IMG border="0" height="20" hspace="0" src="../resources/bottom.gif" vspace="0" width="168"></TD><TD align="left" height="20" valign="top" width="96"><A href="http://xml.apache.org/" onMouseOut="rolloverOff('xml');" onMouseOver="rolloverOn('xml');" target="new"><IMG alt="http://xml.apache.org/" border="0" height="20" hspace="0" name="xml" onLoad="rolloverLoad('xml','../resources/button-xml-hi.gif','../resources/button-xml-lo.gif');" src="../resources/button-xml-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href="http://www.apache.org/" onMouseOut="rolloverOff('asf');" onMouseOver="rolloverOn('asf');" target="new"><IMG alt="http://www.apache.org/" border="0" height="20" hspace="0" name="asf" onLoad="rolloverLoad('asf','../resources/button-asf-hi.gif','../resources/button-asf-lo.gif');" src="../resources/button-asf-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href="http://www.w3.org/" onMouseOut="rolloverOff('w3c');" onMouseOver="rolloverOn('w3c');" target="new"><IMG alt="http://www.w3.org/" border="0" height="20" hspace="0" name="w3c" onLoad="rolloverLoad('w3c','../resources/button-w3c-hi.gif','../resources/button-w3c-lo.gif');" src="../resources/button-w3c-lo.gif" vspace="0" width="96"></A></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD align="left" valign="top" width="120"><IMG border="0" height="14" hspace="0" src="../resources/join.gif" vspace="0" width="120"><BR> <A href="../../index.html" onMouseOut="rolloverOff('side-ext-2');" onMouseOver="rolloverOn('side-ext-2');"><IMG alt="Home" border="0" height="12" hspace="0" name="side-ext-2" onLoad="rolloverLoad('side-ext-2','../graphics/ext-2-label-2.jpg','../graphics/ext-2-label-3.jpg');" src="../graphics/ext-2-label-3.jpg" vspace="0" width="120"></A><BR> <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR> <A href="../index.html" onMouseOut="rolloverOff('side-index');" onMouseOver="rolloverOn('side-index');"><IMG alt="Readme" border="0" height="12" hspace="0" name="side-index" onLoad="rolloverLoad('side-index','../graphics/index-label-2.jpg','../graphics/index-label-3.jpg');" src="../graphics/index-label-3.jpg" vspace="0" width="120"></A><BR> <A href="../charter.html" onMouseOut="rolloverOff('side-charter');" onMouseOver="rolloverOn('side-charter');"><IMG alt="Charter" border="0" height="12" hspace="0" name="side-charter" onLoad="rolloverLoad('side-charter','../graphics/charter-label-2.jpg','../graphics/charter-label-3.jpg');" src="../graphics/charter-label-3.jpg" vspace="0" width="120"></A><BR> <A href="../releases.html" onMouseOut="rolloverOff('side-releases');" onMouseOver="rolloverOn('side-releases');"><IMG alt="Release Info" border="0" height="12" hspace="0" name="side-releases" onLoad="rolloverLoad('side-releases','../graphics/releases-label-2.jpg','../graphics/releases-label-3.jpg');" src="../graphics/releases-label-3.jpg" vspace="0" width="120"></A><BR> <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR> <A href="../install.html" onMouseOut="rolloverOff('side-install');" onMouseOver="rolloverOn('side-install');"><IMG alt="Installation" border="0" height="12" hspace="0" name="side-install" onLoad="rolloverLoad('side-install','../graphics/install-label-2.jpg','../graphics/install-label-3.jpg');" src="../graphics/install-label-3.jpg" vspace="0" width="120"></A><BR> <A href="http://xml.apache.org/xerces-c/download.cgi" onMouseOut="rolloverOff('side-ext-20');" onMouseOver="rolloverOn('side-ext-20');"><IMG alt="Download" border="0" height="12" hspace="0" name="side-ext-20" onLoad="rolloverLoad('side-ext-20','../graphics/ext-20-label-2.jpg','../graphics/ext-20-label-3.jpg');" src="../graphics/ext-20-label-3.jpg" vspace="0" width="120"></A><BR> <A href="../build.html" onMouseOut="rolloverOff('side-build');" onMouseOver="rolloverOn('side-build');"><IMG alt="Build Instructions" border="0" height="12" hspace="0" name="side-build" onLoad="rolloverLoad('side-build','../graphics/build-label-2.jpg','../graphics/build-label-3.jpg');" src="../graphics/build-label-3.jpg" vspace="0" width="120"></A><BR> <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR> <A href="../faqs.html" onMouseOut="rolloverOff('side-faqs');" onMouseOver="rolloverOn('side-faqs');"><IMG alt="FAQs" border="0" height="12" hspace="0" name="side-faqs" onLoad="rolloverLoad('side-faqs','../graphics/faqs-label-2.jpg','../graphics/faqs-label-3.jpg');" src="../graphics/faqs-label-3.jpg" vspace="0" width="120"></A><BR> <A href="../samples.html" onMouseOut="rolloverOff('side-samples');" onMouseOver="rolloverOn('side-samples');"><IMG alt="Samples" border="0" height="12" hspace="0" name="side-samples" onLoad="rolloverLoad('side-samples','../graphics/samples-label-2.jpg','../graphics/samples-label-3.jpg');" src="../graphics/samples-label-3.jpg" vspace="0" width="120"></A><BR> <A href="../api.html" onMouseOut="rolloverOff('side-api');" onMouseOver="rolloverOn('side-api');"><IMG alt="API Docs" border="0" height="12" hspace="0" name="side-api" onLoad="rolloverLoad('side-api','../graphics/api-label-2.jpg','../graphics/api-label-3.jpg');" src="../graphics/api-label-3.jpg" vspace="0" width="120"></A><BR> <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR> <A href="../ApacheDOMC++Binding.html" onMouseOut="rolloverOff('side-ext-70');" onMouseOver="rolloverOn('side-ext-70');"><IMG alt="DOM C++ Binding" border="0" height="12" hspace="0" name="side-ext-70" onLoad="rolloverLoad('side-ext-70','../graphics/ext-70-label-2.jpg','../graphics/ext-70-label-3.jpg');" src="../graphics/ext-70-label-3.jpg" vspace="0" width="120"></A><BR> <IMG alt="Programming" border="0" height="12" hspace="0" src="../graphics/program-label-1.jpg" vspace="0" width="120"><BR> <A href="../migrate.html" onMouseOut="rolloverOff('side-migrate');" onMouseOver="rolloverOn('side-migrate');"><IMG alt="Migration Guide" border="0" height="12" hspace="0" name="side-migrate" onLoad="rolloverLoad('side-migrate','../graphics/migrate-label-2.jpg','../graphics/migrate-label-3.jpg');" src="../graphics/migrate-label-3.jpg" vspace="0" width="120"></A><BR> <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR> <A href="../feedback.html" onMouseOut="rolloverOff('side-feedback');" onMouseOver="rolloverOn('side-feedback');"><IMG alt="Feedback" border="0" height="12" hspace="0" name="side-feedback" onLoad="rolloverLoad('side-feedback','../graphics/feedback-label-2.jpg','../graphics/feedback-label-3.jpg');" src="../graphics/feedback-label-3.jpg" vspace="0" width="120"></A><BR> <A href="bug-report.html" onMouseOut="rolloverOff('side-bug-report');" onMouseOver="rolloverOn('side-bug-report');"><IMG alt="Bug-Reporting" border="0" height="12" hspace="0" name="side-bug-report" onLoad="rolloverLoad('side-bug-report','../graphics/bug-report-label-2.jpg','../graphics/bug-report-label-3.jpg');" src="../graphics/bug-report-label-3.jpg" vspace="0" width="120"></A><BR> <A href="../pdf.html" onMouseOut="rolloverOff('side-pdf');" onMouseOver="rolloverOn('side-pdf');"><IMG alt="PDF Document" border="0" height="12" hspace="0" name="side-pdf" onLoad="rolloverLoad('side-pdf','../graphics/pdf-label-2.jpg','../graphics/pdf-label-3.jpg');" src="../graphics/pdf-label-3.jpg" vspace="0" width="120"></A><BR> <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR> <A href="http://svn.apache.org/viewcvs.cgi/xerces/?root=Apache-SVN" onMouseOut="rolloverOff('side-ext-102');" onMouseOver="rolloverOn('side-ext-102');"><IMG alt="Source Repository" border="0" height="12" hspace="0" name="side-ext-102" onLoad="rolloverLoad('side-ext-102','../graphics/ext-102-label-2.jpg','../graphics/ext-102-label-3.jpg');" src="../graphics/ext-102-label-3.jpg" vspace="0" width="120"></A><BR> <A href="http://marc.theaimsgroup.com/?l=xerces-c-users" onMouseOut="rolloverOff('side-ext-104');" onMouseOver="rolloverOn('side-ext-104');"><IMG alt="User Mail Archive" border="0" height="12" hspace="0" name="side-ext-104" onLoad="rolloverLoad('side-ext-104','../graphics/ext-104-label-2.jpg','../graphics/ext-104-label-3.jpg');" src="../graphics/ext-104-label-3.jpg" vspace="0" width="120"></A><BR> <A href="http://marc.theaimsgroup.com/?l=xerces-c-dev" onMouseOut="rolloverOff('side-ext-106');" onMouseOver="rolloverOn('side-ext-106');"><IMG alt="Devel Mail Archive" border="0" height="12" hspace="0" name="side-ext-106" onLoad="rolloverLoad('side-ext-106','../graphics/ext-106-label-2.jpg','../graphics/ext-106-label-3.jpg');" src="../graphics/ext-106-label-3.jpg" vspace="0" width="120"></A><BR> <IMG border="0" height="14" hspace="0" src="../resources/close.gif" vspace="0" width="120"><BR></TD><TD align="left" valign="top" width="500"><TABLE border="0" cellpadding="3" cellspacing="0"><TR><TD> <TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#FFFFFF" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="../resources/void.gif" vspace="0" width="2"><B>API Docs for SAX and DOM</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif"> <P> <!-- Generated by Doxygen 1.4.1 --> <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <div class="nav"> <a class="el" href="dir_000000.html">src</a> / <a class="el" href="dir_000001.html">xercesc</a> / <a class="el" href="dir_000003.html">util</a></div> <h1>PlatformUtils.hpp</h1><a href="PlatformUtils_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/*</span> 00002 <span class="comment"> * Copyright 1999-2004 The Apache Software Foundation.</span> 00003 <span class="comment"> * </span> 00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span> 00005 <span class="comment"> * you may not use this file except in compliance with the License.</span> 00006 <span class="comment"> * You may obtain a copy of the License at</span> 00007 <span class="comment"> * </span> 00008 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span> 00009 <span class="comment"> * </span> 00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span> 00011 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span> 00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span> 00013 <span class="comment"> * See the License for the specific language governing permissions and</span> 00014 <span class="comment"> * limitations under the License.</span> 00015 <span class="comment"> */</span> 00016 00017 <span class="comment">/*</span> 00018 <span class="comment"> * $Id: PlatformUtils.hpp 180016 2005-06-04 19:49:30Z jberry $</span> 00019 <span class="comment"> */</span> 00020 00021 00022 <span class="preprocessor">#if !defined(PLATFORMUTILS_HPP)</span> <a name="l00023"></a><a class="code" href="PlatformUtils_8hpp.html#a0">00023</a> <span class="preprocessor"></span><span class="preprocessor">#define PLATFORMUTILS_HPP</span> 00024 <span class="preprocessor"></span> 00025 <span class="preprocessor">#include <<a class="code" href="XMLException_8hpp.html">xercesc/util/XMLException.hpp</a>></span> 00026 <span class="preprocessor">#include <<a class="code" href="PanicHandler_8hpp.html">xercesc/util/PanicHandler.hpp</a>></span> 00027 00028 <a class="code" href="XercesDefs_8hpp.html#a3">XERCES_CPP_NAMESPACE_BEGIN</a> 00029 00030 <span class="keyword">class </span>XMLMsgLoader; 00031 <span class="keyword">class </span><a class="code" href="classXMLNetAccessor.html">XMLNetAccessor</a>; 00032 <span class="keyword">class </span><a class="code" href="classXMLTransService.html">XMLTransService</a>; 00033 <span class="keyword">class </span><a class="code" href="classMemoryManager.html">MemoryManager</a>; 00034 <span class="keyword">class </span>XMLMutex; 00035 00036 <span class="comment">//</span> 00037 <span class="comment">// For internal use only</span> 00038 <span class="comment">//</span> 00039 <span class="comment">// This class provides a simple abstract API via which lazily evaluated</span> 00040 <span class="comment">// data can be cleaned up.</span> 00041 <span class="comment">//</span> <a name="l00042"></a><a class="code" href="classXMLDeleter.html">00042</a> <span class="keyword">class </span><a class="code" href="XercesDefs_8hpp.html#a9"></a> XMLDeleter 00043 { 00044 <span class="keyword">public</span> : 00045 <span class="keyword">virtual</span> ~XMLDeleter(); 00046 00047 <span class="keyword">protected</span> : 00048 XMLDeleter(); 00049 00050 <span class="keyword">private</span> : 00051 XMLDeleter(<span class="keyword">const</span> XMLDeleter&); 00052 XMLDeleter& operator=(<span class="keyword">const</span> XMLDeleter&); 00053 }; 00054 00055 <a name="l00064"></a><a class="code" href="classXMLPlatformUtils.html">00064</a> <span class="keyword">class </span><a class="code" href="XercesDefs_8hpp.html#a9"></a> XMLPlatformUtils 00065 { 00066 <span class="keyword">public</span> : 00067 00070 <a name="l00083"></a><a class="code" href="classXMLPlatformUtils.html#z941_0">00083</a> <span class="keyword">static</span> <a class="code" href="classXMLNetAccessor.html">XMLNetAccessor</a>* fgNetAccessor; 00084 <a name="l00095"></a><a class="code" href="classXMLPlatformUtils.html#z941_1">00095</a> <span class="keyword">static</span> <a class="code" href="classXMLTransService.html">XMLTransService</a>* fgTransService; 00096 <a name="l00101"></a><a class="code" href="classXMLPlatformUtils.html#z941_2">00101</a> <span class="keyword">static</span> <a class="code" href="classPanicHandler.html">PanicHandler</a>* fgUserPanicHandler; 00102 <a name="l00107"></a><a class="code" href="classXMLPlatformUtils.html#z941_3">00107</a> <span class="keyword">static</span> <a class="code" href="classPanicHandler.html">PanicHandler</a>* fgDefaultPanicHandler; 00108 <a name="l00114"></a><a class="code" href="classXMLPlatformUtils.html#z941_4">00114</a> <span class="keyword">static</span> <a class="code" href="classMemoryManager.html">MemoryManager</a>* fgMemoryManager; 00115 <a name="l00124"></a><a class="code" href="classXMLPlatformUtils.html#z941_5">00124</a> <span class="keyword">static</span> <a class="code" href="classMemoryManager.html">MemoryManager</a>* fgArrayMemoryManager; 00125 <a name="l00126"></a><a class="code" href="classXMLPlatformUtils.html#z941_6">00126</a> <span class="keyword">static</span> XMLMutex* fgAtomicMutex; 00127 00129 00130 00133 00164 <span class="keyword">static</span> <span class="keywordtype">void</span> Initialize(<span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> locale = XMLUni::fgXercescDefaultLocale 00165 , <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> nlsHome = 0 00166 , <a class="code" href="classPanicHandler.html">PanicHandler</a>* <span class="keyword">const</span> panicHandler = 0 00167 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> memoryManager = 0 00168 , <span class="keywordtype">bool</span> toInitStatics = <span class="keyword">false</span>); 00169 00176 <span class="keyword">static</span> <span class="keywordtype">void</span> Terminate(); 00177 00194 <span class="keyword">static</span> <span class="keywordtype">void</span> panic 00195 ( 00196 <span class="keyword">const</span> PanicHandler::PanicReasons reason 00197 ); 00198 00200 00203 00217 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> curFilePos(FileHandle theFile 00218 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager); 00219 00230 <span class="keyword">static</span> <span class="keywordtype">void</span> closeFile(FileHandle theFile 00231 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager); 00232 00243 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> fileSize(FileHandle theFile 00244 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager); 00245 00256 <span class="keyword">static</span> FileHandle openFile(<span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> fileName 00257 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager); 00258 00269 <span class="keyword">static</span> FileHandle openFile(<span class="keyword">const</span> XMLCh* <span class="keyword">const</span> fileName 00270 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager); 00271 00282 <span class="keyword">static</span> FileHandle openFileToWrite(<span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> fileName 00283 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager); 00284 00295 <span class="keyword">static</span> FileHandle openFileToWrite(<span class="keyword">const</span> XMLCh* <span class="keyword">const</span> fileName 00296 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager); 00297 00308 <span class="keyword">static</span> FileHandle openStdInHandle(<a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager); 00309 00326 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> readFileBuffer 00327 ( 00328 FileHandle theFile 00329 , <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> toRead 00330 , <a class="code" href="XercesDefs_8hpp.html#a17">XMLByte</a>* <span class="keyword">const</span> toFill 00331 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = <a class="code" href="classXMLPlatformUtils.html#z941_4">XMLPlatformUtils::fgMemoryManager</a> 00332 ); 00333 00348 <span class="keyword">static</span> <span class="keywordtype">void</span> writeBufferToFile 00349 ( 00350 FileHandle <span class="keyword">const</span> theFile 00351 , <span class="keywordtype">long</span> toWrite 00352 , <span class="keyword">const</span> <a class="code" href="XercesDefs_8hpp.html#a17">XMLByte</a>* <span class="keyword">const</span> toFlush 00353 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = <a class="code" href="classXMLPlatformUtils.html#z941_4">XMLPlatformUtils::fgMemoryManager</a> 00354 ); 00355 00365 <span class="keyword">static</span> <span class="keywordtype">void</span> resetFile(FileHandle theFile 00366 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager); 00367 00369 00370 00394 <span class="keyword">static</span> XMLCh* getFullPath 00395 ( 00396 <span class="keyword">const</span> XMLCh* <span class="keyword">const</span> srcPath 00397 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = <a class="code" href="classXMLPlatformUtils.html#z941_4">XMLPlatformUtils::fgMemoryManager</a> 00398 ); 00399 00413 <span class="keyword">static</span> XMLCh* getCurrentDirectory 00414 ( 00415 <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = <a class="code" href="classXMLPlatformUtils.html#z941_4">XMLPlatformUtils::fgMemoryManager</a> 00416 ); 00417 00427 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> isAnySlash(XMLCh c); 00428 00438 <span class="keyword">static</span> <span class="keywordtype">void</span> removeDotSlash(XMLCh* <span class="keyword">const</span> srcPath 00439 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager); 00440 00451 <span class="keyword">static</span> <span class="keywordtype">void</span> removeDotDotSlash(XMLCh* <span class="keyword">const</span> srcPath 00452 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager); 00453 00467 <span class="keyword">static</span> <span class="keywordtype">bool</span> isRelative(<span class="keyword">const</span> XMLCh* <span class="keyword">const</span> toCheck 00468 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager 00469 ); 00470 00490 <span class="keyword">static</span> XMLCh* weavePaths 00491 ( 00492 <span class="keyword">const</span> XMLCh* <span class="keyword">const</span> basePath 00493 , <span class="keyword">const</span> XMLCh* <span class="keyword">const</span> relativePath 00494 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = <a class="code" href="classXMLPlatformUtils.html#z941_4">XMLPlatformUtils::fgMemoryManager</a> 00495 ); 00497 00500 00510 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> getCurrentMillis(); 00512 00515 00523 <span class="keyword">static</span> <span class="keywordtype">void</span> closeMutex(<span class="keywordtype">void</span>* <span class="keyword">const</span> mtxHandle); 00524 00532 <span class="keyword">static</span> <span class="keywordtype">void</span> lockMutex(<span class="keywordtype">void</span>* <span class="keyword">const</span> mtxHandle); 00533 00543 <span class="keyword">static</span> <span class="keywordtype">void</span>* makeMutex(<a class="code" href="classMemoryManager.html">MemoryManager</a>* manager = XMLPlatformUtils::fgMemoryManager); 00544 00557 <span class="keyword">static</span> <span class="keywordtype">void</span> unlockMutex(<span class="keywordtype">void</span>* <span class="keyword">const</span> mtxHandle); 00558 00560 00561 00564 00572 <span class="keyword">static</span> XMLMsgLoader* loadMsgSet(<span class="keyword">const</span> XMLCh* <span class="keyword">const</span> msgDomain); 00573 00575 00578 00604 <span class="keyword">static</span> <span class="keywordtype">void</span>* compareAndSwap 00605 ( 00606 <span class="keywordtype">void</span>** toFill 00607 , <span class="keyword">const</span> <span class="keywordtype">void</span>* <span class="keyword">const</span> newValue 00608 , <span class="keyword">const</span> <span class="keywordtype">void</span>* <span class="keyword">const</span> toCompare 00609 ); 00610 00612 00613 00616 00636 <span class="keyword">static</span> <span class="keywordtype">int</span> atomicIncrement(<span class="keywordtype">int</span>& location); 00637 00657 <span class="keyword">static</span> <span class="keywordtype">int</span> atomicDecrement(<span class="keywordtype">int</span>& location); 00658 00660 00674 <span class="keyword">static</span> <span class="keywordtype">void</span> recognizeNEL(<span class="keywordtype">bool</span> state 00675 , <a class="code" href="classMemoryManager.html">MemoryManager</a>* <span class="keyword">const</span> manager = XMLPlatformUtils::fgMemoryManager); 00676 00680 <span class="keyword">static</span> <span class="keywordtype">bool</span> isNELRecognized(); 00682 00694 <span class="keyword">static</span> <span class="keywordtype">void</span> strictIANAEncoding(<span class="keyword">const</span> <span class="keywordtype">bool</span> state); 00695 00700 <span class="keyword">static</span> <span class="keywordtype">bool</span> isStrictIANAEncoding(); 00702 00710 <span class="keyword">static</span> <span class="keyword">inline</span> size_t alignPointerForNewBlockAllocation(size_t ptrSize); 00711 00712 <span class="keyword">private</span> : 00713 <span class="comment">// -----------------------------------------------------------------------</span> 00714 <span class="comment">// Unimplemented constructors and operators</span> 00715 <span class="comment">// -----------------------------------------------------------------------</span> 00716 XMLPlatformUtils(); 00717 00720 00726 <span class="keyword">static</span> XMLMsgLoader* loadAMsgSet(<span class="keyword">const</span> XMLCh* <span class="keyword">const</span> msgDomain); 00727 00737 <span class="keyword">static</span> <a class="code" href="classXMLNetAccessor.html">XMLNetAccessor</a>* makeNetAccessor(); 00738 00749 <span class="keyword">static</span> <a class="code" href="classXMLTransService.html">XMLTransService</a>* makeTransService(); 00750 00757 <span class="keyword">static</span> <span class="keywordtype">void</span> platformInit(); 00758 00765 <span class="keyword">static</span> <span class="keywordtype">void</span> platformTerm(); 00766 00774 <span class="keyword">static</span> <span class="keywordtype">int</span> searchSlashDotDotSlash(XMLCh* <span class="keyword">const</span> srcPath); 00775 00777 00780 00787 <span class="keyword">static</span> <span class="keywordtype">bool</span> fgMemMgrAdopted; 00788 00790 }; 00791 00792 <a name="l00793"></a><a class="code" href="PlatformUtils_8hpp.html#a1">00793</a> <a class="code" href="XMLException_8hpp.html#a1">MakeXMLException</a>(XMLPlatformUtilsException, ) 00794 00795 00796 <span class="comment">// ---------------------------------------------------------------------------</span> 00797 <span class="comment">// XMLPlatformUtils: alignPointerForNewBlockAllocation</span> 00798 <span class="comment">// ---------------------------------------------------------------------------</span> 00799 <span class="comment">// Calculate alignment required by platform for a new</span> 00800 <span class="comment">// block allocation. We use this in our custom allocators</span> 00801 <span class="comment">// to ensure that returned blocks are properly aligned.</span> 00802 <span class="comment">// Note that, although this will take a pointer and return the position</span> 00803 <span class="comment">// at which it should be placed for correct alignment, in our code</span> 00804 <span class="comment">// we normally use size_t parameters to discover what the alignment</span> 00805 <span class="comment">// of header blocks should be. Thus, if this is to be</span> 00806 <span class="comment">// used for the former purpose, to make compilers happy</span> 00807 <span class="comment">// some casting will be necessary - neilg.</span> 00808 <span class="comment">//</span> 00809 <span class="comment">// Note: XML_PLATFORM_NEW_BLOCK_ALIGNMENT may be specified on a</span> 00810 <span class="comment">// per-architecture basis to dictate the alignment requirements</span> 00811 <span class="comment">// of the architecture. In the absense of this specification,</span> 00812 <span class="comment">// this routine guesses at the correct alignment value.</span> 00813 <span class="comment">//</span> 00814 <span class="comment">// A XML_PLATFORM_NEW_BLOCK_ALIGNMENT value of zero is illegal.</span> 00815 <span class="comment">// If a platform requires absolutely no alignment, a value</span> 00816 <span class="comment">// of 1 should be specified ("align pointers on 1 byte boundaries").</span> 00817 <span class="comment">//</span> 00818 inline size_t 00819 XMLPlatformUtils::alignPointerForNewBlockAllocation(size_t ptrSize) 00820 { 00821 <span class="comment">// Macro XML_PLATFORM_NEW_BLOCK_ALIGNMENT may be defined</span> 00822 <span class="comment">// as needed to dictate alignment requirements on a</span> 00823 <span class="comment">// per-architecture basis. In the absense of that we</span> 00824 <span class="comment">// take an educated guess.</span> 00825 <span class="preprocessor"> #ifdef XML_PLATFORM_NEW_BLOCK_ALIGNMENT</span> 00826 <span class="preprocessor"></span> size_t alignment = XML_PLATFORM_NEW_BLOCK_ALIGNMENT; 00827 <span class="preprocessor"> #else</span> 00828 <span class="preprocessor"></span> size_t alignment = (<span class="keyword">sizeof</span>(<span class="keywordtype">void</span>*) >= <span class="keyword">sizeof</span>(double)) ? <span class="keyword">sizeof</span>(<span class="keywordtype">void</span>*) : <span class="keyword">sizeof</span>(double); 00829 <span class="preprocessor"> #endif</span> 00830 <span class="preprocessor"></span> 00831 <span class="comment">// Calculate current alignment of pointer</span> 00832 size_t current = ptrSize % alignment; 00833 00834 <span class="comment">// Adjust pointer alignment as needed</span> 00835 <span class="keywordflow">return</span> (current == 0) 00836 ? ptrSize 00837 : (ptrSize + alignment - current); 00838 } 00839 00840 00841 00842 <span class="comment">// ---------------------------------------------------------------------------</span> 00843 <span class="comment">// XMLDeleter: Public Destructor</span> 00844 <span class="comment">// ---------------------------------------------------------------------------</span> <a name="l00845"></a><a class="code" href="classXMLDeleter.html#a0">00845</a> <span class="keyword">inline</span> <a class="code" href="classXMLDeleter.html#a0">XMLDeleter::~XMLDeleter</a>() 00846 { 00847 } 00848 00849 <span class="comment">// ---------------------------------------------------------------------------</span> 00850 <span class="comment">// XMLDeleter: Hidden constructors and operators</span> 00851 <span class="comment">// ---------------------------------------------------------------------------</span> <a name="l00852"></a><a class="code" href="classXMLDeleter.html#b0">00852</a> <span class="keyword">inline</span> <a class="code" href="classXMLDeleter.html#b0">XMLDeleter::XMLDeleter</a>() 00853 { 00854 } 00855 00856 <a class="code" href="XercesDefs_8hpp.html#a4">XERCES_CPP_NAMESPACE_END</a> 00857 00858 <span class="preprocessor">#endif</span> </pre></div> </FONT></TD></TR></TABLE><BR> </TD></TR></TABLE></TD></TR></TABLE><BR><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD bgcolor="#0086b2"><IMG height="1" src="images/dot.gif" width="1" alt=""></TD></TR><TR><TD align="center"><FONT color="#0086b2" size="-1"><I> Copyright © 1994-2004 The Apache Software Foundation. All Rights Reserved. </I></FONT></TD></TR></TABLE></BODY></HTML>