|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
�PREV CLASS�� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class CNumber { public: CNumber(); CNumber(int nValue); CNumber(double dblValue); ~CNumber(); public: bool IsInt32(); double GetDouble(); long GetInt32(); unsigned long GetUint32(); unsigned short GetUint16(); CNumber operator=(CNumber numValue); CNumber operator-(); CNumber operator~(); friend CNumber operator*(CNumber numValue1, CNumber numValue2); friend CNumber operator/(CNumber numValue1, CNumber numValue2); friend CNumber operator%(CNumber numValue1, CNumber numValue2); friend CNumber operator+(CNumber numValue1, CNumber numValue2); friend CNumber operator-(CNumber numValue1, CNumber numValue2); friend CNumber operator<<(CNumber numValue1, CNumber numValue2); friend CNumber operator>>(CNumber numValue1, CNumber numValue2); CNumber UnsignedRightShift(CNumber numValue); friend bool operator<(CNumber numValue1, CNumber numValue2); friend bool operator>(CNumber numValue1, CNumber numValue2); friend bool operator<=(CNumber numValue1, CNumber numValue2); friend bool operator>=(CNumber numValue1, CNumber numValue2); friend bool operator==(CNumber numValue1, CNumber numValue2); friend bool operator!=(CNumber numValue1, CNumber numValue2); friend CNumber operator&(CNumber numValue1, CNumber numValue2); friend CNumber operator|(CNumber numValue1, CNumber numValue2); friend CNumber operator^(CNumber numValue1, CNumber numValue2); bool IsNaN(); bool IsPositiveZero(); bool IsNegativeZero(); bool IsPositiveInfinity(); bool IsNegativeInfinity(); static CNumber MaxValue(); static CNumber MinValue(); static CNumber NaN(); static CNumber NegativeZero(); static CNumber NegativeInfinity(); static CNumber PositiveInfinity(); CString ToString(); CNumber ToInteger(); CNumber ToInt32(); CNumber ToUInt32(); CNumber ToUInt16(); static bool ParseString( const CString &strValue, CNumber &numResult); static bool ParseLiteral( const CString &strValue, CNumber &numResult); static bool ParseInteger( const CString &strValue, int nRadix, CNumber &numResult); static bool ParseDecimal( const CString &strValue, CNumber &numResult, bool bSign); };
The ECMAScript number.
Constructor/Destructor Summary | |
CNumber
();
����������Constructs the number. |
|
CNumber
(int nValue);
����������Constructs the number with the specified integer value. |
|
CNumber
(double dblValue);
����������Constructs the number with the specified real value. |
|
~CNumber
();
����������Destroys the number. |
Function Summary | |
bool
|
IsInt32
();
����������Tests whether this number is a 32-bit integer. |
double
|
GetDouble
();
����������Returns the real value represented by this number. |
long
|
GetInt32
();
����������Converts this number to a 32-bit integer. |
unsigned�long
|
GetUint32
();
����������Converts this number to an unsigned 32-bit integer. |
unsigned�short
|
GetUint16
();
����������Converts this number to an unsigned 16-bit integer. |
CNumber
|
operator=
(CNumber numValue);
����������Assigns the new value to this number. |
CNumber
|
operator-
();
����������Performs the unary minus operation. |
CNumber
|
operator~
();
����������Performs the bitwise NOT operation. |
CNumber
|
operator*
(CNumber numValue1, CNumber numValue2);
����������Performs the multiplication operation. |
CNumber
|
operator/
(CNumber numValue1, CNumber numValue2);
����������Performs the division operation. |
CNumber
|
operator%
(CNumber numValue1, CNumber numValue2);
����������Performs the ECMAScript remainder operation. |
CNumber
|
operator+
(CNumber numValue1, CNumber numValue2);
����������Performs the addition operation. |
CNumber
|
operator-
(CNumber numValue1, CNumber numValue2);
����������Performs the subtraction operation. |
CNumber
|
operator<<
(CNumber numValue1, CNumber numValue2);
����������Performs the left shift operation. |
CNumber
|
operator>>
(CNumber numValue1, CNumber numValue2);
����������Performs the right shift operation. |
CNumber
|
UnsignedRightShift
(CNumber numValue);
����������Performs the unsigned right shift operation. |
bool
|
operator<
(CNumber numValue1, CNumber numValue2);
����������Performs the less-than comparison operation. |
bool
|
operator>
(CNumber numValue1, CNumber numValue2);
����������Performs the greater-than comparison operation. |
bool
|
operator<=
(CNumber numValue1, CNumber numValue2);
����������Performs the less-than-or-equal comparison operation. |
bool
|
operator>=
(CNumber numValue1, CNumber numValue2);
����������Performs the greater-than-or-equal comparison operation. |
bool
|
operator==
(CNumber numValue1, CNumber numValue2);
����������Performs the equals comparison operation. |
bool
|
operator!=
(CNumber numValue1, CNumber numValue2);
����������Performs the does-not-equal comparison operation. |
CNumber
|
operator&
(CNumber numValue1, CNumber numValue2);
����������Performs the bitwise AND operation. |
CNumber
|
operator|
(CNumber numValue1, CNumber numValue2);
����������Performs the bitwise OR operation. |
CNumber
|
operator^
(CNumber numValue1, CNumber numValue2);
����������Performs the bitwise XOR operation. |
bool
|
IsNaN
();
����������Tests whether this number represents NaN. |
bool
|
IsPositiveZero
();
����������Tests whether this number represents a positive zero. |
bool
|
IsNegativeZero
();
����������Tests whether this number represents a negative zero. |
bool
|
IsPositiveInfinity
();
����������Tests whether this number represents a positive infinity. |
bool
|
IsNegativeInfinity
();
����������Tests whether this number represents a negative infinity. |
CNumber
|
MaxValue
();
����������Returns the maximum finite number. |
CNumber
|
MinValue
();
����������Returns the minimum finite number. |
CNumber
|
NaN
();
����������Returns the number representing NaN. |
CNumber
|
NegativeZero
();
����������Returns the number representing a negative zero. |
CNumber
|
NegativeInfinity
();
����������Returns the number representing a negative infinity. |
CNumber
|
PositiveInfinity
();
����������Returns the number representing a positive infinity. |
CString
|
ToString
();
����������Converts this number to a string. |
CNumber
|
ToInteger
();
����������Converts this number to an integer. |
CNumber
|
ToInt32
();
����������Converts this number to a 32-bit integer. |
CNumber
|
ToUInt32
();
����������Converts this number to a 32-bit unsigned integer. |
CNumber
|
ToUInt16
();
����������Converts this number to a 16-bit unsigned integer. |
bool
|
ParseString
(const CString &strValue, CNumber &numResult);
����������Parses the string representation of number conforming to the StrDecimalLiteral
syntax defined by ECMAScript. |
bool
|
ParseLiteral
(const CString &strValue, CNumber &numResult);
����������Parses the string representation of number conforming to the DecimalLiteral
syntax defined by ECMAScript. |
bool
|
ParseInteger
(const CString &strValue, int nRadix, CNumber &numResult);
����������Parses the string representation of number conforming to the syntax required for the parseInt
function defined by ECMAScript. |
bool
|
ParseDecimal
(const CString &strValue, CNumber &numResult, bool bSign);
����������Parses the string representation of a decimal value. |
Constructor/Destructor Detail |
CNumber();
Constructs the number.
This number is assigned the value
0
.
CNumber(int nValue);
Constructs the number with the specified integer value.
nValue
- the integer value of this numberCNumber(double dblValue);
Constructs the number with the specified real value.
dblValue
- the real value of this number~CNumber();
Destroys the number.
Function Detail |
bool IsInt32();
Tests whether this number is a 32-bit integer.
true
if this number is a 32-bit integer;
false
otherwisedouble GetDouble();
Returns the real value represented by this number.
long GetInt32();
Converts this number to a 32-bit integer.
unsigned long GetUint32();
Converts this number to an unsigned 32-bit integer.
unsigned short GetUint16();
Converts this number to an unsigned 16-bit integer.
CNumber operator=(CNumber numValue);
Assigns the new value to this number.
numValue
- the value to assignCNumber operator-();
Performs the unary minus operation.
This number remains unchanged.
CNumber operator~();
Performs the bitwise NOT operation.
This number remains unchanged.
friend CNumber operator*(CNumber numValue1, CNumber numValue2);
Performs the multiplication operation.
numValue1
- the left-hand operandnumValue2
- the right-hand operandfriend CNumber operator/(CNumber numValue1, CNumber numValue2);
Performs the division operation.
numValue1
- the left-hand operandnumValue2
- the right-hand operandfriend CNumber operator%(CNumber numValue1, CNumber numValue2);
Performs the ECMAScript remainder operation.
numValue1
- the left-hand operandnumValue2
- the right-hand operandfriend CNumber operator+(CNumber numValue1, CNumber numValue2);
Performs the addition operation.
numValue1
- the left-hand operandnumValue2
- the right-hand operandfriend CNumber operator-(CNumber numValue1, CNumber numValue2);
Performs the subtraction operation.
numValue1
- the left-hand operandnumValue2
- the right-hand operandfriend CNumber operator<<(CNumber numValue1, CNumber numValue2);
Performs the left shift operation.
numValue1
- the left-hand operandnumValue2
- the right-hand operandfriend CNumber operator>>(CNumber numValue1, CNumber numValue2);
Performs the right shift operation.
numValue1
- the left-hand operandnumValue2
- the right-hand operandCNumber UnsignedRightShift(CNumber numValue);
Performs the unsigned right shift operation.
This number serves as the left-hand operand and remains unchanged.
numValue
- the right-hand operandfriend bool operator<(CNumber numValue1, CNumber numValue2);
Performs the less-than comparison operation.
numValue1
- the left-hand operandnumValue2
- the right-hand operandfriend bool operator>(CNumber numValue1, CNumber numValue2);
Performs the greater-than comparison operation.
numValue1
- the left-hand operandnumValue2
- the right-hand operandfriend bool operator<=(CNumber numValue1, CNumber numValue2);
Performs the less-than-or-equal comparison operation.
numValue1
- the left-hand operandnumValue2
- the right-hand operandfriend bool operator>=(CNumber numValue1, CNumber numValue2);
Performs the greater-than-or-equal comparison operation.
numValue1
- the left-hand operandnumValue2
- the right-hand operandfriend bool operator==(CNumber numValue1, CNumber numValue2);
Performs the equals comparison operation.
numValue1
- the left-hand operandnumValue2
- the right-hand operandfriend bool operator!=(CNumber numValue1, CNumber numValue2);
Performs the does-not-equal comparison operation.
numValue1
- the left-hand operandnumValue2
- the right-hand operandfriend CNumber operator&(CNumber numValue1, CNumber numValue2);
Performs the bitwise AND operation.
numValue1
- the left-hand operandnumValue2
- the right-hand operandfriend CNumber operator|(CNumber numValue1, CNumber numValue2);
Performs the bitwise OR operation.
numValue1
- the left-hand operandnumValue2
- the right-hand operandfriend CNumber operator^(CNumber numValue1, CNumber numValue2);
Performs the bitwise XOR operation.
numValue1
- the left-hand operandnumValue2
- the right-hand operandbool IsNaN();
Tests whether this number represents NaN.
true
if this number represents NaN;
false
otherwisebool IsPositiveZero();
Tests whether this number represents a positive zero.
true
if this number represents a positive zero;
false
otherwisebool IsNegativeZero();
Tests whether this number represents a negative zero.
true
if this number represents a negative zero;
false
otherwisebool IsPositiveInfinity();
Tests whether this number represents a positive infinity.
true
if this number represents a positive infinity;
false
otherwisebool IsNegativeInfinity();
Tests whether this number represents a negative infinity.
true
if this number represents a negative infinity;
false
otherwisestatic CNumber MaxValue();
Returns the maximum finite number.
static CNumber MinValue();
Returns the minimum finite number.
static CNumber NaN();
Returns the number representing NaN.
static CNumber NegativeZero();
Returns the number representing a negative zero.
static CNumber NegativeInfinity();
Returns the number representing a negative infinity.
static CNumber PositiveInfinity();
Returns the number representing a positive infinity.
CString ToString();
Converts this number to a string.
The result of conversion is returned; this number remains unchanged.
CNumber ToInteger();
Converts this number to an integer.
This number remains unchanged.
CNumber ToInt32();
Converts this number to a 32-bit integer.
This number remains unchanged.
CNumber ToUInt32();
Converts this number to a 32-bit unsigned integer.
This number remains unchanged.
CNumber ToUInt16();
Converts this number to a 16-bit unsigned integer.
This number remains unchanged.
static bool ParseString( const CString &strValue, CNumber &numResult);
Parses the string representation of number
conforming to the
StrDecimalLiteral
syntax defined by ECMAScript.
strValue
- the string to parsenumResult
- on return, the result number if parsing succeeded;
unspecified otherwisetrue
if parsing succeeded;
false
otherwisestatic bool ParseLiteral( const CString &strValue, CNumber &numResult);
Parses the string representation of number
conforming to the
DecimalLiteral
syntax defined by ECMAScript.
strValue
- the string to parsenumResult
- on return, the result number if parsing succeeded;
unspecified otherwisetrue
if parsing succeeded;
false
otherwisestatic bool ParseInteger( const CString &strValue, int nRadix, CNumber &numResult);
Parses the string representation of number conforming to
the syntax required for the
parseInt
function defined by ECMAScript.
strValue
- the string to parsenRadix
- the radix value between 2 and 36numResult
- on return, the result number if parsing succeeded;
unspecified otherwisetrue
if parsing succeeded;
false
otherwisestatic bool ParseDecimal( const CString &strValue, CNumber &numResult, bool bSign);
Parses the string representation of a decimal value.
This is a miscellaneous function used by
ParseString
and
ParseLiteral
.
strValue
- the string to parsenumResult
- on return, the result number if parsing succeeded;
unspecified otherwisebSign
- indicates whether the plus or minus
sign is allowed in the source stringtrue
if parsing succeeded;
false
otherwise
|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
�PREV CLASS�� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |