Warning, file /include/xercesc/util/XMLBigInteger.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
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_BIGINTEGER_HPP)
0023 #define XERCESC_INCLUDE_GUARD_XML_BIGINTEGER_HPP
0024
0025 #include <xercesc/util/XMemory.hpp>
0026 #include <xercesc/util/XMLString.hpp>
0027
0028 XERCES_CPP_NAMESPACE_BEGIN
0029
0030 class XMLUTIL_EXPORT XMLBigInteger : public XMemory
0031 {
0032 public:
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 XMLBigInteger
0048 (
0049 const XMLCh* const strValue
0050 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0051 );
0052 ~XMLBigInteger();
0053
0054 XMLBigInteger(const XMLBigInteger& toCopy);
0055
0056 static XMLCh* getCanonicalRepresentation
0057 (
0058 const XMLCh* const rawData
0059 , MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager
0060 , bool isNonPositiveInteger = false
0061 );
0062
0063 static void parseBigInteger(const XMLCh* const toConvert
0064 , XMLCh* const retBuffer
0065 , int& signValue
0066 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
0067
0068 static int compareValues(const XMLBigInteger* const lValue
0069 ,const XMLBigInteger* const rValue
0070 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
0071
0072
0073 static int compareValues(const XMLCh* const lString
0074 , const int& lSign
0075 , const XMLCh* const rString
0076 , const int& rSign
0077 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
0078
0079 void multiply(const unsigned int byteToShift);
0080
0081 void divide(const unsigned int byteToShift);
0082
0083 unsigned int getTotalDigit() const;
0084
0085
0086
0087
0088
0089
0090 inline XMLCh* getRawData() const;
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102 bool operator==(const XMLBigInteger& toCompare) const;
0103
0104
0105
0106
0107
0108 int getSign() const;
0109
0110 int intValue() const;
0111
0112 private:
0113
0114
0115
0116 XMLBigInteger& operator=(const XMLBigInteger&);
0117
0118
0119 void setSign(int);
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142 int fSign;
0143 XMLCh* fMagnitude;
0144 XMLCh* fRawData;
0145 MemoryManager* fMemoryManager;
0146 };
0147
0148 inline int XMLBigInteger::getSign() const
0149 {
0150 return fSign;
0151 }
0152
0153 inline unsigned int XMLBigInteger::getTotalDigit() const
0154 {
0155 return ((getSign() ==0) ? 0 : (unsigned int)XMLString::stringLen(fMagnitude));
0156 }
0157
0158 inline bool XMLBigInteger::operator==(const XMLBigInteger& toCompare) const
0159 {
0160 return ( compareValues(this, &toCompare, fMemoryManager) ==0 ? true : false);
0161 }
0162
0163 inline void XMLBigInteger::setSign(int newSign)
0164 {
0165 fSign = newSign;
0166 }
0167
0168 inline XMLCh* XMLBigInteger::getRawData() const
0169 {
0170 return fRawData;
0171 }
0172
0173 XERCES_CPP_NAMESPACE_END
0174
0175 #endif