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

KJS

KJS::ArrayInstance

KJS::ArrayInstance Class Reference

#include <array_instance.h>

Inheritance diagram for KJS::ArrayInstance:

Inheritance graph
[legend]

List of all members.


Detailed Description

Definition at line 30 of file array_instance.h.


Public Member Functions

 ArrayInstance (JSObject *proto, unsigned initialLength)
 ArrayInstance (JSObject *proto, const List &initialValues)
 ~ArrayInstance ()
virtual bool getOwnPropertySlot (ExecState *, const Identifier &, PropertySlot &)
virtual bool getOwnPropertySlot (ExecState *, unsigned, PropertySlot &)
virtual void put (ExecState *exec, const Identifier &propertyName, JSValue *value, int attr=None)
virtual void put (ExecState *exec, unsigned propertyName, JSValue *value, int attr=None)
virtual bool deleteProperty (ExecState *exec, const Identifier &propertyName)
virtual bool deleteProperty (ExecState *exec, unsigned propertyName)
virtual void getPropertyNames (ExecState *, PropertyNameArray &)
virtual void mark ()
virtual const ClassInfo * classInfo () const
unsigned getLength () const
JSValue * getItem (unsigned) const
void sort (ExecState *exec)
void sort (ExecState *exec, JSObject *compareFunction)

Static Public Attributes

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

Constructor & Destructor Documentation

ArrayInstance::ArrayInstance ( JSObject *  proto,
unsigned  initialLength 
)

Definition at line 81 of file array_object.cpp.

ArrayInstance::ArrayInstance ( JSObject *  proto,
const List &  initialValues 
)

Definition at line 89 of file array_object.cpp.

ArrayInstance::~ArrayInstance (  ) 

Definition at line 102 of file array_object.cpp.


Member Function Documentation

bool ArrayInstance::getOwnPropertySlot ( ExecState *  exec,
const Identifier &  propertyName,
PropertySlot &  slot 
) [virtual]

Reimplemented from KJS::JSObject.

Reimplemented in KJS::ArrayPrototype.

Definition at line 122 of file array_object.cpp.

bool ArrayInstance::getOwnPropertySlot ( ExecState *  exec,
unsigned  index,
PropertySlot &  slot 
) [virtual]

Reimplemented from KJS::JSObject.

Definition at line 146 of file array_object.cpp.

void ArrayInstance::put ( ExecState *  exec,
const Identifier &  propertyName,
JSValue *  value,
int  attr = None 
) [virtual]

Sets the specified property.

See ECMA 8.6.2.2

Parameters:
exec The current execution state
propertyName The name of the property to set
propertyValue The value to set

Reimplemented from KJS::JSObject.

Definition at line 165 of file array_object.cpp.

void ArrayInstance::put ( ExecState *  exec,
unsigned  propertyName,
JSValue *  value,
int  attr = None 
) [virtual]

Reimplemented from KJS::JSObject.

Definition at line 187 of file array_object.cpp.

bool ArrayInstance::deleteProperty ( ExecState *  exec,
const Identifier &  propertyName 
) [virtual]

Removes the specified property from the object.

See ECMA 8.6.2.5

Parameters:
exec The current execution state
propertyName The name of the property to delete
Returns:
true if the property was successfully deleted or did not exist on the object. false if deleting the specified property is not allowed.

Reimplemented from KJS::JSObject.

Definition at line 213 of file array_object.cpp.

bool ArrayInstance::deleteProperty ( ExecState *  exec,
unsigned  propertyName 
) [virtual]

Reimplemented from KJS::JSObject.

Definition at line 232 of file array_object.cpp.

void ArrayInstance::getPropertyNames ( ExecState *  exec,
PropertyNameArray &  propertyNames 
) [virtual]

Reimplemented from KJS::JSObject.

Definition at line 247 of file array_object.cpp.

void ArrayInstance::mark (  )  [virtual]

Reimplemented from KJS::JSObject.

Definition at line 309 of file array_object.cpp.

virtual const ClassInfo* KJS::ArrayInstance::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 JSObject {
     virtual const ClassInfo *classInfo() const { return &info; }
     static const ClassInfo info;
     // ...
   };

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

And in your source file:

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

See also:
inherits()

Reimplemented from KJS::JSObject.

Reimplemented in KJS::ArrayPrototype.

Definition at line 46 of file array_instance.h.

unsigned KJS::ArrayInstance::getLength (  )  const [inline]

Definition at line 49 of file array_instance.h.

JSValue * ArrayInstance::getItem ( unsigned  i  )  const

Definition at line 107 of file array_object.cpp.

void ArrayInstance::sort ( ExecState *  exec  ) 

Definition at line 336 of file array_object.cpp.

void ArrayInstance::sort ( ExecState *  exec,
JSObject *  compareFunction 
)

Definition at line 403 of file array_object.cpp.


Member Data Documentation

const ClassInfo ArrayInstance::info = {"Array", 0, 0, 0} [static]

Reimplemented in KJS::ArrayPrototype.

Definition at line 47 of file array_instance.h.


The documentation for this class was generated from the following files:
  • array_instance.h
  • array_object.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