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

KJS

KJS::JSValue

KJS::JSValue Class Reference

#include <value.h>

Inheritance diagram for KJS::JSValue:

Inheritance graph
[legend]

List of all members.


Detailed Description

JSValue is the base type for all primitives (Undefined, Null, Boolean, String, Number) and objects in ECMAScript.

Note: you should never inherit from JSValue as it is for primitive types only (all of which are provided internally by KJS). Instead, inherit from JSObject.

Definition at line 57 of file value.h.


Public Member Functions

JSType type () const
bool isUndefined () const
bool isNull () const
bool isUndefinedOrNull () const
bool isBoolean () const
bool isNumber () const
bool isString () const
bool isObject () const
bool isObject (const ClassInfo *) const
bool getBoolean (bool &) const
bool getBoolean () const
bool getNumber (double &) const
double getNumber () const
bool getString (UString &) const
UString getString () const
JSObject * getObject ()
const JSObject * getObject () const
bool getUInt32 (uint32_t &) const
bool getTruncatedInt32 (int32_t &) const
bool getTruncatedUInt32 (uint32_t &) const
JSValue * toPrimitive (ExecState *exec, JSType preferredType=UnspecifiedType) const
bool getPrimitiveNumber (ExecState *exec, double &number, JSValue *&value)
bool toBoolean (ExecState *exec) const
double toNumber (ExecState *exec) const
JSValue * toJSNumber (ExecState *) const
UString toString (ExecState *exec) const
JSObject * toObject (ExecState *exec) const
double toInteger (ExecState *) const
double toIntegerPreserveNaN (ExecState *) const
int32_t toInt32 (ExecState *) const
int32_t toInt32 (ExecState *, bool &ok) const
uint32_t toUInt32 (ExecState *) const
uint32_t toUInt32 (ExecState *, bool &ok) const
uint16_t toUInt16 (ExecState *exec) const
float toFloat (ExecState *) const
void mark ()
bool marked () const

Static Public Member Functions

static int32_t toInt32 (double)
static int32_t toUInt32 (double)
static int32_t toInt32SlowCase (double, bool &ok)
static uint32_t toUInt32SlowCase (double, bool &ok)

Friends

class JSCell
class Collector

Member Function Documentation

JSType KJS::JSValue::type (  )  const [inline]

Reimplemented in KJS::StringImp, KJS::NumberImp, KJS::GetterSetterImp, KJS::JSObject, and KJS::JSCell.

Definition at line 433 of file value.h.

bool KJS::JSValue::isUndefined (  )  const [inline]

Definition at line 322 of file value.h.

bool KJS::JSValue::isNull (  )  const [inline]

Definition at line 327 of file value.h.

bool KJS::JSValue::isUndefinedOrNull (  )  const [inline]

Definition at line 332 of file value.h.

bool KJS::JSValue::isBoolean (  )  const [inline]

Definition at line 337 of file value.h.

bool KJS::JSValue::isNumber (  )  const [inline]

Reimplemented in KJS::JSCell.

Definition at line 342 of file value.h.

bool KJS::JSValue::isString (  )  const [inline]

Reimplemented in KJS::JSCell.

Definition at line 348 of file value.h.

bool KJS::JSValue::isObject (  )  const [inline]

Reimplemented in KJS::JSCell.

Definition at line 353 of file value.h.

bool KJS::JSValue::isObject ( const ClassInfo *  c  )  const [inline]

Reimplemented in KJS::JSCell.

Definition at line 570 of file object.h.

bool KJS::JSValue::getBoolean ( bool &  v  )  const [inline]

Definition at line 358 of file value.h.

bool KJS::JSValue::getBoolean (  )  const [inline]

Definition at line 368 of file value.h.

bool KJS::JSValue::getNumber ( double &  v  )  const [inline]

Reimplemented in KJS::JSCell.

Definition at line 373 of file value.h.

double KJS::JSValue::getNumber (  )  const [inline]

Reimplemented in KJS::JSCell.

Definition at line 382 of file value.h.

bool KJS::JSValue::getString ( UString &  s  )  const [inline]

Reimplemented in KJS::JSCell.

Definition at line 387 of file value.h.

UString KJS::JSValue::getString (  )  const [inline]

Reimplemented in KJS::JSCell.

Definition at line 392 of file value.h.

JSObject * KJS::JSValue::getObject (  )  [inline]

Reimplemented in KJS::JSCell.

Definition at line 397 of file value.h.

const JSObject * KJS::JSValue::getObject (  )  const [inline]

Reimplemented in KJS::JSCell.

Definition at line 402 of file value.h.

ALWAYS_INLINE bool KJS::JSValue::getUInt32 ( uint32_t &  v  )  const

Reimplemented in KJS::JSCell.

Definition at line 407 of file value.h.

