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: XMLDouble.hpp,v 1.9 2004/09/08 13:56:24 peiyongz Exp $
|
---|
19 | * $Log: XMLDouble.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.11 2001/11/28 15:39:26 peiyongz
|
---|
48 | * return Type& for operator=
|
---|
49 | *
|
---|
50 | * Revision 1.10 2001/11/22 20:23:00 peiyongz
|
---|
51 | * _declspec(dllimport) and inline warning C4273
|
---|
52 | *
|
---|
53 | * Revision 1.9 2001/11/19 21:33:42 peiyongz
|
---|
54 | * Reorganization: Double/Float
|
---|
55 | *
|
---|
56 | * Revision 1.8 2001/10/26 16:37:46 peiyongz
|
---|
57 | * Add thread safe code
|
---|
58 | *
|
---|
59 | * Revision 1.6 2001/09/27 14:54:20 peiyongz
|
---|
60 | * DTV Reorganization: derived from XMLAbstractDoubleFloat
|
---|
61 | *
|
---|
62 | * Revision 1.5 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.4 2001/07/31 13:48:29 peiyongz
|
---|
66 | * fValue removed
|
---|
67 | *
|
---|
68 | * Revision 1.3 2001/07/26 18:21:15 peiyongz
|
---|
69 | * Boundary Checking
|
---|
70 | *
|
---|
71 | * Revision 1.2 2001/07/24 21:52:27 peiyongz
|
---|
72 | * XMLDouble: move fg...String to XMLUni
|
---|
73 | *
|
---|
74 | * Revision 1.1 2001/07/24 13:58:11 peiyongz
|
---|
75 | * XMLDouble and related supporting methods from XMLBigInteger/XMLBigDecimal
|
---|
76 | *
|
---|
77 | */
|
---|
78 |
|
---|
79 | #ifndef XML_DOUBLE_HPP
|
---|
80 | #define XML_DOUBLE_HPP
|
---|
81 |
|
---|
82 | #include <xercesc/util/XMLAbstractDoubleFloat.hpp>
|
---|
83 |
|
---|
84 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
85 |
|
---|
86 | class XMLUTIL_EXPORT XMLDouble : public XMLAbstractDoubleFloat
|
---|
87 | {
|
---|
88 | public:
|
---|
89 |
|
---|
90 | /**
|
---|
91 | * Constructs a newly allocated <code>XMLDouble</code> object that
|
---|
92 | * represents the value represented by the string.
|
---|
93 | *
|
---|
94 | * @param strValue the <code>String</code> to be converted to an
|
---|
95 | * <code>XMLDouble</code>.
|
---|
96 | * @param manager Pointer to the memory manager to be used to
|
---|
97 | * allocate objects.
|
---|
98 | * @exception NumberFormatException if the <code>String</code> does not
|
---|
99 | * contain a parsable XMLDouble.
|
---|
100 | */
|
---|
101 |
|
---|
102 | XMLDouble(const XMLCh* const strValue,
|
---|
103 | MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
---|
104 |
|
---|
105 | ~XMLDouble();
|
---|
106 |
|
---|
107 | /**
|
---|
108 | * Compares this object to the specified object.
|
---|
109 | * The result is <code>true</code> if and only if the argument is not
|
---|
110 | * <code>null</code> and is an <code>XMLDouble</code> object that contains
|
---|
111 | * the same <code>int</code> value as this object.
|
---|
112 | *
|
---|
113 | * @param lValue the object to compare with.
|
---|
114 | * @param rValue the object to compare against.
|
---|
115 | * @return <code>true</code> if the objects are the same;
|
---|
116 | * <code>false</code> otherwise.
|
---|
117 | */
|
---|
118 |
|
---|
119 | inline static int compareValues(const XMLDouble* const lValue
|
---|
120 | , const XMLDouble* const rValue);
|
---|
121 |
|
---|
122 | /***
|
---|
123 | * Support for Serialization/De-serialization
|
---|
124 | ***/
|
---|
125 | DECL_XSERIALIZABLE(XMLDouble)
|
---|
126 |
|
---|
127 | XMLDouble(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
---|
128 |
|
---|
129 | protected:
|
---|
130 |
|
---|
131 | void checkBoundary(const XMLCh* const strValue);
|
---|
132 |
|
---|
133 | private:
|
---|
134 | //
|
---|
135 | // Unimplemented
|
---|
136 | //
|
---|
137 | // copy ctor
|
---|
138 | // assignment ctor
|
---|
139 | //
|
---|
140 | XMLDouble(const XMLDouble& toCopy);
|
---|
141 | XMLDouble& operator=(const XMLDouble& toAssign);
|
---|
142 |
|
---|
143 | };
|
---|
144 |
|
---|
145 | inline int XMLDouble::compareValues(const XMLDouble* const lValue
|
---|
146 | , const XMLDouble* const rValue)
|
---|
147 | {
|
---|
148 | return XMLAbstractDoubleFloat::compareValues((const XMLAbstractDoubleFloat* const) lValue,
|
---|
149 | (const XMLAbstractDoubleFloat* const) rValue
|
---|
150 | , ((XMLAbstractDoubleFloat*)lValue)->getMemoryManager());
|
---|
151 | }
|
---|
152 |
|
---|
153 | XERCES_CPP_NAMESPACE_END
|
---|
154 |
|
---|
155 | #endif
|
---|
156 |
|
---|