• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KJS-API

KJSObject Class Reference

#include <kjsobject.h>

Inheritance diagram for KJSObject:

Inheritance graph
[legend]

List of all members.


Detailed Description

A class representing a JavaScript value.

Script object

Definition at line 48 of file 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 ()

Constructor & Destructor Documentation

KJSObject::KJSObject (  ) 

Constructs a JavaScript object of the generic Object type.

Definition at line 35 of file kjsobject.cpp.

KJSObject::KJSObject ( const KJSObject &  o  ) 

Constructs on object from another one.

Definition at line 41 of file kjsobject.cpp.

KJSObject::~KJSObject (  ) 

Destructs this object freeing any references it might have held.

Definition at line 57 of file kjsobject.cpp.


Member Function Documentation

bool KJSObject::isBoolean (  )  const

Returns whether this object is a boolean.

Definition at line 137 of file kjsobject.cpp.

bool KJSObject::isNull (  )  const

Returns whether this object is null.

Definition at line 132 of file kjsobject.cpp.

bool KJSObject::isNumber (  )  const

Returns whether this object is a number.

Definition at line 142 of file kjsobject.cpp.

bool KJSObject::isObject (  )  const

Returns whether this object is a full blown object.

Definition at line 152 of file kjsobject.cpp.

bool KJSObject::isString (  )  const

Returns whether this object is a string.

Definition at line 147 of file kjsobject.cpp.

bool KJSObject::isUndefined (  )  const

Returns whether this object is undefined.

Definition at line 127 of file kjsobject.cpp.

KJSObject & KJSObject::operator= ( const KJSObject &  o  ) 

Assigns another JS object references to this one.

Definition at line 47 of file kjsobject.cpp.

KJSObject KJSObject::property ( KJSContext *  ctx,
const QString &  name 
)

Reads the specified property from this object.

This operation might throw an exception.

Definition at line 185 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 237 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 231 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 225 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 219 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 214 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 203 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 157 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 171 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 164 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 178 of file kjsobject.cpp.


The documentation for this class was generated from the following files:
  • kjsobject.h
  • kjsobject.cpp

KJS-API

Skip menu "KJS-API"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal