#include <QtCrypto>
|
(Note that these are not member symbols.)
|
| QCA_EXPORT QTextStream & | operator<< (QTextStream &stream, const BigInteger &b) |
Arbitrary precision integer.
BigInteger provides arbitrary precision integers.
◆ BigInteger() [1/6]
| QCA::BigInteger::BigInteger |
( |
| ) |
|
Constructor.
Creates a new BigInteger, initialised to zero.
Referenced by BigInteger(), compare(), operator!=(), operator%=(), operator*=(), operator+=(), operator-=(), operator/=(), operator<(), operator<<(), operator<=(), operator=(), operator=(), operator==(), operator>(), and operator>=().
◆ BigInteger() [2/6]
| QCA::BigInteger::BigInteger |
( |
int | n | ) |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
| n | an alternative integer initialisation value. |
◆ BigInteger() [3/6]
| QCA::BigInteger::BigInteger |
( |
const char * | c | ) |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
| c | an alternative initialisation value, encoded as a character array |
◆ BigInteger() [4/6]
| QCA::BigInteger::BigInteger |
( |
const QString & | s | ) |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
| s | an alternative initialisation value, encoded as a string |
◆ BigInteger() [5/6]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
| a | an alternative initialisation value, encoded as SecureArray |
◆ BigInteger() [6/6]
| QCA::BigInteger::BigInteger |
( |
const BigInteger & | from | ) |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
| from | an alternative initialisation value, encoded as a BigInteger |
References BigInteger().
◆ operator=() [1/2]
◆ operator=() [2/2]
| BigInteger & QCA::BigInteger::operator= |
( |
const QString & | s | ) |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
| s | the QString containing an integer representation |
- See also
- bool fromString(const QString &s)
- Note
- it is the application's responsibility to make sure that the QString represents a valid integer (ie it only contains numbers and an optional minus sign at the start)
References BigInteger().
◆ operator+=()
Increment in place operator.
- Parameters
-
| b | the amount to increment by |
References BigInteger().
◆ operator-=()
Decrement in place operator.
- Parameters
-
| b | the amount to decrement by |
References BigInteger().
◆ operator*=()
Multiply in place operator.
- Parameters
-
| b | the amount to multiply by |
References BigInteger().
◆ operator/=()
Divide in place operator.
- Parameters
-
References BigInteger().
◆ operator%=()
Modulo in place operator.
- Parameters
-
References BigInteger().
◆ toArray()
Output BigInteger as a byte array, useful for storage or transmission.
The format is a binary integer in sign-extended network-byte-order.
- See also
- void fromArray(const SecureArray &a);
◆ fromArray()
◆ toString()
| QString QCA::BigInteger::toString |
( |
| ) |
const |
Convert BigInteger to a QString.
QString aString;
aString = aBiggishInteger.toString();
- Examples
- certtest.cpp.
◆ fromString()
| bool QCA::BigInteger::fromString |
( |
const QString & | s | ) |
|
◆ compare()
| int QCA::BigInteger::compare |
( |
const BigInteger & | n | ) |
const |
Compare this value with another BigInteger.
Normally it is more readable to use one of the operator overloads, so you don't need to use this method directly.
- Parameters
-
- Returns
- zero if the values are the same, negative if the argument is less than the value of this BigInteger, and positive if the argument value is greater than this BigInteger
int result;
result = a.compare( b );
result = a.compare( c );
result = b.compare( c );
References BigInteger().
Referenced by operator<(), operator<=(), operator==(), operator>(), and operator>=().
◆ operator==()
| bool QCA::BigInteger::operator== |
( |
const BigInteger & | other | ) |
const |
|
inline |
Equality operator.
Returns true if the two BigInteger values are the same, including having the same sign.
- Parameters
-
References BigInteger(), and compare().
◆ operator!=()
| bool QCA::BigInteger::operator!= |
( |
const BigInteger & | other | ) |
const |
|
inline |
Inequality operator.
Returns true if the two BigInteger values are different in magnitude, sign or both.
- Parameters
-
References BigInteger().
◆ operator<=()
| bool QCA::BigInteger::operator<= |
( |
const BigInteger & | other | ) |
const |
|
inline |
Less than or equal operator.
Returns true if the BigInteger value on the left hand side is equal to or less than the BigInteger value on the right hand side.
- Parameters
-
References BigInteger(), and compare().
◆ operator>=()
| bool QCA::BigInteger::operator>= |
( |
const BigInteger & | other | ) |
const |
|
inline |
Greater than or equal operator.
Returns true if the BigInteger value on the left hand side is equal to or greater than the BigInteger value on the right hand side.
- Parameters
-
References BigInteger(), and compare().
◆ operator<()
| bool QCA::BigInteger::operator< |
( |
const BigInteger & | other | ) |
const |
|
inline |
◆ operator>()
| bool QCA::BigInteger::operator> |
( |
const BigInteger & | other | ) |
const |
|
inline |
◆ operator<<()
| QCA_EXPORT QTextStream & operator<< |
( |
QTextStream & | stream, |
|
|
const BigInteger & | b ) |
|
related |
Stream operator.
- Parameters
-
| stream | the stream to write to |
| b | the integer to write to the stream |
References BigInteger().
The documentation for this class was generated from the following file: