Skip to content
Skip to link menu
Trinity API Reference
Trinity API Reference
kjs
kjs
kjs
property_map.h
1
// -*- c-basic-offset: 2 -*-
2
/*
3
* This file is part of the KDE libraries
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 Library 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
* Library General Public License for more details.
15
*
16
* You should have received a copy of the GNU Library General Public License
17
* along with this library; see the file COPYING.LIB. If not, write to
18
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19
* Boston, MA 02110-1301, USA.
20
*
21
*/
22
23
#ifndef _KJS_PROPERTY_MAP_H_
24
#define _KJS_PROPERTY_MAP_H_
25
26
#include "identifier.h"
27
28
namespace
KJS {
29
30
class
Object;
31
class
ReferenceList;
32
class
ValueImp;
33
34
class
SavedProperty;
35
36
struct
PropertyMapHashTable;
37
41
class
SavedProperties
{
42
friend
class
PropertyMap
;
43
public
:
44
SavedProperties
();
45
~
SavedProperties
();
46
47
private
:
48
int
_count;
49
SavedProperty *_properties;
50
51
SavedProperties
(
const
SavedProperties
&);
52
SavedProperties
& operator=(
const
SavedProperties
&);
53
};
54
58
struct
PropertyMapHashTableEntry
59
{
60
PropertyMapHashTableEntry
() : key(0) { }
61
UString::Rep *key;
62
ValueImp
*value;
63
int
attributes;
64
};
69
class
KJS_EXPORT
PropertyMap
{
70
public
:
71
PropertyMap
();
72
~
PropertyMap
();
73
74
void
clear();
75
76
void
put(
const
Identifier
&name,
ValueImp
*value,
int
attributes);
77
void
remove
(
const
Identifier
&name);
78
ValueImp
*
get
(
const
Identifier
&name)
const
;
79
ValueImp
*
get
(
const
Identifier
&name,
int
&attributes)
const
;
80
81
void
mark()
const
;
82
void
addEnumerablesToReferenceList(
ReferenceList
&,
const
Object
&)
const
;
83
void
addSparseArrayPropertiesToReferenceList(
ReferenceList
&,
const
Object
&)
const
;
84
85
void
save(
SavedProperties
&)
const
;
86
void
restore(
const
SavedProperties
&p);
87
88
private
:
89
int
hash(
const
UString::Rep *)
const
;
90
static
bool
keysMatch(
const
UString::Rep *,
const
UString::Rep *);
91
void
expand();
92
93
void
insert(UString::Rep *,
ValueImp
*value,
int
attributes);
94
95
void
checkConsistency();
96
97
typedef
PropertyMapHashTableEntry
Entry
;
98
typedef
PropertyMapHashTable Table;
99
100
Table *_table;
101
102
Entry
_singleEntry;
103
};
104
105
}
// namespace
106
107
#endif // _KJS_PROPERTY_MAP_H_
KJS::PropertyMapHashTableEntry
A hashtable entry for the PropertyMap.
Definition:
property_map.h:58
KJS::Object
Represents an Object.
Definition:
object.h:82
KJS::SavedProperties
Saved Properties.
Definition:
property_map.h:41
KJS::ValueImp
ValueImp is the base type for all primitives (Undefined, Null, Boolean, String, Number) and objects i...
Definition:
value.h:79
KJS::ReferenceList
A list of Reference objects.
Definition:
reference_list.h:54
KJS::Identifier
Represents an Identifier for a Javascript object.
Definition:
identifier.h:32
KJS::PropertyMap
Javascript Property Map.
Definition:
property_map.h:69
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