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_BIGDECIMAL_HPP)
0023 #define XERCESC_INCLUDE_GUARD_XML_BIGDECIMAL_HPP
0024
0025 #include <xercesc/util/XMLNumber.hpp>
0026 #include <xercesc/util/XMLString.hpp>
0027 #include <xercesc/util/PlatformUtils.hpp>
0028
0029 XERCES_CPP_NAMESPACE_BEGIN
0030
0031 class XMLUTIL_EXPORT XMLBigDecimal : public XMLNumber
0032 {
0033 public:
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 XMLBigDecimal
0048 (
0049 const XMLCh* const strValue
0050 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0051 );
0052
0053 ~XMLBigDecimal();
0054
0055 static int compareValues(const XMLBigDecimal* const lValue
0056 , const XMLBigDecimal* const rValue
0057 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
0058
0059 static XMLCh* getCanonicalRepresentation
0060 (
0061 const XMLCh* const rawData
0062 , MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager
0063 );
0064
0065 static void parseDecimal
0066 (
0067 const XMLCh* const toParse
0068 , XMLCh* const retBuffer
0069 , int& sign
0070 , int& totalDigits
0071 , int& fractDigits
0072 , MemoryManager* const manager
0073 );
0074
0075 static void parseDecimal
0076 (
0077 const XMLCh* const toParse
0078 , MemoryManager* const manager
0079 );
0080
0081 virtual XMLCh* getRawData() const;
0082
0083 virtual const XMLCh* getFormattedString() const;
0084
0085 virtual int getSign() const;
0086
0087 const XMLCh* getValue() const;
0088
0089 unsigned int getScale() const;
0090
0091 unsigned int getTotalDigit() const;
0092
0093 inline XMLCh* getIntVal() const;
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103 int toCompare(const XMLBigDecimal& other) const;
0104
0105
0106
0107
0108
0109
0110 void setDecimalValue(const XMLCh* const strValue);
0111
0112 MemoryManager* getMemoryManager() const;
0113
0114
0115
0116
0117 DECL_XSERIALIZABLE(XMLBigDecimal)
0118
0119 XMLBigDecimal(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
0120
0121 private:
0122
0123 void cleanUp();
0124
0125
0126
0127
0128 XMLBigDecimal(const XMLBigDecimal& other);
0129 XMLBigDecimal& operator=(const XMLBigDecimal& other);
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154 int fSign;
0155 unsigned int fTotalDigits;
0156 unsigned int fScale;
0157 XMLSize_t fRawDataLen;
0158 XMLCh* fRawData;
0159 XMLCh* fIntVal;
0160 MemoryManager* fMemoryManager;
0161
0162 };
0163
0164 inline int XMLBigDecimal::getSign() const
0165 {
0166 return fSign;
0167 }
0168
0169 inline const XMLCh* XMLBigDecimal::getValue() const
0170 {
0171 return fIntVal;
0172 }
0173
0174 inline unsigned int XMLBigDecimal::getScale() const
0175 {
0176 return fScale;
0177 }
0178
0179 inline unsigned int XMLBigDecimal::getTotalDigit() const
0180 {
0181 return fTotalDigits;
0182 }
0183
0184 inline XMLCh* XMLBigDecimal::getRawData() const
0185 {
0186 return fRawData;
0187 }
0188
0189 inline const XMLCh* XMLBigDecimal::getFormattedString() const
0190 {
0191 return fRawData;
0192 }
0193
0194 inline MemoryManager* XMLBigDecimal::getMemoryManager() const
0195 {
0196 return fMemoryManager;
0197 }
0198
0199 inline XMLCh* XMLBigDecimal::getIntVal() const
0200 {
0201 return fIntVal;
0202 }
0203
0204 XERCES_CPP_NAMESPACE_END
0205
0206 #endif