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

kjs

  • kjs
property_map.h
1/*
2 * This file is part of the KDE libraries
3 * Copyright (C) 2003 Apple Computer, Inc.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 *
20 */
21
22#ifndef _KJS_PROPERTY_MAP_H_
23#define _KJS_PROPERTY_MAP_H_
24
25#include "identifier.h"
26
27namespace KJS {
28
29 class Object;
30 class ReferenceList;
31 class ValueImp;
32
33 class SavedProperty;
34
35 struct PropertyMapHashTable;
36
40 class SavedProperties {
41 friend class PropertyMap;
42 public:
43 SavedProperties();
44 ~SavedProperties();
45
46 private:
47 int _count;
48 SavedProperty *_properties;
49
50 SavedProperties(const SavedProperties&);
51 SavedProperties& operator=(const SavedProperties&);
52 };
53
57 struct PropertyMapHashTableEntry
58 {
59 PropertyMapHashTableEntry() : key(0) { }
60 UString::Rep *key;
61 ValueImp *value;
62 int attributes;
63 };
68 class KJS_EXPORT PropertyMap {
69 public:
70 PropertyMap();
71 ~PropertyMap();
72
73 void clear();
74
75 void put(const Identifier &name, ValueImp *value, int attributes);
76 void remove(const Identifier &name);
77 ValueImp *get(const Identifier &name) const;
78 ValueImp *get(const Identifier &name, int &attributes) const;
79
80 void mark() const;
81 void addEnumerablesToReferenceList(ReferenceList &, const Object &) const;
82 void addSparseArrayPropertiesToReferenceList(ReferenceList &, const Object &) const;
83
84 void save(SavedProperties &) const;
85 void restore(const SavedProperties &p);
86
87 private:
88 int hash(const UString::Rep *) const;
89 static bool keysMatch(const UString::Rep *, const UString::Rep *);
90 void expand();
91
92 void insert(UString::Rep *, ValueImp *value, int attributes);
93
94 void checkConsistency();
95
96 typedef PropertyMapHashTableEntry Entry;
97 typedef PropertyMapHashTable Table;
98
99 Table *_table;
100
101 Entry _singleEntry;
102 };
103
104} // namespace
105
106#endif // _KJS_PROPERTY_MAP_H_
KJS::Identifier
Represents an Identifier for a Javascript object.
Definition: identifier.h:32
KJS::Object
Represents an Object.
Definition: object.h:81
KJS::PropertyMap
Javascript Property Map.
Definition: property_map.h:68
KJS::ReferenceList
A list of Reference objects.
Definition: reference_list.h:53
KJS::SavedProperties
Saved Properties.
Definition: property_map.h:40
KJS::ValueImp
ValueImp is the base type for all primitives (Undefined, Null, Boolean, String, Number) and objects i...
Definition: value.h:78
KJS::PropertyMapHashTableEntry
A hashtable entry for the PropertyMap.
Definition: property_map.h:58

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