KJS-API
KJSObject Class Reference
A class representing a JavaScript value. More...
#include <kjsobject.h>

Public Member Functions | |
bool | isBoolean () const |
bool | isNull () const |
bool | isNumber () const |
bool | isObject () const |
bool | isString () const |
bool | isUndefined () const |
KJSObject (const KJSObject &o) | |
KJSObject () | |
KJSObject & | operator= (const KJSObject &o) |
KJSObject | property (KJSContext *ctx, const QString &name) |
void | setProperty (KJSContext *ctx, const QString &name, const char *value) |
void | setProperty (KJSContext *ctx, const QString &name, const QString &value) |
void | setProperty (KJSContext *ctx, const QString &name, int value) |
void | setProperty (KJSContext *ctx, const QString &name, double value) |
void | setProperty (KJSContext *ctx, const QString &name, bool value) |
void | setProperty (KJSContext *ctx, const QString &name, const KJSObject &value) |
bool | toBoolean (KJSContext *ctx) |
int | toInt32 (KJSContext *ctx) |
double | toNumber (KJSContext *ctx) |
QString | toString (KJSContext *ctx) |
~KJSObject () |
Detailed Description
A class representing a JavaScript value.Script object
Definition at line 48 of file kjsobject.h.
Constructor & Destructor Documentation
KJSObject::KJSObject | ( | ) |
Constructs a JavaScript object of the generic Object type.
Definition at line 36 of file kjsobject.cpp.
KJSObject::KJSObject | ( | const KJSObject & | o | ) |
KJSObject::~KJSObject | ( | ) |
Destructs this object freeing any references it might have held.
Definition at line 58 of file kjsobject.cpp.
Member Function Documentation
bool KJSObject::isBoolean | ( | ) | const |
bool KJSObject::isNull | ( | ) | const |
bool KJSObject::isNumber | ( | ) | const |
bool KJSObject::isObject | ( | ) | const |
bool KJSObject::isString | ( | ) | const |
bool KJSObject::isUndefined | ( | ) | const |
KJSObject KJSObject::property | ( | KJSContext * | ctx, | |
const QString & | name | |||
) |
Reads the specified property from this object.
This operation might throw an exception.
Definition at line 186 of file kjsobject.cpp.
void KJSObject::setProperty | ( | KJSContext * | ctx, | |
const QString & | name, | |||
const char * | value | |||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Accepts a Latin1 encoded, null-terminated string.
Definition at line 238 of file kjsobject.cpp.
void KJSObject::setProperty | ( | KJSContext * | ctx, | |
const QString & | name, | |||
const QString & | value | |||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 232 of file kjsobject.cpp.
void KJSObject::setProperty | ( | KJSContext * | ctx, | |
const QString & | name, | |||
int | value | |||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 226 of file kjsobject.cpp.
void KJSObject::setProperty | ( | KJSContext * | ctx, | |
const QString & | name, | |||
double | value | |||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 220 of file kjsobject.cpp.
void KJSObject::setProperty | ( | KJSContext * | ctx, | |
const QString & | name, | |||
bool | value | |||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 215 of file kjsobject.cpp.
void KJSObject::setProperty | ( | KJSContext * | ctx, | |
const QString & | name, | |||
const KJSObject & | value | |||
) |
Sets the specified property on this object.
This operation might throw an exception.
Definition at line 204 of file kjsobject.cpp.
bool KJSObject::toBoolean | ( | KJSContext * | ctx | ) |
Returns this value converted to a boolean.
If the conversion fails the context will have an exception set.
Definition at line 158 of file kjsobject.cpp.
int KJSObject::toInt32 | ( | KJSContext * | ctx | ) |
Returns this value converted to a 32-bit integer number.
NaN, positive and negative Infinity will be converted to 0. If the conversion fails the context will have an exception set.
Definition at line 172 of file kjsobject.cpp.
double KJSObject::toNumber | ( | KJSContext * | ctx | ) |
Returns this value converted to a number.
If the conversion fails the context will have an exception set.
Definition at line 165 of file kjsobject.cpp.
QString KJSObject::toString | ( | KJSContext * | ctx | ) |
Returns this value converted to a string.
If the conversion fails the context will have an exception set.
Definition at line 179 of file kjsobject.cpp.
The documentation for this class was generated from the following files: