kjs Library API Documentation

KJS::ArrayInstanceImp Class Reference

Inheritance diagram for KJS::ArrayInstanceImp:

Inheritance graph
[legend]
Collaboration diagram for KJS::ArrayInstanceImp:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ArrayInstanceImp (ObjectImp *proto, unsigned initialLength)
 ArrayInstanceImp (ObjectImp *proto, const List &initialValues)
 ~ArrayInstanceImp ()
virtual Value get (ExecState *exec, const Identifier &propertyName) const
virtual Value getPropertyByIndex (ExecState *exec, unsigned propertyName) const
virtual void put (ExecState *exec, const Identifier &propertyName, const Value &value, int attr=None)
virtual void putPropertyByIndex (ExecState *exec, unsigned propertyName, const Value &value, int attr=None)
virtual bool hasProperty (ExecState *exec, const Identifier &propertyName) const
virtual bool hasPropertyByIndex (ExecState *exec, unsigned propertyName) const
virtual bool deleteProperty (ExecState *exec, const Identifier &propertyName)
virtual bool deletePropertyByIndex (ExecState *exec, unsigned propertyName)
virtual ReferenceList propList (ExecState *exec, bool recursive)
virtual void mark ()
virtual const ClassInfoclassInfo () const
unsigned getLength () const
void sort (ExecState *exec)
void sort (ExecState *exec, Object &compareFunction)

Static Public Attributes

static const ClassInfo info = {"Array", 0, 0, 0}

Detailed Description

Definition at line 30 of file array_instance.h.


Member Function Documentation

Value ArrayInstanceImp::get ExecState exec,
const Identifier propertyName
const [virtual]
 

Implementation of the [[Get]] internal property (implemented by all Objects).

See also:
Object::get()

Reimplemented from KJS::ObjectImp.

Reimplemented in KJS::ArrayPrototypeImp.

Definition at line 76 of file array_object.cpp.

References KJS::ObjectImp::get(), KJS::lengthPropertyName, KJS::Identifier::toArrayIndex(), and KJS::ValueImp::Value.

void ArrayInstanceImp::put ExecState exec,
const Identifier propertyName,
const Value value,
int  attr = None
[virtual]
 

Implementation of the [[Put]] internal property (implemented by all Objects).

See also:
Object::put()

Reimplemented from KJS::ObjectImp.

Definition at line 111 of file array_object.cpp.

References KJS::Error::create(), KJS::lengthPropertyName, KJS::ObjectImp::put(), putPropertyByIndex(), KJS::ExecState::setException(), KJS::Identifier::toArrayIndex(), KJS::Value::toNumber(), and KJS::Value::toUInt32().

Referenced by KJS::InterpreterImp::initGlobalObject().

bool ArrayInstanceImp::hasProperty ExecState exec,
const Identifier propertyName
const [virtual]
 

Implementation of the [[HasProperty]] internal property (implemented by all Objects).

See also:
Object::hasProperty()

Reimplemented from KJS::ObjectImp.

Definition at line 154 of file array_object.cpp.

References KJS::ObjectImp::hasProperty(), KJS::lengthPropertyName, KJS::UndefinedImp::staticUndefined, and KJS::Identifier::toArrayIndex().

bool ArrayInstanceImp::deleteProperty ExecState exec,
const Identifier propertyName
[virtual]
 

Implementation of the [[Delete]] internal property (implemented by all Objects).

See also:
Object::deleteProperty()

Reimplemented from KJS::ObjectImp.

Definition at line 187 of file array_object.cpp.

References KJS::ObjectImp::deleteProperty(), KJS::lengthPropertyName, and KJS::Identifier::toArrayIndex().

ReferenceList ArrayInstanceImp::propList ExecState exec,
bool  recursive
[virtual]
 

######### check for duplicates with the propertymap

Reimplemented from KJS::ObjectImp.

Definition at line 220 of file array_object.cpp.

References KJS::ReferenceList::append(), KJS::Identifier::from(), KJS::ObjectImp::hasProperty(), KJS::ObjectImp::propList(), and KJS::UndefinedImp::staticUndefined.

virtual const ClassInfo* KJS::ArrayInstanceImp::classInfo  )  const [inline, virtual]
 

A pointer to a ClassInfo struct for this class.

This provides a basic facility for run-time type information, and can be used to check an object's class an inheritance (see inherits()). This should always return a statically declared pointer, or 0 to indicate that there is no class information.

This is primarily useful if you have application-defined classes that you wish to check against for casting purposes.

For example, to specify the class info for classes FooImp and BarImp, where FooImp inherits from BarImp, you would add the following in your class declarations:

   class BarImp : public ObjectImp {
     virtual const ClassInfo *classInfo() const { return &info; }
     static const ClassInfo info;
     // ...
   };

   class FooImp : public ObjectImp {
     virtual const ClassInfo *classInfo() const { return &info; }
     static const ClassInfo info;
     // ...
   };

And in your source file:

   const ClassInfo BarImp::info = {0, 0, 0}; // no parent class
   const ClassInfo FooImp::info = {&BarImp::info, 0, 0};

See also:
inherits()

Reimplemented from KJS::ObjectImp.

Reimplemented in KJS::ArrayPrototypeImp.

Definition at line 48 of file array_instance.h.

References info.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kjs Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Jul 20 13:52:11 2006 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003