Xerces-C++: XMLBigInteger.hpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#if !defined(XERCESC_INCLUDE_GUARD_XML_BIGINTEGER_HPP)
23#define XERCESC_INCLUDE_GUARD_XML_BIGINTEGER_HPP
24
27
29
31{
32public:
33
48 (
49 const XMLCh* const strValue
51 );
53
55
57 (
58 const XMLCh* const rawData
60 , bool isNonPositiveInteger = false
61 );
62
64 , XMLCh* const retBuffer
65 , int& signValue
67
71
72
74 , const int& lSign
75 , const XMLCh* const rString
76 , const int& rSign
78
79 void multiply(const unsigned int byteToShift);
80
81 void divide(const unsigned int byteToShift);
82
83 unsigned int getTotalDigit() const;
84
90 inline XMLCh* getRawData() const;
91
102 bool operator==(const XMLBigInteger& toCompare) const;
103
108 int getSign() const;
109
111
112private:
113
114
115
117
118
119 void setSign(int);
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142 int fSign;
143 XMLCh* fMagnitude;
146};
147
149{
150 return fSign;
151}
152
157
159{
160 return ( compareValues(this, &toCompare, fMemoryManager) ==0 ? true : false);
161}
162
163inline void XMLBigInteger::setSign(int newSign)
164{
165 fSign = newSign;
166}
167
169{
170 return fRawData;
171}
172
174
175#endif
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
#define XMLUTIL_EXPORT
Definition XercesDefs.hpp:162
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
char16_t XMLCh
Definition Xerces_autoconf_config.hpp:120
Configurable memory manager.
Definition MemoryManager.hpp:40
Definition XMLBigInteger.hpp:31
XMLBigInteger(const XMLBigInteger &toCopy)
void multiply(const unsigned int byteToShift)
unsigned int getTotalDigit() const
Definition XMLBigInteger.hpp:153
void divide(const unsigned int byteToShift)
XMLBigInteger(const XMLCh *const strValue, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
Constructs a newly allocated XMLBigInteger object that represents the value represented by the string...
static int compareValues(const XMLCh *const lString, const int &lSign, const XMLCh *const rString, const int &rSign, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
bool operator==(const XMLBigInteger &toCompare) const
Compares this object to the specified object.
Definition XMLBigInteger.hpp:158
int getSign() const
Returns the signum function of this number (i.e., -1, 0 or 1 as the value of this number is negative,...
Definition XMLBigInteger.hpp:148
static XMLCh * getCanonicalRepresentation(const XMLCh *const rawData, MemoryManager *const memMgr=XMLPlatformUtils::fgMemoryManager, bool isNonPositiveInteger=false)
static int compareValues(const XMLBigInteger *const lValue, const XMLBigInteger *const rValue, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
static void parseBigInteger(const XMLCh *const toConvert, XMLCh *const retBuffer, int &signValue, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
XMLCh * getRawData() const
Return a copy of the fMagnitude.
Definition XMLBigInteger.hpp:168
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition PlatformUtils.hpp:121
static XMLSize_t stringLen(const char *const src)
Get the length of the string.
This class makes it possible to override the C++ memory management by adding new/delete operators to ...
Definition XMemory.hpp:41