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 #ifndef XML_BIGINTEGER_HPP
00062 #define XML_BIGINTEGER_HPP
00063 
00064 #include <util/XercesDefs.hpp>
00065 #include <util/XMLString.hpp>
00066 
00067 class  XMLBigInteger
00068 {
00069 public:
00070 
00081 
00082     XMLBigInteger(const XMLCh* const strValue);
00083 
00084     ~XMLBigInteger();
00085 
00086     XMLBigInteger(const XMLBigInteger& toCopy);
00087 
00088     static void parseBigInteger(const XMLCh* const toConvert
00089                               , XMLCh* const       retBuffer
00090                               , int&   signValue);
00091 
00092     static int  compareValues(const XMLBigInteger* const lValue
00093                              ,const XMLBigInteger* const rValue);
00094 
00095 
00096     void        multiply(const unsigned int byteToShift);
00097 
00098     void        divide(const unsigned int byteToShift);
00099 
00100     int         getTotalDigit() const;
00101 
00107     XMLCh*      toString() const;
00108 
00119     bool operator==(const XMLBigInteger& toCompare) const;
00120 
00125     int getSign() const;
00126 
00127     int intValue() const;
00128 
00129 private:
00130 
00131     void setSign(int);
00132 
00133     
00134 
00135 
00136 
00137 
00138 
00139     
00140     
00141     
00142     
00143     
00144     
00145     
00146     
00147     
00148     
00149 
00150     int         fSign;
00151     XMLCh*      fMagnitude;  
00152 
00153 };
00154 
00155 inline int XMLBigInteger::getSign() const
00156 {   
00157     return fSign;
00158 }
00159 
00160 inline int XMLBigInteger::getTotalDigit() const
00161 {
00162     return ((getSign() ==0) ? 0 : XMLString::stringLen(fMagnitude));
00163 }
00164 
00165 inline bool XMLBigInteger::operator==(const XMLBigInteger& toCompare) const
00166 {
00167     return ( compareValues(this, &toCompare) ==0 ? true : false);
00168 }
00169 
00170 inline void XMLBigInteger::setSign(int newSign)
00171 {
00172     fSign = newSign;
00173 }
00174 
00175 #endif