File indexing completed on 2025-01-18 10:15:14
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #if !defined(XERCESC_INCLUDE_GUARD_XML_ABSTRACT_DOUBLE_FLOAT_HPP)
0023 #define XERCESC_INCLUDE_GUARD_XML_ABSTRACT_DOUBLE_FLOAT_HPP
0024
0025
0026 #include <xercesc/util/XMLNumber.hpp>
0027 #include <xercesc/util/PlatformUtils.hpp>
0028
0029 XERCES_CPP_NAMESPACE_BEGIN
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061 class XMLUTIL_EXPORT XMLAbstractDoubleFloat : public XMLNumber
0062 {
0063 public:
0064
0065 enum LiteralType
0066 {
0067 NegINF,
0068 PosINF,
0069 NaN,
0070 SpecialTypeNum,
0071 Normal
0072 };
0073
0074 virtual ~XMLAbstractDoubleFloat();
0075
0076 static XMLCh* getCanonicalRepresentation
0077 (
0078 const XMLCh* const rawData
0079 , MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager
0080 );
0081
0082 virtual XMLCh* getRawData() const;
0083
0084 virtual const XMLCh* getFormattedString() const;
0085
0086 virtual int getSign() const;
0087
0088 MemoryManager* getMemoryManager() const;
0089
0090 inline bool isDataConverted() const;
0091
0092 inline bool isDataOverflowed() const;
0093
0094 inline double getValue() const;
0095
0096 inline LiteralType getType() const;
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106 static void normalizeDecimalPoint(char* const toNormal);
0107
0108
0109
0110
0111 DECL_XSERIALIZABLE(XMLAbstractDoubleFloat)
0112
0113 protected:
0114
0115
0116
0117
0118 XMLAbstractDoubleFloat(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
0119
0120 void init(const XMLCh* const strValue);
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135 static int compareValues(const XMLAbstractDoubleFloat* const lValue
0136 , const XMLAbstractDoubleFloat* const rValue
0137 , MemoryManager* const manager);
0138
0139
0140
0141
0142 virtual void checkBoundary(char* const strValue) = 0;
0143
0144 void
0145 convert(char* const strValue);
0146
0147 private:
0148
0149
0150
0151
0152
0153
0154 XMLAbstractDoubleFloat(const XMLAbstractDoubleFloat& toCopy);
0155 XMLAbstractDoubleFloat& operator=(const XMLAbstractDoubleFloat& toAssign);
0156
0157 void normalizeZero(XMLCh* const);
0158
0159 inline bool isSpecialValue() const;
0160
0161 static int compareSpecial(const XMLAbstractDoubleFloat* const specialValue
0162 , MemoryManager* const manager);
0163
0164 void formatString();
0165
0166 protected:
0167 double fValue;
0168 LiteralType fType;
0169 bool fDataConverted;
0170 bool fDataOverflowed;
0171
0172 private:
0173 int fSign;
0174 XMLCh* fRawData;
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184 XMLCh* fFormattedString;
0185 MemoryManager* fMemoryManager;
0186
0187 };
0188
0189 inline bool XMLAbstractDoubleFloat::isSpecialValue() const
0190 {
0191 return (fType < SpecialTypeNum);
0192 }
0193
0194 inline MemoryManager* XMLAbstractDoubleFloat::getMemoryManager() const
0195 {
0196 return fMemoryManager;
0197 }
0198
0199 inline bool XMLAbstractDoubleFloat::isDataConverted() const
0200 {
0201 return fDataConverted;
0202 }
0203
0204 inline bool XMLAbstractDoubleFloat::isDataOverflowed() const
0205 {
0206 return fDataOverflowed;
0207 }
0208
0209 inline double XMLAbstractDoubleFloat::getValue() const
0210 {
0211 return fValue;
0212 }
0213
0214 inline XMLAbstractDoubleFloat::LiteralType XMLAbstractDoubleFloat::getType() const
0215 {
0216 return fType;
0217 }
0218
0219 XERCES_CPP_NAMESPACE_END
0220
0221 #endif