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

kjs

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

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
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kjs by doxygen 1.8.8
This website is maintained by Timothy Pearson.