• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kjs
 

kjs

  • kjs
array_instance.h
1 // -*- c-basic-offset: 2 -*-
2 /*
3  * This file is part of the KDE libraries
4  * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
5  * Copyright (C) 2003 Apple Computer, Inc.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  */
22 
23 #ifndef ARRAY_INSTANCE_H
24 #define ARRAY_INSTANCE_H
25 
26 #include "object.h"
27 
28 namespace KJS {
29 
30  class ArrayInstanceImp : public ObjectImp {
31  public:
32  ArrayInstanceImp(ObjectImp *proto, unsigned initialLength);
33  ArrayInstanceImp(ObjectImp *proto, const List &initialValues);
34  ~ArrayInstanceImp();
35 
36  virtual Value get(ExecState *exec, const Identifier &propertyName) const;
37  virtual Value getPropertyByIndex(ExecState *exec, unsigned propertyName) const;
38  virtual void put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr = None);
39  virtual void putPropertyByIndex(ExecState *exec, unsigned propertyName, const Value &value, int attr = None);
40  virtual bool hasProperty(ExecState *exec, const Identifier &propertyName) const;
41  virtual bool hasPropertyByIndex(ExecState *exec, unsigned propertyName) const;
42  virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
43  virtual bool deletePropertyByIndex(ExecState *exec, unsigned propertyName);
44  virtual ReferenceList propList(ExecState *exec, bool recursive);
45 
46  virtual void mark();
47 
48  virtual const ClassInfo *classInfo() const { return &info; }
49  static const ClassInfo info;
50 
51  unsigned getLength() const { return length; }
52 
53  void sort(ExecState *exec);
54  void sort(ExecState *exec, Object &compareFunction);
55 
56  private:
57  void setLength(unsigned newLength, ExecState *exec);
58 
59  unsigned pushUndefinedObjectsToEnd(ExecState *exec);
60 
61  void resizeStorage(unsigned);
62 
63  unsigned length;
64  unsigned storageLength;
65  unsigned capacity;
66  ValueImp **storage;
67  };
68 
69 } // namespace KJS
70 
71 #endif
KJS
Definition: array_instance.h:28

kjs

Skip menu "kjs"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kjs

Skip menu "kjs"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kjs by doxygen 1.8.8
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |