KJS::Number Class Reference
#include <value.h>
Inheritance diagram for KJS::Number:
Public Member Functions | |
Number (int i) | |
Number (unsigned int u) | |
Number (double d=0.0) | |
Number (long int l) | |
Number (long unsigned int l) | |
double | value () const |
int | intValue () const |
bool | isNaN () const |
bool | isInf () const |
Public Member Functions inherited from KJS::Value | |
Value (ValueImp *v) | |
Value (const Value &v) | |
Value & | operator= (const Value &v) |
bool | isValid () const |
bool | isNull () const |
ValueImp * | imp () const |
Type | type () const |
bool | isA (Type t) const |
Value | toPrimitive (ExecState *exec, Type preferredType=UnspecifiedType) const |
bool | toBoolean (ExecState *exec) const |
double | toNumber (ExecState *exec) const |
int | toInteger (ExecState *exec) const |
int | toInt32 (ExecState *exec) const |
unsigned int | toUInt32 (ExecState *exec) const |
unsigned short | toUInt16 (ExecState *exec) const |
UString | toString (ExecState *exec) const |
Object | toObject (ExecState *exec) const |
bool | toUInt32 (unsigned &i) const |
Static Public Member Functions | |
static Number | dynamicCast (const Value &v) |
Friends | |
class | ValueImp |
class | NumberImp |
Additional Inherited Members | |
Protected Attributes inherited from KJS::Value | |
ValueImp * | rep |
Detailed Description
Member Function Documentation
◆ dynamicCast()
Converts a Value into an Number.
If the value's type is not NumberType, a null object will be returned (i.e. one with it's internal pointer set to 0). If you do not know for sure whether the value is of type NumberType, you should check the isNull() methods afterwards before calling any methods on the returned value.
- Returns
- The value converted to a Number
The documentation for this class was generated from the following files: