00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133 #ifndef XML_ABSTRACT_DOUBLE_FLOAT_HPP
00134 #define XML_ABSTRACT_DOUBLE_FLOAT_HPP
00135
00136 #include <xercesc/util/XMLNumber.hpp>
00137 #include <xercesc/util/PlatformUtils.hpp>
00138
00139 XERCES_CPP_NAMESPACE_BEGIN
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171 class XMLAbstractDoubleFloat : public XMLNumber
00172 {
00173 public:
00174
00175 enum LiteralType
00176 {
00177 NegINF,
00178 PosINF,
00179 NaN,
00180 SpecialTypeNum,
00181 Normal
00182 };
00183
00184 virtual ~XMLAbstractDoubleFloat();
00185
00186 static XMLCh* getCanonicalRepresentation
00187 (
00188 const XMLCh* const rawData
00189 , MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager
00190 );
00191
00197 virtual XMLCh* toString() const;
00198
00199 virtual XMLCh* getRawData() const;
00200
00201 virtual const XMLCh* getFormattedString() const;
00202
00203 virtual int getSign() const;
00204
00205 MemoryManager* getMemoryManager() const;
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215 void normalizeDecimalPoint(char* const toNormal);
00216
00217
00218
00219
00220 DECL_XSERIALIZABLE(XMLAbstractDoubleFloat)
00221
00222 protected:
00223
00224
00225
00226
00227 XMLAbstractDoubleFloat(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00228
00229 void init(const XMLCh* const strValue);
00230
00243 static int compareValues(const XMLAbstractDoubleFloat* const lValue
00244 , const XMLAbstractDoubleFloat* const rValue
00245 , MemoryManager* const manager);
00246
00247
00248
00249
00250 virtual void checkBoundary(const XMLCh* const strValue) = 0;
00251
00252 private:
00253
00254
00255
00256
00257
00258
00259 XMLAbstractDoubleFloat(const XMLAbstractDoubleFloat& toCopy);
00260 XMLAbstractDoubleFloat& operator=(const XMLAbstractDoubleFloat& toAssign);
00261
00262 void normalizeZero(XMLCh* const);
00263
00264 inline bool isSpecialValue() const;
00265
00266 static int compareSpecial(const XMLAbstractDoubleFloat* const specialValue
00267 , MemoryManager* const manager);
00268
00269 void formatString();
00270
00271 protected:
00272 double fValue;
00273 LiteralType fType;
00274 bool fDataConverted;
00275
00276 private:
00277 int fSign;
00278 XMLCh* fRawData;
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288 XMLCh* fFormattedString;
00289 MemoryManager* fMemoryManager;
00290 };
00291
00292 inline bool XMLAbstractDoubleFloat::isSpecialValue() const
00293 {
00294 return (fType < SpecialTypeNum);
00295 }
00296
00297 inline MemoryManager* XMLAbstractDoubleFloat::getMemoryManager() const
00298 {
00299 return fMemoryManager;
00300 }
00301
00302 XERCES_CPP_NAMESPACE_END
00303
00304 #endif