source: NonGTP/Xerces/xerces/doc/html/apiDocs/XMLDateTime_8hpp-source.html @ 358

Revision 358, 43.4 KB checked in by bittner, 19 years ago (diff)

xerces added

Line 
1<HTML><HEAD><SCRIPT language="JavaScript" src="../resources/script.js" type="text/javascript"></SCRIPT><TITLE>XMLDateTime.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>
2  <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>
3
4  <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
5
6  <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>
7  <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>
8  <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
9  <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>
10  <A href="http://xml.apache.org/dist/xerces-c/" onMouseOut="rolloverOff('side-ext-18');" onMouseOver="rolloverOn('side-ext-18');"><IMG alt="Download" border="0" height="12" hspace="0" name="side-ext-18" onLoad="rolloverLoad('side-ext-18','../graphics/ext-18-label-2.jpg','../graphics/ext-18-label-3.jpg');" src="../graphics/ext-18-label-3.jpg" vspace="0" width="120"></A><BR>
11  <A href="../build.html" onMouseOut="rolloverOff('side-build');" onMouseOver="rolloverOn('side-build');"><IMG alt="Build" 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>
12
13  <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
14  <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> 
15  <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>
16  <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> 
17
18  <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR> 
19  <A href="../ApacheDOMC++Binding.html" onMouseOut="rolloverOff('side-ext-68');" onMouseOver="rolloverOn('side-ext-68');"><IMG alt="DOM C++ Binding" border="0" height="12" hspace="0" name="side-ext-68" onLoad="rolloverLoad('side-ext-68','../graphics/ext-68-label-2.jpg','../graphics/ext-68-label-3.jpg');" src="../graphics/ext-68-label-3.jpg" vspace="0" width="120"></A><BR>
20
21  <A href="../program.html" onMouseOut="rolloverOff('side-program');" onMouseOver="rolloverOn('side-program');"><IMG alt="Programming" border="0" height="12" hspace="0" name="side-program" onLoad="rolloverLoad('side-program','../graphics/program-label-2.jpg','../graphics/program-label-3.jpg');" src="../graphics/program-label-3.jpg" vspace="0" width="120"></A><BR>
22  <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>
23
24  <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
25
26  <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>
27  <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> 
28  <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>
29
30  <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
31
32  <A href="http://xml.apache.org/websrc/cvsweb.cgi/xml-xerces/c/" onMouseOut="rolloverOff('side-ext-100');" onMouseOver="rolloverOn('side-ext-100');"><IMG alt="CVS Repository" border="0" height="12" hspace="0" name="side-ext-100" onLoad="rolloverLoad('side-ext-100','../graphics/ext-100-label-2.jpg','../graphics/ext-100-label-3.jpg');" src="../graphics/ext-100-label-3.jpg" vspace="0" width="120"></A><BR>
33
34  <A href="http://marc.theaimsgroup.com/?l=xerces-c-dev" onMouseOut="rolloverOff('side-ext-102');" onMouseOver="rolloverOn('side-ext-102');"><IMG alt="Mail Archive" 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>
35
36
37<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>
38    <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">&nbsp;</TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
39
40            <P>
41<!-- Generated by Doxygen 1.2.14 -->
42<center>
43<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
44<hr><h1>XMLDateTime.hpp</h1><a href="XMLDateTime_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/*</font>
4500002 <font class="comment"> * Copyright 2001,2004 The Apache Software Foundation.</font>
4600003 <font class="comment"> * </font>
4700004 <font class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</font>
4800005 <font class="comment"> * you may not use this file except in compliance with the License.</font>
4900006 <font class="comment"> * You may obtain a copy of the License at</font>
5000007 <font class="comment"> * </font>
5100008 <font class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</font>
5200009 <font class="comment"> * </font>
5300010 <font class="comment"> * Unless required by applicable law or agreed to in writing, software</font>
5400011 <font class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</font>
5500012 <font class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</font>
5600013 <font class="comment"> * See the License for the specific language governing permissions and</font>
5700014 <font class="comment"> * limitations under the License.</font>
5800015 <font class="comment"> */</font>
5900016
6000017 <font class="comment">/*</font>
6100018 <font class="comment"> * $Id: XMLDateTime.hpp,v 1.20 2004/09/08 13:56:24 peiyongz Exp $</font>
6200019 <font class="comment"> * $Log: XMLDateTime.hpp,v $</font>
6300020 <font class="comment"> * Revision 1.20  2004/09/08 13:56:24  peiyongz</font>
6400021 <font class="comment"> * Apache License Version 2.0</font>
6500022 <font class="comment"> *</font>
6600023 <font class="comment"> * Revision 1.19  2004/08/31 20:50:50  peiyongz</font>
6700024 <font class="comment"> * Parse/keep milisecond as double to retain precision.</font>
6800025 <font class="comment"> *</font>
6900026 <font class="comment"> * Revision 1.18  2004/08/11 16:48:55  peiyongz</font>
7000027 <font class="comment"> * Allow XSValue access</font>
7100028 <font class="comment"> *</font>
7200029 <font class="comment"> * Revision 1.17  2004/01/29 11:48:47  cargilld</font>
7300030 <font class="comment"> * Code cleanup changes to get rid of various compiler diagnostic messages.</font>
7400031 <font class="comment"> *</font>
7500032 <font class="comment"> * Revision 1.16  2004/01/13 19:50:56  peiyongz</font>
7600033 <font class="comment"> * remove parseContent()</font>
7700034 <font class="comment"> *</font>
7800035 <font class="comment"> * Revision 1.14  2003/12/31 02:34:11  neilg</font>
7900036 <font class="comment"> * enable production of canonical representations for dates with negative years, or years &gt;9999</font>
8000037 <font class="comment"> *</font>
8100038 <font class="comment"> * Revision 1.13  2003/12/17 20:00:49  cargilld</font>
8200039 <font class="comment"> * Update for memory management so that the static memory manager (one</font>
8300040 <font class="comment"> * used to call Initialize) is only for static data.</font>
8400041 <font class="comment"> *</font>
8500042 <font class="comment"> * Revision 1.12  2003/12/17 00:18:35  cargilld</font>
8600043 <font class="comment"> * Update to memory management so that the static memory manager (one used to call Initialize) is only for static data.</font>
8700044 <font class="comment"> *</font>
8800045 <font class="comment"> * Revision 1.11  2003/12/11 21:38:12  peiyongz</font>
8900046 <font class="comment"> * support for Canonical Representation for Datatype</font>
9000047 <font class="comment"> *</font>
9100048 <font class="comment"> * Revision 1.10  2003/09/23 18:16:07  peiyongz</font>
9200049 <font class="comment"> * Inplementation for Serialization/Deserialization</font>
9300050 <font class="comment"> *</font>
9400051 <font class="comment"> * Revision 1.9  2003/08/14 02:57:27  knoaman</font>
9500052 <font class="comment"> * Code refactoring to improve performance of validation.</font>
9600053 <font class="comment"> *</font>
9700054 <font class="comment"> * Revision 1.8  2003/05/18 14:02:05  knoaman</font>
9800055 <font class="comment"> * Memory manager implementation: pass per instance manager.</font>
9900056 <font class="comment"> *</font>
10000057 <font class="comment"> * Revision 1.7  2003/05/15 19:07:46  knoaman</font>
10100058 <font class="comment"> * Partial implementation of the configurable memory manager.</font>
10200059 <font class="comment"> *</font>
10300060 <font class="comment"> * Revision 1.6  2003/05/09 15:13:46  peiyongz</font>
10400061 <font class="comment"> * Deprecated toString() in XMLNumber family</font>
10500062 <font class="comment"> *</font>
10600063 <font class="comment"> * Revision 1.5  2003/03/10 20:55:58  peiyongz</font>
10700064 <font class="comment"> * Schema Errata E2-40 double/float</font>
10800065 <font class="comment"> *</font>
10900066 <font class="comment"> * Revision 1.4  2003/02/02 23:54:43  peiyongz</font>
11000067 <font class="comment"> * getFormattedString() added to return original and converted value.</font>
11100068 <font class="comment"> *</font>
11200069 <font class="comment"> * Revision 1.3  2003/01/30 21:55:22  tng</font>
11300070 <font class="comment"> * Performance: create getRawData which is similar to toString but return the internal data directly, user is not required to delete the returned memory.</font>
11400071 <font class="comment"> *</font>
11500072 <font class="comment"> * Revision 1.2  2002/11/04 15:22:05  tng</font>
11600073 <font class="comment"> * C++ Namespace Support.</font>
11700074 <font class="comment"> *</font>
11800075 <font class="comment"> * Revision 1.1.1.1  2002/02/01 22:22:14  peiyongz</font>
11900076 <font class="comment"> * sane_include</font>
12000077 <font class="comment"> *</font>
12100078 <font class="comment"> * Revision 1.4  2001/11/22 20:23:00  peiyongz</font>
12200079 <font class="comment"> * _declspec(dllimport) and inline warning C4273</font>
12300080 <font class="comment"> *</font>
12400081 <font class="comment"> * Revision 1.3  2001/11/12 20:36:54  peiyongz</font>
12500082 <font class="comment"> * SchemaDateTimeException defined</font>
12600083 <font class="comment"> *</font>
12700084 <font class="comment"> * Revision 1.2  2001/11/09 20:41:45  peiyongz</font>
12800085 <font class="comment"> * Fix: compilation error on Solaris and AIX.</font>
12900086 <font class="comment"> *</font>
13000087 <font class="comment"> * Revision 1.1  2001/11/07 19:16:03  peiyongz</font>
13100088 <font class="comment"> * DateTime Port</font>
13200089 <font class="comment"> *</font>
13300090 <font class="comment"> */</font>
13400091
13500092 <font class="preprocessor">#ifndef XML_DATETIME_HPP</font>
13600093 <font class="preprocessor"></font><font class="preprocessor">#define XML_DATETIME_HPP</font>
13700094 <font class="preprocessor"></font>
13800095 <font class="preprocessor">#include &lt;<a class="code" href="XMLNumber_8hpp.html">xercesc/util/XMLNumber.hpp</a>&gt;</font>
13900096 <font class="preprocessor">#include &lt;<a class="code" href="PlatformUtils_8hpp.html">xercesc/util/PlatformUtils.hpp</a>&gt;</font>
14000097 <font class="preprocessor">#include &lt;<a class="code" href="XMLString_8hpp.html">xercesc/util/XMLString.hpp</a>&gt;</font>
14100098 <font class="preprocessor">#include &lt;<a class="code" href="XMLUniDefs_8hpp.html">xercesc/util/XMLUniDefs.hpp</a>&gt;</font>
14200099 <font class="preprocessor">#include &lt;<a class="code" href="SchemaDateTimeException_8hpp.html">xercesc/util/SchemaDateTimeException.hpp</a>&gt;</font>
14300100
14400101 <a class="code" href="XercesDefs_8hpp.html#a2">XERCES_CPP_NAMESPACE_BEGIN</a>
14500102
146<a name="l00103"></a><a class="code" href="XMLDateTime_8hpp.html#a0">00103</a> <font class="keyword">class </font><a class="code" href="classXSValue.html">XSValue</a>;
14700104
148<a name="l00105"></a><a class="code" href="classXMLDateTime.html">00105</a> <font class="keyword">class </font><a class="code" href="XercesDefs_8hpp.html#a8"></a> <a class="code" href="classXMLDateTime.html">XMLDateTime</a> : <font class="keyword">public</font> <a class="code" href="classXMLNumber.html">XMLNumber</a>
14900106 {
15000107 <font class="keyword">public</font>:
15100108
152<a name="l00109"></a><a class="code" href="classXMLDateTime.html#s13">00109</a>     <font class="keyword">enum</font> valueIndex
15300110     {
15400111         CentYear   = 0,
15500112         Month      ,
15600113         Day        ,
15700114         Hour       ,
15800115         Minute     ,
15900116         Second     ,
16000117         MiliSecond ,  <font class="comment">//not to be used directly</font>
16100118         utc        ,
16200119         TOTAL_SIZE
16300120     };
16400121
165<a name="l00122"></a><a class="code" href="classXMLDateTime.html#s14">00122</a>     <font class="keyword">enum</font> utcType
16600123     {
16700124         UTC_UNKNOWN = 0,
16800125         UTC_STD        ,          <font class="comment">// set in parse() or normalize()</font>
16900126         UTC_POS        ,          <font class="comment">// set in parse()</font>
17000127         UTC_NEG                   <font class="comment">// set in parse()</font>
17100128     };
17200129
17300130     <font class="comment">// -----------------------------------------------------------------------</font>
17400131     <font class="comment">// ctors and dtor</font>
17500132     <font class="comment">// -----------------------------------------------------------------------</font>
17600133
17700134     <a class="code" href="classXMLDateTime.html">XMLDateTime</a>(<a class="code" href="classMemoryManager.html">MemoryManager</a>* <font class="keyword">const</font> manager = <a class="code" href="classXMLPlatformUtils.html#z488_4">XMLPlatformUtils::fgMemoryManager</a>);
17800135     <a class="code" href="classXMLDateTime.html">XMLDateTime</a>(<font class="keyword">const</font> XMLCh* <font class="keyword">const</font>,
17900136                 <a class="code" href="classMemoryManager.html">MemoryManager</a>* <font class="keyword">const</font> manager = <a class="code" href="classXMLPlatformUtils.html#z488_4">XMLPlatformUtils::fgMemoryManager</a>);
18000137     ~<a class="code" href="classXMLDateTime.html">XMLDateTime</a>();
18100138
18200139     <font class="keyword">inline</font> <font class="keywordtype">void</font>           setBuffer(<font class="keyword">const</font> XMLCh* <font class="keyword">const</font>);
18300140
18400141     <font class="comment">// -----------------------------------------------------------------------</font>
18500142     <font class="comment">// Copy ctor and Assignment operators</font>
18600143     <font class="comment">// -----------------------------------------------------------------------</font>
18700144
18800145     <a class="code" href="classXMLDateTime.html">XMLDateTime</a>(<font class="keyword">const</font> <a class="code" href="classXMLDateTime.html">XMLDateTime</a>&amp;);
18900146
19000147     <a class="code" href="classXMLDateTime.html">XMLDateTime</a>&amp;          operator=(<font class="keyword">const</font> <a class="code" href="classXMLDateTime.html">XMLDateTime</a>&amp;);
19100148
19200149     <font class="comment">// -----------------------------------------------------------------------</font>
19300150     <font class="comment">// Implementation of Abstract Interface</font>
19400151     <font class="comment">// -----------------------------------------------------------------------</font>
19500152
19600158     <font class="keyword">virtual</font> XMLCh*        <a class="code" href="classXMLNumber.html#a1">toString</a>() <font class="keyword">const</font>;
19700159     
19800160     <font class="keyword">virtual</font> XMLCh*        <a class="code" href="classXMLNumber.html#a2">getRawData</a>() <font class="keyword">const</font>;
19900161
20000162     <font class="keyword">virtual</font> <font class="keyword">const</font> XMLCh*  <a class="code" href="classXMLNumber.html#a3">getFormattedString</a>() <font class="keyword">const</font>;
20100163
20200164     <font class="keyword">virtual</font> <font class="keywordtype">int</font>           <a class="code" href="classXMLNumber.html#a4">getSign</a>() <font class="keyword">const</font>;
20300165
20400166     <font class="comment">// -----------------------------------------------------------------------</font>
20500167     <font class="comment">// Canonical Representation</font>
20600168     <font class="comment">// -----------------------------------------------------------------------</font>
20700169
20800170     XMLCh*                getDateTimeCanonicalRepresentation(<a class="code" href="classMemoryManager.html">MemoryManager</a>* <font class="keyword">const</font> memMgr) <font class="keyword">const</font>;
20900171
21000172     XMLCh*                getTimeCanonicalRepresentation(<a class="code" href="classMemoryManager.html">MemoryManager</a>* <font class="keyword">const</font> memMgr)     <font class="keyword">const</font>;
21100173
21200174     <font class="comment">// -----------------------------------------------------------------------</font>
21300175     <font class="comment">// parsers</font>
21400176     <font class="comment">// -----------------------------------------------------------------------</font>
21500177
21600178     <font class="keywordtype">void</font>                  parseDateTime();       <font class="comment">//DateTime</font>
21700179
21800180     <font class="keywordtype">void</font>                  parseDate();           <font class="comment">//Date</font>
21900181
22000182     <font class="keywordtype">void</font>                  parseTime();           <font class="comment">//Time</font>
22100183
22200184     <font class="keywordtype">void</font>                  parseDay();            <font class="comment">//gDay</font>
22300185
22400186     <font class="keywordtype">void</font>                  parseMonth();          <font class="comment">//gMonth</font>
22500187
22600188     <font class="keywordtype">void</font>                  parseYear();           <font class="comment">//gYear</font>
22700189
22800190     <font class="keywordtype">void</font>                  parseMonthDay();       <font class="comment">//gMonthDay</font>
22900191
23000192     <font class="keywordtype">void</font>                  parseYearMonth();      <font class="comment">//gYearMonth</font>
23100193
23200194     <font class="keywordtype">void</font>                  parseDuration();       <font class="comment">//duration</font>
23300195
23400196     <font class="comment">// -----------------------------------------------------------------------</font>
23500197     <font class="comment">// Comparison</font>
23600198     <font class="comment">// -----------------------------------------------------------------------</font>
23700199     <font class="keyword">static</font> <font class="keywordtype">int</font>            compare(<font class="keyword">const</font> <a class="code" href="classXMLDateTime.html">XMLDateTime</a>* <font class="keyword">const</font>
23800200                                 , <font class="keyword">const</font> <a class="code" href="classXMLDateTime.html">XMLDateTime</a>* <font class="keyword">const</font>);
23900201
24000202     <font class="keyword">static</font> <font class="keywordtype">int</font>            compare(<font class="keyword">const</font> <a class="code" href="classXMLDateTime.html">XMLDateTime</a>* <font class="keyword">const</font>
24100203                                 , <font class="keyword">const</font> <a class="code" href="classXMLDateTime.html">XMLDateTime</a>* <font class="keyword">const</font>
24200204                                 , <font class="keywordtype">bool</font>                    );
24300205
24400206     <font class="keyword">static</font> <font class="keywordtype">int</font>            compareOrder(<font class="keyword">const</font> <a class="code" href="classXMLDateTime.html">XMLDateTime</a>* <font class="keyword">const</font>
24500207                                      , <font class="keyword">const</font> <a class="code" href="classXMLDateTime.html">XMLDateTime</a>* <font class="keyword">const</font>);                                   
24600208
24700209     <font class="comment">/***</font>
24800210 <font class="comment">     * Support for Serialization/De-serialization</font>
24900211 <font class="comment">     ***/</font>
25000212     DECL_XSERIALIZABLE(<a class="code" href="classXMLDateTime.html">XMLDateTime</a>)
25100213
25200214 <font class="keyword">private</font>:
25300215
25400216     <font class="comment">// -----------------------------------------------------------------------</font>
25500217     <font class="comment">// Constant data</font>
25600218     <font class="comment">// -----------------------------------------------------------------------</font>
25700219     <font class="comment">//</font>
25800220
25900221     <font class="keyword">enum</font> timezoneIndex
26000222     {
26100223         hh = 0,
26200224         mm ,
26300225         TIMEZONE_ARRAYSIZE
26400226     };
26500227
26600228     <font class="comment">// -----------------------------------------------------------------------</font>
26700229     <font class="comment">// Comparison</font>
26800230     <font class="comment">// -----------------------------------------------------------------------</font>
26900231     <font class="keyword">static</font> <font class="keywordtype">int</font>            compareResult(<font class="keywordtype">int</font>
27000232                                       , <font class="keywordtype">int</font>
27100233                                       , <font class="keywordtype">bool</font>);
27200234
27300235     <font class="keyword">static</font> <font class="keywordtype">void</font>           addDuration(<a class="code" href="classXMLDateTime.html">XMLDateTime</a>*             pDuration
27400236                                     , <font class="keyword">const</font> <a class="code" href="classXMLDateTime.html">XMLDateTime</a>* <font class="keyword">const</font> pBaseDate
27500237                                     , <font class="keywordtype">int</font>                      index);
27600238
27700239
27800240     <font class="keyword">static</font> <font class="keywordtype">int</font>            compareResult(<font class="keyword">const</font> <a class="code" href="classXMLDateTime.html">XMLDateTime</a>* <font class="keyword">const</font>
27900241                                       , <font class="keyword">const</font> <a class="code" href="classXMLDateTime.html">XMLDateTime</a>* <font class="keyword">const</font>
28000242                                       , <font class="keywordtype">bool</font>
28100243                                       , <font class="keywordtype">int</font>);
28200244
28300245     <font class="keyword">static</font> <font class="keyword">inline</font> <font class="keywordtype">int</font>     getRetVal(<font class="keywordtype">int</font>, <font class="keywordtype">int</font>);
28400246
28500247     <font class="comment">// -----------------------------------------------------------------------</font>
28600248     <font class="comment">// helper</font>
28700249     <font class="comment">// -----------------------------------------------------------------------</font>
28800250
28900251     <font class="keyword">inline</font>  <font class="keywordtype">void</font>          reset();
29000252
29100253     <font class="keyword">inline</font>  <font class="keywordtype">void</font>          assertBuffer()               <font class="keyword">const</font>;
29200254
29300255     <font class="keyword">inline</font>  <font class="keywordtype">void</font>          copy(<font class="keyword">const</font> <a class="code" href="classXMLDateTime.html">XMLDateTime</a>&amp;);
29400256
29500257     <font class="comment">// allow multiple parsing</font>
29600258     <font class="keyword">inline</font>  <font class="keywordtype">void</font>          initParser();
29700259
29800260     <font class="keyword">inline</font>  <font class="keywordtype">bool</font>          isNormalized()               <font class="keyword">const</font>;
29900261
30000262     <font class="comment">// -----------------------------------------------------------------------</font>
30100263     <font class="comment">// scaners</font>
30200264     <font class="comment">// -----------------------------------------------------------------------</font>
30300265
30400266     <font class="keywordtype">void</font>                  getDate();
30500267
30600268     <font class="keywordtype">void</font>                  getTime();
30700269
30800270     <font class="keywordtype">void</font>                  getYearMonth();
30900271
31000272     <font class="keywordtype">void</font>                  getTimeZone(<font class="keyword">const</font> <font class="keywordtype">int</font>);
31100273
31200274     <font class="keywordtype">void</font>                  parseTimeZone();
31300275
31400276     <font class="comment">// -----------------------------------------------------------------------</font>
31500277     <font class="comment">// locator and converter</font>
31600278     <font class="comment">// -----------------------------------------------------------------------</font>
31700279
31800280     <font class="keywordtype">int</font>                   findUTCSign(<font class="keyword">const</font> <font class="keywordtype">int</font> start);
31900281
32000282     <font class="keywordtype">int</font>                   indexOf(<font class="keyword">const</font> <font class="keywordtype">int</font> start
32100283                                 , <font class="keyword">const</font> <font class="keywordtype">int</font> end
32200284                                 , <font class="keyword">const</font> XMLCh ch)     <font class="keyword">const</font>;
32300285
32400286     <font class="keywordtype">int</font>                   parseInt(<font class="keyword">const</font> <font class="keywordtype">int</font> start
32500287                                  , <font class="keyword">const</font> <font class="keywordtype">int</font> end)     <font class="keyword">const</font>;
32600288
32700289     <font class="keywordtype">int</font>                   parseIntYear(<font class="keyword">const</font> <font class="keywordtype">int</font> end) <font class="keyword">const</font>;
32800290
32900291     <font class="keywordtype">double</font>                parseMiliSecond(<font class="keyword">const</font> <font class="keywordtype">int</font> start
33000292                                         , <font class="keyword">const</font> <font class="keywordtype">int</font> end) <font class="keyword">const</font>;
33100293
33200294     <font class="comment">// -----------------------------------------------------------------------</font>
33300295     <font class="comment">// validator and normalizer</font>
33400296     <font class="comment">// -----------------------------------------------------------------------</font>
33500297
33600298     <font class="keywordtype">void</font>                  validateDateTime()          <font class="keyword">const</font>;
33700299
33800300     <font class="keywordtype">void</font>                  normalize();
33900301
34000302     <font class="keywordtype">void</font>                  fillString(XMLCh*&amp; ptr, valueIndex ind, <font class="keywordtype">int</font> expLen) <font class="keyword">const</font>;
34100303
34200304     <font class="keywordtype">int</font>                   fillYearString(XMLCh*&amp; ptr, valueIndex ind) <font class="keyword">const</font>;
34300305
34400306     <font class="keywordtype">void</font>                  searchMiliSeconds(XMLCh*&amp; miliStartPtr, XMLCh*&amp; miliEndPtr) <font class="keyword">const</font>;
34500307
34600308     <font class="comment">// -----------------------------------------------------------------------</font>
34700309     <font class="comment">// Unimplemented operator ==</font>
34800310     <font class="comment">// -----------------------------------------------------------------------</font>
34900311     <font class="keywordtype">bool</font> operator==(<font class="keyword">const</font> <a class="code" href="classXMLDateTime.html">XMLDateTime</a>&amp; toCompare) <font class="keyword">const</font>;
35000312
35100313
35200314     <font class="comment">// -----------------------------------------------------------------------</font>
35300315     <font class="comment">//  Private data members</font>
35400316     <font class="comment">//</font>
35500317     <font class="comment">//     fValue[]</font>
35600318     <font class="comment">//          object representation of date time.</font>
35700319     <font class="comment">//</font>
35800320     <font class="comment">//     fTimeZone[]</font>
35900321     <font class="comment">//          temporary storage for normalization</font>
36000322     <font class="comment">//</font>
36100323     <font class="comment">//     fStart, fEnd</font>
36200324     <font class="comment">//          pointers to the portion of fBuffer being parsed</font>
36300325     <font class="comment">//</font>
36400326     <font class="comment">//     fBuffer</font>
36500327     <font class="comment">//          raw data to be parsed, own it.</font>
36600328     <font class="comment">//</font>
36700329     <font class="comment">// -----------------------------------------------------------------------</font>
36800330
36900331     <font class="keywordtype">int</font>          fValue[TOTAL_SIZE];
37000332     <font class="keywordtype">int</font>          fTimeZone[TIMEZONE_ARRAYSIZE];
37100333     <font class="keywordtype">int</font>          fStart;
37200334     <font class="keywordtype">int</font>          fEnd;
37300335     <font class="keywordtype">int</font>          fBufferMaxLen;
37400336     XMLCh*       fBuffer;
37500337
37600338     <font class="keywordtype">double</font>       fMiliSecond;
37700339     <font class="keywordtype">bool</font>         fHasTime;
37800340
37900341     <a class="code" href="classMemoryManager.html">MemoryManager</a>* fMemoryManager;
38000342
381<a name="l00343"></a><a class="code" href="classXMLDateTime.html#l0">00343</a>     <font class="keyword">friend</font> <font class="keyword">class </font><a class="code" href="classXSValue.html">XSValue</a>;
38200344 };
38300345
384<a name="l00346"></a><a class="code" href="classXMLDateTime.html#a3">00346</a> <font class="keyword">inline</font> <font class="keywordtype">void</font> <a class="code" href="classXMLDateTime.html#a3">XMLDateTime::setBuffer</a>(<font class="keyword">const</font> XMLCh* <font class="keyword">const</font> aString)
38500347 {
38600348     reset();
38700349
38800350     fEnd = <a class="code" href="classXMLString.html#z519_8">XMLString::stringLen</a>(aString);
38900351     <font class="keywordflow">if</font> (fEnd &gt; 0) {
39000352     
39100353         <font class="keywordflow">if</font> (fEnd &gt; fBufferMaxLen)
39200354         {
39300355             fMemoryManager-&gt;<a class="code" href="classMemoryManager.html#z221_1">deallocate</a>(fBuffer);
39400356             fBufferMaxLen = fEnd + 8;
39500357             fBuffer = (XMLCh*) fMemoryManager-&gt;<a class="code" href="classMemoryManager.html#z221_0">allocate</a>((fBufferMaxLen+1) * <font class="keyword">sizeof</font>(XMLCh));
39600358         }
39700359
39800360         memcpy(fBuffer, aString, (fEnd+1) * <font class="keyword">sizeof</font>(XMLCh));
39900361     }
40000362 }
40100363
40200364 <font class="keyword">inline</font> <font class="keywordtype">void</font> XMLDateTime::reset()
40300365 {
40400366     <font class="keywordflow">for</font> ( <font class="keywordtype">int</font> i=0; i &lt; <a class="code" href="classXMLDateTime.html#s13s8">TOTAL_SIZE</a>; i++ )
40500367         fValue[i] = 0;
40600368
40700369     fMiliSecond   = 0;
40800370     fHasTime      = <font class="keyword">false</font>;
40900371     fTimeZone[hh] = fTimeZone[mm] = 0;
41000372     fStart = fEnd = 0;
41100373
41200374     <font class="keywordflow">if</font> (fBuffer)
41300375         *fBuffer = 0;
41400376 }
41500377
41600378 <font class="keyword">inline</font> <font class="keywordtype">void</font> XMLDateTime::copy(<font class="keyword">const</font> <a class="code" href="classXMLDateTime.html">XMLDateTime</a>&amp; rhs)
41700379 {
41800380     <font class="keywordflow">for</font> ( <font class="keywordtype">int</font> i = 0; i &lt; <a class="code" href="classXMLDateTime.html#s13s8">TOTAL_SIZE</a>; i++ )
41900381         fValue[i] = rhs.<a class="code" href="classXMLDateTime.html#o0">fValue</a>[i];
42000382
42100383     fMiliSecond   = rhs.<a class="code" href="classXMLDateTime.html#o6">fMiliSecond</a>;
42200384     fHasTime      = rhs.<a class="code" href="classXMLDateTime.html#o7">fHasTime</a>;
42300385     fTimeZone[hh] = rhs.<a class="code" href="classXMLDateTime.html#o1">fTimeZone</a>[hh];
42400386     fTimeZone[mm] = rhs.<a class="code" href="classXMLDateTime.html#o1">fTimeZone</a>[mm];
42500387     fStart = rhs.<a class="code" href="classXMLDateTime.html#o2">fStart</a>;
42600388     fEnd   = rhs.<a class="code" href="classXMLDateTime.html#o3">fEnd</a>;
42700389
42800390     <font class="keywordflow">if</font> (fEnd &gt; 0)
42900391     {
43000392         <font class="keywordflow">if</font> (fEnd &gt; fBufferMaxLen)
43100393         {
43200394             fMemoryManager-&gt;<a class="code" href="classMemoryManager.html#z221_1">deallocate</a>(fBuffer);<font class="comment">//delete[] fBuffer;</font>
43300395             fBufferMaxLen = rhs.<a class="code" href="classXMLDateTime.html#o4">fBufferMaxLen</a>;
43400396             fBuffer = (XMLCh*) fMemoryManager-&gt;<a class="code" href="classMemoryManager.html#z221_0">allocate</a>((fBufferMaxLen+1) * <font class="keyword">sizeof</font>(XMLCh));
43500397         }
43600398
43700399         memcpy(fBuffer, rhs.<a class="code" href="classXMLDateTime.html#o5">fBuffer</a>, (fEnd+1) * <font class="keyword">sizeof</font>(XMLCh));
43800400     }
43900401 }
44000402
44100403 <font class="keyword">inline</font> <font class="keywordtype">void</font> XMLDateTime::assertBuffer()<font class="keyword"> const</font>
44200404 <font class="keyword"></font>{
44300405     <font class="keywordflow">if</font> ( ( !fBuffer )            ||
44400406          ( fBuffer[0] == <a class="code" href="XMLUniDefs_8hpp.html#a1">chNull</a> ) )
44500407     {
44600408         <a class="code" href="XMLException_8hpp.html#a7">ThrowXMLwithMemMgr</a>(SchemaDateTimeException
44700409                , XMLExcepts::DateTime_Assert_Buffer_Fail
44800410                , fMemoryManager);
44900411     }
45000412
45100413 }
45200414
45300415 <font class="keyword">inline</font> <font class="keywordtype">void</font> XMLDateTime::initParser()
45400416 {
45500417     assertBuffer();
45600418     fStart = 0;   <font class="comment">// to ensure scan from the very first beginning</font>
45700419                   <font class="comment">// in case the pointer is updated accidentally by someone else.</font>
45800420 }
45900421
46000422 <font class="keyword">inline</font> <font class="keywordtype">bool</font> XMLDateTime::isNormalized()<font class="keyword"> const</font>
46100423 <font class="keyword"></font>{
46200424     <font class="keywordflow">return</font> ( fValue[<a class="code" href="classXMLDateTime.html#s13s7">utc</a>] == <a class="code" href="classXMLDateTime.html#s14s10">UTC_STD</a> ? <font class="keyword">true</font> : <font class="keyword">false</font> );
46300425 }
46400426
46500427 <font class="keyword">inline</font> <font class="keywordtype">int</font> XMLDateTime::getRetVal(<font class="keywordtype">int</font> c1, <font class="keywordtype">int</font> c2)
46600428 {
46700429     <font class="keywordflow">if</font> ((c1 == <a class="code" href="classXMLNumber.html#s9s0">LESS_THAN</a>    &amp;&amp; c2 == <a class="code" href="classXMLNumber.html#s9s2">GREATER_THAN</a>) ||
46800430         (c1 == <a class="code" href="classXMLNumber.html#s9s2">GREATER_THAN</a> &amp;&amp; c2 == <a class="code" href="classXMLNumber.html#s9s0">LESS_THAN</a>)      )
46900431     {
47000432         <font class="keywordflow">return</font> <a class="code" href="classXMLNumber.html#s9s3">INDETERMINATE</a>;
47100433     }
47200434
47300435     <font class="keywordflow">return</font> ( c1 != <a class="code" href="classXMLNumber.html#s9s3">INDETERMINATE</a> ) ? c1 : c2;
47400436 }
47500437
47600438 <a class="code" href="XercesDefs_8hpp.html#a3">XERCES_CPP_NAMESPACE_END</a>
47700439
47800440 <font class="preprocessor">#endif</font>
479</pre></div>    </FONT></TD></TR></TABLE><BR>
480</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>
481              Copyright &copy; 1994-2004 The Apache Software Foundation.
482              All Rights Reserved.
483            </I></FONT></TD></TR></TABLE></BODY></HTML>
Note: See TracBrowser for help on using the repository browser.