KJSObject
#include <kjsobject.h>

Public Member Functions | |
KJSObject () | |
KJSObject (const KJSObject &o) | |
~KJSObject () | |
bool | isBoolean () const |
bool | isNull () const |
bool | isNumber () const |
bool | isObject () const |
bool | isString () const |
bool | isUndefined () const |
KJSObject & | operator= (const KJSObject &o) |
KJSObject | property (KJSContext *ctx, const QString &name) |
void | setProperty (KJSContext *ctx, const QString &name, bool value) |
void | setProperty (KJSContext *ctx, const QString &name, const char *value) |
void | setProperty (KJSContext *ctx, const QString &name, const KJSObject &value) |
void | setProperty (KJSContext *ctx, const QString &name, const QString &value) |
void | setProperty (KJSContext *ctx, const QString &name, double value) |
void | setProperty (KJSContext *ctx, const QString &name, int value) |
bool | toBoolean (KJSContext *ctx) |
int | toInt32 (KJSContext *ctx) |
double | toNumber (KJSContext *ctx) |
QString | toString (KJSContext *ctx) |
Detailed Description
Constructor & Destructor Documentation
◆ KJSObject() [1/2]
KJSObject::KJSObject | ( | ) |
Constructs a JavaScript object of the generic Object type.
Definition at line 36 of file kjsobject.cpp.
◆ KJSObject() [2/2]
KJSObject::KJSObject | ( | const KJSObject & | o | ) |
Constructs on object from another one.
Definition at line 42 of file kjsobject.cpp.
◆ ~KJSObject()
KJSObject::~KJSObject | ( | ) |
Destructs this object freeing any references it might have held.
Definition at line 58 of file kjsobject.cpp.
Member Function Documentation
◆ isBoolean()
bool KJSObject::isBoolean | ( | ) | const |
Returns whether this object is a boolean.
Definition at line 139 of file kjsobject.cpp.
◆ isNull()
bool KJSObject::isNull | ( | ) | const |
Returns whether this object is null.
Definition at line 134 of file kjsobject.cpp.
◆ isNumber()
bool KJSObject::isNumber | ( | ) | const |
Returns whether this object is a number.
Definition at line 144 of file kjsobject.cpp.
◆ isObject()
bool KJSObject::isObject | ( | ) | const |
Returns whether this object is a full blown object.
Definition at line 154 of file kjsobject.cpp.
◆ isString()
bool KJSObject::isString | ( | ) | const |
Returns whether this object is a string.
Definition at line 149 of file kjsobject.cpp.
◆ isUndefined()
bool KJSObject::isUndefined | ( | ) | const |
Returns whether this object is undefined.
Definition at line 129 of file kjsobject.cpp.
◆ operator=()
Assigns another JS object references to this one.
Definition at line 48 of file kjsobject.cpp.
◆ property()
KJSObject KJSObject::property | ( | KJSContext * | ctx, |
const QString & | name | ||
) |
Reads the specified property from this object.
This operation might throw an exception.
Definition at line 187 of file kjsobject.cpp.
◆ setProperty() [1/6]
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 217 of file kjsobject.cpp.
◆ setProperty() [2/6]
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 240 of file kjsobject.cpp.
◆ setProperty() [3/6]
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 206 of file kjsobject.cpp.
◆ setProperty() [4/6]
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 234 of file kjsobject.cpp.
◆ setProperty() [5/6]
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 222 of file kjsobject.cpp.
◆ setProperty() [6/6]
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 228 of file kjsobject.cpp.
◆ toBoolean()
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 159 of file kjsobject.cpp.
◆ toInt32()
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 173 of file kjsobject.cpp.
◆ toNumber()
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 166 of file kjsobject.cpp.
◆ toString()
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 180 of file kjsobject.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 6 2023 03:56:21 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.