ALWAYS_INLINE bool KJS::JSValue::getTruncatedInt32 ( int32_t &  v  )  const

Reimplemented in KJS::JSCell.

Definition at line 412 of file value.h.

bool KJS::JSValue::getTruncatedUInt32 ( uint32_t &  v  )  const [inline]

Reimplemented in KJS::JSCell.

Definition at line 417 of file value.h.

JSValue * KJS::JSValue::toPrimitive ( ExecState *  exec,
JSType  preferredType = UnspecifiedType 
) const [inline]

Reimplemented in KJS::StringImp, KJS::NumberImp, KJS::GetterSetterImp, KJS::JSObject, and KJS::JSCell.

Definition at line 438 of file value.h.

bool KJS::JSValue::getPrimitiveNumber ( ExecState *  exec,
double &  number,
JSValue *&  value 
) [inline]

Reimplemented in KJS::StringImp, KJS::NumberImp, KJS::GetterSetterImp, KJS::JSObject, and KJS::JSCell.

Definition at line 443 of file value.h.

bool KJS::JSValue::toBoolean ( ExecState *  exec  )  const [inline]

Reimplemented in KJS::StringImp, KJS::NumberImp, KJS::GetterSetterImp, KJS::JSObject, and KJS::JSCell.

Definition at line 453 of file value.h.

ALWAYS_INLINE double KJS::JSValue::toNumber ( ExecState *  exec  )  const

Reimplemented in KJS::StringImp, KJS::NumberImp, KJS::GetterSetterImp, KJS::JSObject, and KJS::JSCell.

Definition at line 458 of file value.h.

ALWAYS_INLINE JSValue * KJS::JSValue::toJSNumber ( ExecState *  exec  )  const

Definition at line 463 of file value.h.

UString KJS::JSValue::toString ( ExecState *  exec  )  const [inline]

Reimplemented in KJS::StringImp, KJS::NumberImp, KJS::GetterSetterImp, KJS::JSObject, and KJS::JSCell.

Definition at line 468 of file value.h.

JSObject * KJS::JSValue::toObject ( ExecState *  exec  )  const [inline]

Reimplemented in KJS::StringImp, KJS::NumberImp, KJS::GetterSetterImp, KJS::JSObject, and KJS::JSCell.

Definition at line 473 of file value.h.

double KJS::JSValue::toInteger ( ExecState *  exec  )  const

Definition at line 60 of file value.cpp.

double KJS::JSValue::toIntegerPreserveNaN ( ExecState *  exec  )  const

Definition at line 69 of file value.cpp.

ALWAYS_INLINE int32_t KJS::JSValue::toInt32 ( ExecState *  exec  )  const

Definition at line 478 of file value.h.

int32_t KJS::JSValue::toInt32 ( ExecState *  exec,
bool &  ok 
) const [inline]

Definition at line 514 of file value.h.

uint32_t KJS::JSValue::toUInt32 ( ExecState *  exec  )  const [inline]

Definition at line 487 of file value.h.

uint32_t KJS::JSValue::toUInt32 ( ExecState *  exec,
bool &  ok 
) const [inline]

Definition at line 524 of file value.h.

uint16_t KJS::JSValue::toUInt16 ( ExecState *  exec  )  const

Definition at line 125 of file value.cpp.

int32_t KJS::JSValue::toInt32 ( double  val  )  [inline, static]

Definition at line 496 of file value.h.

int32_t KJS::JSValue::toUInt32 ( double  val  )  [inline, static]

Definition at line 505 of file value.h.

float KJS::JSValue::toFloat ( ExecState *  exec  )  const

Definition at line 134 of file value.cpp.

void KJS::JSValue::mark (  )  [inline]

Reimplemented in KJS::ArrayInstance, KJS::NativeErrorImp, KJS::Arguments, KJS::ActivationImp, KJS::JSWrapperObject, KJS::GetterSetterImp, KJS::JSObject, KJS::FunctionImp, and KJS::JSCell.

Definition at line 422 of file value.h.

bool KJS::JSValue::marked (  )  const [inline]

Reimplemented in KJS::JSCell.

Definition at line 428 of file value.h.

int32_t KJS::JSValue::toInt32SlowCase ( double  d,
bool &  ok 
) [static]

Definition at line 77 of file value.cpp.

uint32_t KJS::JSValue::toUInt32SlowCase ( double  d,
bool &  ok 
) [static]

Definition at line 102 of file value.cpp.


Friends And Related Function Documentation

friend class JSCell [friend]

Definition at line 58 of file value.h.

friend class Collector [friend]

Reimplemented in KJS::JSCell.

Definition at line 59 of file value.h.


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

KJS

Skip menu "KJS"
  • 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
  •   WTF
  • KJSEmbed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  •   core
  • Phonon
  •   Backend
  • 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