00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(XERCESC_INCLUDE_GUARD_XML_BIGDECIMAL_HPP)
00023 #define XERCESC_INCLUDE_GUARD_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 XMLUTIL_EXPORT 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
00081 virtual XMLCh* getRawData() const;
00082
00083 virtual const XMLCh* getFormattedString() const;
00084
00085 virtual int getSign() const;
00086
00087 const XMLCh* getValue() const;
00088
00089 unsigned int getScale() const;
00090
00091 unsigned int getTotalDigit() const;
00092
00093 inline XMLCh* getIntVal() const;
00094
00103 int toCompare(const XMLBigDecimal& other) const;
00104
00105
00106
00107
00108
00109
00110 void setDecimalValue(const XMLCh* const strValue);
00111
00112 MemoryManager* getMemoryManager() const;
00113
00114
00115
00116
00117 DECL_XSERIALIZABLE(XMLBigDecimal)
00118
00119 XMLBigDecimal(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00120
00121 private:
00122
00123 void cleanUp();
00124
00125
00126
00127
00128 XMLBigDecimal(const XMLBigDecimal& other);
00129 XMLBigDecimal& operator=(const XMLBigDecimal& other);
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154 int fSign;
00155 unsigned int fTotalDigits;
00156 unsigned int fScale;
00157 XMLSize_t fRawDataLen;
00158 XMLCh* fRawData;
00159 XMLCh* fIntVal;
00160 MemoryManager* fMemoryManager;
00161
00162 };
00163
00164 inline int XMLBigDecimal::getSign() const
00165 {
00166 return fSign;
00167 }
00168
00169 inline const XMLCh* XMLBigDecimal::getValue() const
00170 {
00171 return fIntVal;
00172 }
00173
00174 inline unsigned int XMLBigDecimal::getScale() const
00175 {
00176 return fScale;
00177 }
00178
00179 inline unsigned int XMLBigDecimal::getTotalDigit() const
00180 {
00181 return fTotalDigits;
00182 }
00183
00184 inline XMLCh* XMLBigDecimal::getRawData() const
00185 {
00186 return fRawData;
00187 }
00188
00189 inline const XMLCh* XMLBigDecimal::getFormattedString() const
00190 {
00191 return fRawData;
00192 }
00193
00194 inline MemoryManager* XMLBigDecimal::getMemoryManager() const
00195 {
00196 return fMemoryManager;
00197 }
00198
00199 inline XMLCh* XMLBigDecimal::getIntVal() const
00200 {
00201 return fIntVal;
00202 }
00203
00204 XERCES_CPP_NAMESPACE_END
00205
00206 #endif