00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef XML_BIGDECIMAL_HPP
00023 #define XML_BIGDECIMAL_HPP
00024
00025 #include <xercesc/util/XMLNumber.hpp>
00026 #include <xercesc/util/XMLString.hpp>
00027 #include <xercesc/util/PlatformUtils.hpp>
00028
00029 XERCES_CPP_NAMESPACE_BEGIN
00030
00031 class XMLBigDecimal : public XMLNumber
00032 {
00033 public:
00034
00047 XMLBigDecimal
00048 (
00049 const XMLCh* const strValue
00050 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00051 );
00052
00053 ~XMLBigDecimal();
00054
00055 static int compareValues(const XMLBigDecimal* const lValue
00056 , const XMLBigDecimal* const rValue
00057 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00058
00059 static XMLCh* getCanonicalRepresentation
00060 (
00061 const XMLCh* const rawData
00062 , MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager
00063 );
00064
00065 static void parseDecimal
00066 (
00067 const XMLCh* const toParse
00068 , XMLCh* const retBuffer
00069 , int& sign
00070 , int& totalDigits
00071 , int& fractDigits
00072 , MemoryManager* const manager
00073 );
00074
00075 static void parseDecimal
00076 (
00077 const XMLCh* const toParse
00078 , MemoryManager* const manager
00079 );
00080
00086 virtual XMLCh* toString() const;
00087
00088 virtual XMLCh* getRawData() const;
00089
00090 virtual const XMLCh* getFormattedString() const;
00091
00092 virtual int getSign() const;
00093
00094 const XMLCh* getValue() const;
00095
00096 unsigned int getScale() const;
00097
00098 unsigned int getTotalDigit() const;
00099
00100 inline XMLCh* getIntVal() const;
00101
00110 int toCompare(const XMLBigDecimal& other) const;
00111
00112
00113
00114
00115
00116
00117 void setDecimalValue(const XMLCh* const strValue);
00118
00119 MemoryManager* getMemoryManager() const;
00120
00121
00122
00123
00124 DECL_XSERIALIZABLE(XMLBigDecimal)
00125
00126 XMLBigDecimal(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00127
00128 private:
00129
00130 void cleanUp();
00131
00132
00133
00134
00135 XMLBigDecimal(const XMLBigDecimal& other);
00136 XMLBigDecimal& operator=(const XMLBigDecimal& other);
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161 int fSign;
00162 unsigned int fTotalDigits;
00163 unsigned int fScale;
00164 unsigned int fRawDataLen;
00165 XMLCh* fRawData;
00166 XMLCh* fIntVal;
00167 MemoryManager* fMemoryManager;
00168
00169 };
00170
00171 inline int XMLBigDecimal::getSign() const
00172 {
00173 return fSign;
00174 }
00175
00176 inline const XMLCh* XMLBigDecimal::getValue() const
00177 {
00178 return fIntVal;
00179 }
00180
00181 inline unsigned int XMLBigDecimal::getScale() const
00182 {
00183 return fScale;
00184 }
00185
00186 inline unsigned int XMLBigDecimal::getTotalDigit() const
00187 {
00188 return fTotalDigits;
00189 }
00190
00191 inline XMLCh* XMLBigDecimal::getRawData() const
00192 {
00193 return fRawData;
00194 }
00195
00196 inline const XMLCh* XMLBigDecimal::getFormattedString() const
00197 {
00198 return fRawData;
00199 }
00200
00201 inline MemoryManager* XMLBigDecimal::getMemoryManager() const
00202 {
00203 return fMemoryManager;
00204 }
00205
00206 inline XMLCh* XMLBigDecimal::getIntVal() const
00207 {
00208 return fIntVal;
00209 }
00210
00211
00212
00213
00214 inline XMLCh* XMLBigDecimal::toString() const
00215 {
00216
00217 return XMLString::replicate(fRawData);
00218 }
00219
00220 XERCES_CPP_NAMESPACE_END
00221
00222 #endif