source: NonGTP/Xerces/xerces/include/xercesc/util/XMLFloat.hpp @ 358

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

xerces added

Line 
1/*
2 * Copyright 2001,2004 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/*
18 * $Id: XMLFloat.hpp,v 1.9 2004/09/08 13:56:24 peiyongz Exp $
19 * $Log: XMLFloat.hpp,v $
20 * Revision 1.9  2004/09/08 13:56:24  peiyongz
21 * Apache License Version 2.0
22 *
23 * Revision 1.8  2003/12/17 00:18:35  cargilld
24 * Update to memory management so that the static memory manager (one used to call Initialize) is only for static data.
25 *
26 * Revision 1.7  2003/12/01 23:23:27  neilg
27 * fix for bug 25118; thanks to Jeroen Witmond
28 *
29 * Revision 1.6  2003/09/23 18:16:07  peiyongz
30 * Inplementation for Serialization/Deserialization
31 *
32 * Revision 1.5  2003/05/16 06:01:53  knoaman
33 * Partial implementation of the configurable memory manager.
34 *
35 * Revision 1.4  2002/12/11 00:20:02  peiyongz
36 * Doing businesss in value space. Converting out-of-bound value into special values.
37 *
38 * Revision 1.3  2002/11/04 15:22:05  tng
39 * C++ Namespace Support.
40 *
41 * Revision 1.2  2002/02/20 18:17:02  tng
42 * [Bug 5977] Warnings on generating apiDocs.
43 *
44 * Revision 1.1.1.1  2002/02/01 22:22:15  peiyongz
45 * sane_include
46 *
47 * Revision 1.9  2001/11/28 15:39:26  peiyongz
48 * return Type& for operator=
49 *
50 * Revision 1.8  2001/11/22 20:23:00  peiyongz
51 * _declspec(dllimport) and inline warning C4273
52 *
53 * Revision 1.7  2001/11/19 21:33:42  peiyongz
54 * Reorganization: Double/Float
55 *
56 * Revision 1.6  2001/10/26 16:37:46  peiyongz
57 * Add thread safe code
58 *
59 * Revision 1.4  2001/09/27 14:54:20  peiyongz
60 * DTV Reorganization: derived from XMLAbstractDoubleFloat
61 *
62 * Revision 1.3  2001/08/29 19:03:03  peiyongz
63 * Bugzilla# 2816:on AIX 4.2, xlC 3 r ev.1, Compilation error on inline method
64 *
65 * Revision 1.2  2001/07/31 13:48:29  peiyongz
66 * fValue removed
67 *
68 * Revision 1.1  2001/07/26 20:41:37  peiyongz
69 * XMLFloat
70 *
71 *
72 */
73
74#ifndef XML_FLOAT_HPP
75#define XML_FLOAT_HPP
76
77#include <xercesc/util/XMLAbstractDoubleFloat.hpp>
78
79XERCES_CPP_NAMESPACE_BEGIN
80
81class XMLUTIL_EXPORT XMLFloat : public XMLAbstractDoubleFloat
82{
83public:
84
85        /**
86         * Constructs a newly allocated <code>XMLFloat</code> object that
87         * represents the value represented by the string.
88         *
89         * @param      strValue the <code>String</code> to be converted to an
90         *                      <code>XMLFloat</code>.
91         * @param manager    Pointer to the memory manager to be used to
92         *                   allocate objects.
93         * @exception  NumberFormatException  if the <code>String</code> does not
94         *               contain a parsable XMLFloat.
95         */
96
97    XMLFloat(const XMLCh* const strValue,
98             MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
99
100    ~XMLFloat();
101
102        /**
103         * Compares the two specified XMLFloat objects.
104         * The result is <code>true</code> if and only if the argument is not
105         * <code>null</code> and that contains the same <code>int</code> value.
106         *
107         * @param   lValue the object to compare with.
108         * @param   rValue the object to compare against.
109         * @return  <code>true</code> if the objects are the same;
110         *          <code>false</code> otherwise.
111         */
112
113    inline static int            compareValues(const XMLFloat* const lValue
114                                             , const XMLFloat* const rValue);
115
116    /***
117     * Support for Serialization/De-serialization
118     ***/
119    DECL_XSERIALIZABLE(XMLFloat)
120
121    XMLFloat(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
122
123protected:
124
125    void                  checkBoundary(const XMLCh* const strValue);
126
127private:
128    //
129    // Unimplemented
130    //
131    // copy ctor
132    // assignment ctor
133    //
134    XMLFloat(const XMLFloat& toCopy);
135    XMLFloat& operator=(const XMLFloat& toAssign);
136
137};
138
139inline int XMLFloat::compareValues(const XMLFloat* const lValue
140                                 , const XMLFloat* const rValue)
141{
142    return XMLAbstractDoubleFloat::compareValues((const XMLAbstractDoubleFloat* const) lValue,
143                                                 (const XMLAbstractDoubleFloat* const) rValue
144                                                 , ((XMLAbstractDoubleFloat*)lValue)->getMemoryManager());
145}
146
147XERCES_CPP_NAMESPACE_END
148
149#endif
Note: See TracBrowser for help on using the repository browser.