class KJSO

Main base class for every KJS object. More...

Full nameKJS::KJSO
Definition#include <object.h>
Inherited byBoolean, Completion, Constructor, Function, Global, Null, Number, Object, String, Undefined
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Members

Protected Members


Detailed Description

 KJSO ()

KJSO

Constructor.

 KJSO (Imp *d)

KJSO

 KJSO (const KJSO &)

KJSO

Copy constructor.

KJSO&  operator= (const KJSO &)

operator=

 ~KJSO ()

~KJSO

[virtual]

Destructor.

bool  isNull ()

isNull

[const]

Returns: True if this object is null, i.e. if there is no data attached to this object. Don't confuse this with the Null object.

bool  isDefined ()

isDefined

[const]

Returns: True if this objects is of any other value than Undefined.

Type  type ()

type

[const]

Returns: the type of the object. One of the KJS::Type enums.

bool  isA (Type t)

isA

[const]

Check whether object is of a certain type

Parameters:
ttype to check for

bool  isA (const char *s)

isA

[const]

Check whether object is of a certain type. Allows checking of host objects, too.

Parameters:
typename (Number, Boolean etc.)

bool  isObject ()

isObject

[const]

Use this method when checking for objects. It's safer than checking for a single object type with isA().

bool  derivedFrom (const char *s)

derivedFrom

[const]

Examine the inheritance structure of this object.

Parameters:
tName of the base class.

Returns: True if object is of type t or a derived from such a type.

KJSO  toPrimitive (Type preferred = UndefinedType)

toPrimitive

[const]

Parameters:
preferredOptional hint. Either StringType or NumberType.

Returns: Conversion to primitive type (Undefined, Boolean, Number or String)

Boolean  toBoolean ()

toBoolean

[const]

Returns: Conversion to Boolean type.

Number  toNumber ()

toNumber

[const]

Returns: Conversion to Number type.

double  round ()

round

[const]

Returns: Conversion to double. 0.0 if conversion failed.

Number  toInteger ()

toInteger

[const]

Returns: Conversion to Number type containing an integer value.

int  toInt32 ()

toInt32

[const]

Returns: Conversion to signed integer value.

unsigned int  toUInt32 ()

toUInt32

[const]

Returns: Conversion to unsigned integer value.

unsigned short  toUInt16 ()

toUInt16

[const]

Returns: Conversion to unsigned short value.

String  toString ()

toString

[const]

Returns: Conversion to String type.

Object  toObject ()

toObject

[const]

Returns: Conversion to Object type.

void  setPrototype (const KJSO& p)

setPrototype

Set the internal [[prototype]] property of this object.

Parameters:
pA prototype object.

KJSO  prototype ()

prototype

[const]

Returns: The internal [[prototype]] property.

KJSO  get (const UString &p)

get

[const]

The internal [[Get]] method.

Returns: The value of property p.

bool  hasProperty (const UString &p, bool recursive = true)

hasProperty

[const]

The internal [[HasProperty]] method.

Parameters:
pProperty name.
recursiveIndicates whether prototypes are searched as well.

Returns: Boolean value indicating whether the object already has a member with the given name p.

void  put (const UString &p, const KJSO& v)

put

The internal [[Put]] method. Sets the specified property to the value v.

Parameters:
pProperty name.
vValue.

bool  canPut (const UString &p)

canPut

[const]

The internal [[CanPut]] method.

Parameters:
pProperty name.

Returns: A boolean value indicating whether a [[Put]] operation with p succeed.

bool  deleteProperty (const UString &p)

deleteProperty

The internal [[Delete]] method. Removes the specified property from the object.

Parameters:
pProperty name.

Returns: True if the property was deleted successfully or didn't exist in the first place. False if the DontDelete attribute was set.

void  put (const UString &p, const KJSO& v, int attr)

put

Same as above put() method except the additional attribute. Right now, this only works with native types as Host Objects don't reimplement this method.

Parameters:
attrOne of KJS::Attribute.

void  put (const UString &p, double d, int attr = None)

put

Convenience function for adding a Number property constructed from a double value.

void  put (const UString &p, int i, int attr = None)

put

Convenience function for adding a Number property constructed from an integer value.

void  put (const UString &p, unsigned int u, int attr = None)

put

Convenience function for adding a Number property constructed from an unsigned integer value.

KJSO  getBase ()

getBase

[const]

Reference method.

Returns: Reference base if object is a reference. Throws a ReferenceError otherwise.

UString  getPropertyName ()

getPropertyName

[const]

Reference method.

Returns: Property name of a reference. Null string if object is not a reference.

KJSO  getValue ()

getValue

Reference method.

Returns: Referenced value. This object if no reference.

ErrorType  putValue (const KJSO& v)

putValue

Reference method. Set referenced value to v.

bool  implementsCall ()

implementsCall

[const]

Returns: True if object supports executeCall() method. That's the case for all objects derived from FunctionType.

KJSO  executeCall (const KJSO &thisV, const List *args)

executeCall

Execute function implemented via the Function::execute() method.

Note: check availability via implementsCall() beforehand.

Parameters:
thisVObject serving as the 'this' value.
argsPointer to the list of arguments or null.

Returns: Result of the function call.

void  setConstructor (KJSO c)

setConstructor

Set this object's constructor.

Imp * imp ()

imp

[const]

Returns: A Pointer to the internal implementation.

static int count

count

Imp * rep

rep

[ protected: ]


Generated by: dfaure on Tue Feb 27 12:47:36 2001, using kdoc 2.0a50.