author | Stefan Vogel <sv@exept.de> |
Wed, 19 Aug 2009 20:08:45 +0200 | |
changeset 11866 | b2c6e6d23adc |
parent 11699 | 36f3cff10f30 |
child 11873 | cbc08817ae5d |
permissions | -rw-r--r-- |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
8726 | 3 |
All Rights Reserved |
1 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
5340
cdc42cba8f01
add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents:
5296
diff
changeset
|
12 |
"{ Package: 'stx:libbasic' }" |
cdc42cba8f01
add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents:
5296
diff
changeset
|
13 |
|
719
c557a530f971
dont appending a chunk-separator to the initial copyright
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
14 |
ClassDescription subclass:#Class |
8756 | 15 |
instanceVariableNames:'name category classvars comment subclasses classFilename package |
16 |
revision environment signature attributes' |
|
17 |
classVariableNames:'DefaultCategoryForSTV DefaultCategoryForVAGE |
|
18 |
DefaultCategoryForDolphin' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'Kernel-Classes' |
|
1 | 21 |
! |
22 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
23 |
Object subclass:#ClassAttributes |
8756 | 24 |
instanceVariableNames:'primitiveDefinitions primitiveVariables primitiveFunctions |
25 |
sharedPools' |
|
26 |
classVariableNames:'' |
|
27 |
poolDictionaries:'' |
|
28 |
privateIn:Class |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
29 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
30 |
|
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
31 |
Object subclass:#SimulatedClassPool |
8756 | 32 |
instanceVariableNames:'class' |
33 |
classVariableNames:'' |
|
34 |
poolDictionaries:'' |
|
35 |
privateIn:Class |
|
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
36 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
37 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
38 |
Association subclass:#SimulatedVariableBinding |
8756 | 39 |
instanceVariableNames:'' |
40 |
classVariableNames:'' |
|
41 |
poolDictionaries:'' |
|
42 |
privateIn:Class::SimulatedClassPool |
|
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
43 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
44 |
|
1739 | 45 |
!Class class methodsFor:'documentation'! |
68 | 46 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
47 |
copyright |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
48 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
49 |
COPYRIGHT (c) 1989 by Claus Gittinger |
8726 | 50 |
All Rights Reserved |
527
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
51 |
|
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
52 |
This software is furnished under a license and may be used |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
53 |
only in accordance with the terms of that license and with the |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
54 |
inclusion of the above copyright notice. This software may not |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
55 |
be provided or otherwise made available to, or used by, any |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
56 |
other person. No title to or ownership of the software is |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
57 |
hereby transferred. |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
58 |
" |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
59 |
! |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
60 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
61 |
documentation |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
62 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
63 |
Class adds more functionality to classes; minimum stuff has already |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
64 |
been defined in Behavior and ClassDescription; this adds naming, categories etc. |
68 | 65 |
|
1287 | 66 |
[Instance variables:] |
67 |
||
8726 | 68 |
name <Symbol> the classes name |
69 |
||
70 |
category <Symbol> the classes category |
|
71 |
||
72 |
classvars <String> the names of the class variables |
|
73 |
| <Collection of words> |
|
74 |
||
75 |
comment <String> the classes comment; either a string, |
|
76 |
a number specifying the offset in classFilename, or nil |
|
77 |
||
78 |
subclasses <Collection> cached collection of subclasses |
|
79 |
(currently unused - but will be soon) |
|
80 |
||
81 |
classFilename <String> the file (or nil) where the classes |
|
82 |
sources are found |
|
83 |
||
84 |
package <Symbol> the package, in which the class was defined |
|
85 |
(inserted by compilers) |
|
86 |
||
87 |
revision <String> revision string - inserted by stc |
|
88 |
||
89 |
environment <Symbol | nil> cached environment (i.e. Smalltalk or a namespace) |
|
90 |
||
91 |
signature <SmallInteger> the classes signature (used to detect obsolete |
|
92 |
or changed classes with binaryStorage) |
|
93 |
This is filled in lazy - i.e. upon the first signature query. |
|
94 |
||
95 |
attributes <Array | nil> describes primitiveIncludes, primitiveFunctions etc. |
|
96 |
also a place to add additional attributes, |
|
97 |
without a need to recompile all classes. |
|
1923
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
98 |
|
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
99 |
|
68 | 100 |
WARNING: layout known by compiler and runtime system |
1287 | 101 |
|
102 |
[author:] |
|
8726 | 103 |
Claus Gittinger |
1669 | 104 |
|
105 |
[see also:] |
|
8726 | 106 |
Behavior ClassDescription Metaclass |
68 | 107 |
" |
662 | 108 |
! ! |
68 | 109 |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
110 |
!Class class methodsFor:'accessing-flags'! |
362 | 111 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
112 |
tryLocalSourceFirst |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
113 |
^ TryLocalSourceFirst |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
114 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
115 |
"Created: 24.1.1996 / 19:55:35 / cg" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
116 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
117 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
118 |
tryLocalSourceFirst:aBoolean |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
119 |
TryLocalSourceFirst := aBoolean |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
120 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
121 |
"Created: 24.1.1996 / 19:55:35 / cg" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
122 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
123 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
124 |
updateChanges:aBoolean |
858 | 125 |
"turn on/off changes management. Return the prior value of the flag. |
8551 | 126 |
This value is used as a default fallback - a querySignal handler may still |
858 | 127 |
decide to return something else." |
362 | 128 |
|
129 |
|prev| |
|
130 |
||
555 | 131 |
prev := UpdatingChanges. |
132 |
UpdatingChanges := aBoolean. |
|
362 | 133 |
^ prev |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
134 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
135 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
136 |
updatingChanges |
858 | 137 |
"return true if changes are recorded. |
138 |
The value returned here is the default fallback - a querySignal handler may still |
|
139 |
decide to return something else." |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
140 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
141 |
^ UpdatingChanges |
1 | 142 |
! ! |
143 |
||
10474
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
144 |
!Class class methodsFor:'creating new classes'! |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
145 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
146 |
name:newName |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
147 |
subclassOf:aClass |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
148 |
instanceVariableNames:stringOfInstVarNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
149 |
category:categoryString |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
150 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
151 |
"this new instance creation protocol will replace the traditional inst-creation messages" |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
152 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
153 |
^ self |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
154 |
name:newName |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
155 |
subclassOf:aClass |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
156 |
instanceVariableNames:stringOfInstVarNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
157 |
classVariableNames:nil |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
158 |
poolDictionaries:nil |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
159 |
category:categoryString |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
160 |
! |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
161 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
162 |
name:newName |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
163 |
subclassOf:aClass |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
164 |
instanceVariableNames:stringOfInstVarNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
165 |
classVariableNames:stringOfClassVarNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
166 |
category:categoryString |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
167 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
168 |
"this new instance creation protocol will replace the traditional inst-creation messages" |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
169 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
170 |
^ self |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
171 |
name:newName |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
172 |
subclassOf:aClass |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
173 |
instanceVariableNames:stringOfInstVarNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
174 |
classVariableNames:stringOfClassVarNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
175 |
poolDictionaries:nil |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
176 |
category:categoryString |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
177 |
! |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
178 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
179 |
name:newName |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
180 |
subclassOf:aClass |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
181 |
instanceVariableNames:stringOfInstVarNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
182 |
classVariableNames:stringOfClassVarNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
183 |
classInstanceVariableNames:stringOfClassInstVarNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
184 |
poolDictionaries:stringOfPoolNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
185 |
category:categoryString |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
186 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
187 |
"this new instance creation protocol will replace the traditional inst-creation messages" |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
188 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
189 |
^ self class |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
190 |
name:newName |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
191 |
inEnvironment:Smalltalk |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
192 |
subclassOf:aClass |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
193 |
instanceVariableNames:stringOfInstVarNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
194 |
variable:false |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
195 |
words:false |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
196 |
pointers:false |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
197 |
classVariableNames:stringOfClassVarNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
198 |
poolDictionaries:stringOfPoolNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
199 |
category:categoryString |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
200 |
comment:nil |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
201 |
changed:false |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
202 |
classInstanceVariableNames:stringOfClassInstVarNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
203 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
204 |
"Modified: 16.6.1997 / 11:53:58 / cg" |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
205 |
! |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
206 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
207 |
name:newName |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
208 |
subclassOf:aClass |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
209 |
instanceVariableNames:stringOfInstVarNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
210 |
classVariableNames:stringOfClassVarNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
211 |
poolDictionaries:stringOfPoolNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
212 |
category:categoryString |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
213 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
214 |
"this new instance creation protocol will replace the traditional inst-creation messages" |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
215 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
216 |
^ self class |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
217 |
name:newName |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
218 |
inEnvironment:Smalltalk |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
219 |
subclassOf:aClass |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
220 |
instanceVariableNames:stringOfInstVarNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
221 |
variable:false |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
222 |
words:false |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
223 |
pointers:false |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
224 |
classVariableNames:stringOfClassVarNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
225 |
poolDictionaries:stringOfPoolNames |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
226 |
category:categoryString |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
227 |
comment:nil |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
228 |
changed:false |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
229 |
classInstanceVariableNames:nil |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
230 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
231 |
"Modified: 16.6.1997 / 11:53:58 / cg" |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
232 |
! ! |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
233 |
|
1739 | 234 |
!Class class methodsFor:'helpers'! |
620 | 235 |
|
236 |
revisionInfoFromString:aString |
|
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
237 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
238 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
239 |
"return a revision info, given a string. |
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
240 |
This extracts the relevant info from aString, asking |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
241 |
the default sourceCode manager (if there is one). |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
242 |
Notice, that this method is only invoked, if a class does not know |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
243 |
its sourceCode manager." |
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
244 |
|
7754 | 245 |
|mgr| |
620 | 246 |
|
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
247 |
"/ |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
248 |
"/ mhmh - ask the default manager. |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
249 |
"/ if none has been defined, use the CVSSourceCodeManager |
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
250 |
"/ |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
251 |
mgr := SourceCodeManager ? CVSSourceCodeManager. |
7754 | 252 |
"/ |
7755 | 253 |
"/ care for standAlone apps which have no CVS (libbasic3) included |
7754 | 254 |
"/ |
255 |
mgr isNil ifTrue:[ |
|
8726 | 256 |
AbstractSourceCodeManager notNil ifTrue:[ |
257 |
^ AbstractSourceCodeManager revisionInfoFromRCSString:aString |
|
258 |
]. |
|
259 |
^ nil |
|
7754 | 260 |
]. |
261 |
^ mgr revisionInfoFromString:aString. |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
262 |
|
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
263 |
"Modified: / 22-10-2008 / 20:27:21 / cg" |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
264 |
! |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
265 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
266 |
revisionStringFromSource:aMethodSourceString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
267 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
268 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
269 |
"extract a revision string from a methods source string. |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
270 |
Caveat: Assumes CVS." |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
271 |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
272 |
|lines line| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
273 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
274 |
lines := aMethodSourceString asCollectionOfLines. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
275 |
lines do:[:l | |
8726 | 276 |
|i| |
277 |
||
278 |
i := l indexOfSubCollection:'$Header: '. |
|
279 |
i ~~ 0 ifTrue:[ |
|
280 |
line := l copyFrom:i. |
|
281 |
i := line lastIndexOf:$$. |
|
282 |
i > 1 ifTrue:[ |
|
283 |
line := line copyTo:i. |
|
284 |
]. |
|
285 |
^ line |
|
286 |
] |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
287 |
]. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
288 |
^ nil |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
289 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
290 |
"Created: / 15-10-1996 / 18:57:57 / cg" |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
291 |
"Modified: / 22-10-2008 / 20:29:50 / cg" |
620 | 292 |
! ! |
293 |
||
3618
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
294 |
!Class class methodsFor:'misc'! |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
295 |
|
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
296 |
template:aCategoryString |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
297 |
"return a class-definition template" |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
298 |
|
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
299 |
^ 'NameOfSuperclass subclass:#NameOfClass |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
300 |
instanceVariableNames:''instVarName1 instVarName2'' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
301 |
classVariableNames:''classVarName1 classVarName2'' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
302 |
poolDictionaries:'''' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
303 |
category:''' , aCategoryString , '''' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
304 |
|
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
305 |
"Created: / 19.6.1998 / 02:09:06 / cg" |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
306 |
! ! |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
307 |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
308 |
!Class class methodsFor:'private'! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
309 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
310 |
flushSubclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
311 |
"throw away (forget) the cached subclass information, as created |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
312 |
by #subclassInfo. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
313 |
This is private protocol" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
314 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
315 |
SubclassInfo := nil. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
316 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
317 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
318 |
Class flushSubclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
319 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
320 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
321 |
"Modified: 22.1.1997 / 18:39:36 / cg" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
322 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
323 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
324 |
subclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
325 |
"build & return a dictionary, containing the set of subclass |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
326 |
for each class. This information is kept until explicitely flushed |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
327 |
by #flushSubclassInfo. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
328 |
This cache is used internally, for enumerators like #allSubclasses |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
329 |
or #allSubclassesDo:, to avoid repeated recursive walks over the class |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
330 |
hierarchy. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
331 |
This is private protocol." |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
332 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
333 |
|d| |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
334 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
335 |
SubclassInfo notNil ifTrue:[^ SubclassInfo]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
336 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
337 |
d := IdentityDictionary new. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
338 |
Smalltalk allClassesDo:[:aClass | |
8726 | 339 |
|superCls setToAddSubclass| |
340 |
||
341 |
superCls := aClass superclass. |
|
342 |
superCls notNil ifTrue:[ |
|
343 |
setToAddSubclass := d at:superCls ifAbsent:nil. |
|
344 |
setToAddSubclass isNil ifTrue:[ |
|
345 |
d at:superCls put:(Set with:aClass). |
|
346 |
] ifFalse:[ |
|
347 |
setToAddSubclass add:aClass |
|
348 |
] |
|
349 |
] |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
350 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
351 |
SubclassInfo := d. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
352 |
^ d |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
353 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
354 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
355 |
Class subclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
356 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
357 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
358 |
"Modified: 22.1.1997 / 18:44:59 / cg" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
359 |
! ! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
360 |
|
1739 | 361 |
!Class class methodsFor:'queries'! |
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
362 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
363 |
isBuiltInClass |
1266 | 364 |
"return true if this class is known by the run-time-system. |
365 |
Here, true is returned for myself, false for subclasses." |
|
366 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
367 |
^ self == Class class or:[self == Class] |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
368 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
369 |
"Created: 15.4.1996 / 17:17:13 / cg" |
1266 | 370 |
"Modified: 23.4.1996 / 15:56:58 / cg" |
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
371 |
! ! |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
372 |
|
7261 | 373 |
!Class methodsFor:'Compatibility-Dolphin'! |
6823 | 374 |
|
375 |
defaultCategoryForDolphinClasses |
|
376 |
^ DefaultCategoryForDolphin ? 'Dolphin classes'. |
|
377 |
! |
|
378 |
||
11162 | 379 |
stb_version |
380 |
^ 0 |
|
381 |
! |
|
382 |
||
6823 | 383 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames |
384 |
"{ Pragma: +optSpace }" |
|
385 |
||
386 |
"this method allows fileIn of Dolphin classes " |
|
387 |
||
8551 | 388 |
^ self subclass:t |
8726 | 389 |
instanceVariableNames:f |
390 |
classVariableNames:d |
|
391 |
poolDictionaries:s |
|
392 |
category:(self defaultCategoryForDolphinClasses) |
|
393 |
classInstanceVariableNames:classInstanceVariableNames |
|
6823 | 394 |
|
395 |
"Modified: / 15.6.1998 / 21:31:34 / cg" |
|
396 |
"Modified: / 18.3.1999 / 18:16:11 / stefan" |
|
397 |
! |
|
398 |
||
399 |
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames |
|
400 |
"{ Pragma: +optSpace }" |
|
401 |
||
402 |
"this method allows fileIn of Dolphin classes " |
|
403 |
||
8551 | 404 |
^ self variableSubclass:t |
8726 | 405 |
instanceVariableNames:f |
406 |
classVariableNames:d |
|
407 |
poolDictionaries:s |
|
408 |
category:(self defaultCategoryForDolphinClasses) |
|
409 |
classInstanceVariableNames:classInstanceVariableNames |
|
6823 | 410 |
|
411 |
"Modified: / 15.6.1998 / 21:31:34 / cg" |
|
412 |
"Modified: / 18.3.1999 / 18:16:11 / stefan" |
|
413 |
! ! |
|
414 |
||
7261 | 415 |
!Class methodsFor:'Compatibility-ST/V and V''Age'! |
6225 | 416 |
|
417 |
defaultCategoryForSTVorVAGEClasses |
|
418 |
|cat app| |
|
419 |
||
420 |
DefaultApplicationQuerySignal isHandled ifTrue:[ |
|
8726 | 421 |
app := DefaultApplicationQuerySignal query. |
422 |
app notNil ifTrue:[ |
|
423 |
cat := 'Applications-' , app name. |
|
424 |
] ifFalse:[ |
|
425 |
cat := DefaultCategoryForVAGE ? 'V''Age classes'. |
|
426 |
]. |
|
6225 | 427 |
] ifFalse:[ |
8726 | 428 |
cat := DefaultCategoryForSTV ? 'ST/V classes'. |
6225 | 429 |
]. |
430 |
||
431 |
^ cat |
|
432 |
! |
|
433 |
||
9178
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
434 |
subclass:nm classInstanceVariableNames:cIV instanceVariableNames:iV classVariableNames:cV poolDictionaries:p |
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
435 |
"{ Pragma: +optSpace }" |
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
436 |
|
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
437 |
"this method allows fileIn of V'Age classes" |
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
438 |
|
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
439 |
^ self |
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
440 |
subclass:nm |
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
441 |
instanceVariableNames:iV |
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
442 |
classVariableNames:cV |
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
443 |
poolDictionaries:p |
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
444 |
category:(self defaultCategoryForSTVorVAGEClasses) |
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
445 |
classInstanceVariableNames:cIV |
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
446 |
! |
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
447 |
|
6225 | 448 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s |
449 |
"{ Pragma: +optSpace }" |
|
450 |
||
8551 | 451 |
"this method allows fileIn of ST/V and V'Age classes |
6225 | 452 |
(which seem to have no category)" |
453 |
||
9178
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
454 |
^ self |
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
455 |
subclass:t |
8726 | 456 |
instanceVariableNames:f |
457 |
classVariableNames:d |
|
458 |
poolDictionaries:s |
|
459 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 460 |
|
461 |
"Modified: / 15.6.1998 / 21:31:34 / cg" |
|
462 |
"Modified: / 18.3.1999 / 18:16:11 / stefan" |
|
463 |
! |
|
464 |
||
465 |
variableByteSubclass:t classVariableNames:d poolDictionaries:s |
|
466 |
"{ Pragma: +optSpace }" |
|
467 |
||
8551 | 468 |
"this method allows fileIn of ST/V and V'Age variable byte classes |
6225 | 469 |
(which seem to have no category and no instvars)" |
470 |
||
8551 | 471 |
^ self variableByteSubclass:t |
8726 | 472 |
instanceVariableNames:'' |
473 |
classVariableNames:d |
|
474 |
poolDictionaries:s |
|
475 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 476 |
|
477 |
"Modified: / 15.6.1998 / 21:31:38 / cg" |
|
478 |
"Modified: / 18.3.1999 / 18:16:21 / stefan" |
|
479 |
! |
|
480 |
||
481 |
variableLongSubclass:t classVariableNames:d poolDictionaries:s |
|
482 |
"{ Pragma: +optSpace }" |
|
483 |
||
8551 | 484 |
"this method allows fileIn of ST/V and V'Age variable long (32bit integers) classes |
6225 | 485 |
(which seem to have no category and no instvars)" |
486 |
||
8551 | 487 |
^ self variableLongSubclass:t |
8726 | 488 |
instanceVariableNames:'' |
489 |
classVariableNames:d |
|
490 |
poolDictionaries:s |
|
491 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 492 |
! |
493 |
||
494 |
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s |
|
495 |
"{ Pragma: +optSpace }" |
|
496 |
||
8551 | 497 |
"this method allows fileIn of ST/V and V'Age variable pointer classes |
6225 | 498 |
(which seem to have no category)" |
499 |
||
8551 | 500 |
^ self variableSubclass:t |
8726 | 501 |
instanceVariableNames:f |
502 |
classVariableNames:d |
|
503 |
poolDictionaries:s |
|
504 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 505 |
|
506 |
"Modified: / 15.6.1998 / 21:31:41 / cg" |
|
507 |
"Modified: / 18.3.1999 / 18:16:33 / stefan" |
|
508 |
! |
|
509 |
||
510 |
variableWordSubclass:t classVariableNames:d poolDictionaries:s |
|
511 |
"{ Pragma: +optSpace }" |
|
512 |
||
8551 | 513 |
"this method allows fileIn of ST/V and V'Age variable word (16bit integers) classes |
6225 | 514 |
(which seem to have no category and no instvars)" |
515 |
||
8551 | 516 |
^ self variableWordSubclass:t |
8726 | 517 |
instanceVariableNames:'' |
518 |
classVariableNames:d |
|
519 |
poolDictionaries:s |
|
520 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 521 |
! ! |
522 |
||
7261 | 523 |
!Class methodsFor:'Compatibility-ST80'! |
5190 | 524 |
|
525 |
fileOutSourceOn:aStream |
|
526 |
self fileOutOn:aStream withTimeStamp:false |
|
527 |
||
528 |
"Created: 20.6.1997 / 17:18:14 / cg" |
|
529 |
"Modified: 20.6.1997 / 17:18:26 / cg" |
|
530 |
! |
|
531 |
||
6723 | 532 |
rename:newName |
533 |
"same as renameTo: - for ST80 compatibility" |
|
534 |
||
535 |
^ Smalltalk renameClass:self to:newName. |
|
536 |
"/ ^ self renameTo:newName |
|
537 |
||
538 |
"Created: / 18.6.1998 / 22:08:45 / cg" |
|
539 |
! ! |
|
540 |
||
1 | 541 |
!Class methodsFor:'accessing'! |
542 |
||
6731 | 543 |
addChangeRecordForClass:aClass andNotifyChangeOf:aspect |
544 |
"writes a change record and notifies dependents." |
|
545 |
||
546 |
|namespace| |
|
547 |
||
548 |
self addChangeRecordForClass:aClass. |
|
549 |
||
550 |
aClass changed:#definition. |
|
551 |
||
552 |
namespace := aClass nameSpace. |
|
553 |
namespace changed:#classDefinition with:aClass. |
|
554 |
namespace ~~ Smalltalk ifTrue:[ |
|
8726 | 555 |
Smalltalk changed:#classDefinition with:aClass. |
6731 | 556 |
]. |
557 |
namespace changed:aspect with:aClass. |
|
558 |
namespace ~~ Smalltalk ifTrue:[ |
|
8726 | 559 |
Smalltalk changed:aspect with:aClass. |
6731 | 560 |
]. |
561 |
! |
|
562 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
563 |
addClassVarName:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
564 |
"add a class variable if not already there and initialize it with nil. |
3220
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
565 |
Also writes a change record and notifies dependents." |
555 | 566 |
|
567 |
(self classVarNames includes:aString) ifFalse:[ |
|
8726 | 568 |
self classVariableString:(self classVariableString , ' ' , aString). |
569 |
Class withoutUpdatingChangesDo:[ |
|
570 |
self withAllSubclasses do:[:cls| |
|
571 |
cls recompileMethodsAccessingAnyClassvarOrGlobal: |
|
572 |
(Array with:aString asSymbol) |
|
573 |
]. |
|
574 |
]. |
|
575 |
self addChangeRecordForClass:self andNotifyChangeOf:#classVariables. |
|
555 | 576 |
] |
577 |
||
3220
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
578 |
"Created: / 29.10.1995 / 19:40:51 / cg" |
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
579 |
"Modified: / 23.1.1998 / 15:46:23 / stefan" |
555 | 580 |
! |
581 |
||
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
582 |
allPrivateClasses |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
583 |
"{ Pragma: +optSpace }" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
584 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
585 |
"return a collection of all private classes and private-private classes. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
586 |
The classes are in any order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
587 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
588 |
^ self privateClassesOrAll:true |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
589 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
590 |
! |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
591 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
592 |
category |
8551 | 593 |
"return the category of the class. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
594 |
The returned value may be a string or symbol." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
595 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
596 |
|owner| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
597 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
598 |
(owner := self owningClass) notNil ifTrue:[^ owner category]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
599 |
^ category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
600 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
601 |
" |
8551 | 602 |
Point category |
603 |
Dictionary category |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
604 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
605 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
606 |
"Modified: 15.10.1996 / 21:20:01 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
607 |
"Created: 1.4.1997 / 15:23:47 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
608 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
609 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
610 |
category:aStringOrSymbol |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
611 |
"set the category of the class to be the argument, aStringOrSymbol" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
612 |
|
7579
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
613 |
|ns| |
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
614 |
|
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
615 |
self setCategory:aStringOrSymbol. |
10195
2484228d4c95
the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents:
10184
diff
changeset
|
616 |
self addChangeRecordForClass:self. |
7579
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
617 |
ns := self nameSpace. |
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
618 |
ns changed:#organization. |
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
619 |
ns ~~ Smalltalk ifTrue:[ |
8726 | 620 |
Smalltalk changed:#organization. |
7579
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
621 |
] |
10195
2484228d4c95
the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents:
10184
diff
changeset
|
622 |
|
2484228d4c95
the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents:
10184
diff
changeset
|
623 |
"Modified: / 23-11-2006 / 16:54:20 / cg" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
624 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
625 |
|
10078 | 626 |
classBaseFilename |
627 |
"return the baseName of the file from which the class was compiled. |
|
628 |
In contrast to classFilename, this will always be a plain basename." |
|
629 |
||
630 |
^ self classFilename asFilename baseName |
|
631 |
||
632 |
" |
|
633 |
Math::ClosedInterval classFilename |
|
634 |
" |
|
635 |
||
636 |
"Created: / 12-10-2006 / 15:49:32 / cg" |
|
637 |
! |
|
638 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
639 |
classFilename |
10050 | 640 |
"return the name of the file from which the class was compiled. |
641 |
If the class was loaded via an explicit load (i.e. from the fileBrowser), |
|
10078 | 642 |
this will be an absolute path. Oherwise, it will be a basename only. |
643 |
See classBaseFilename for a method which always returns the basename." |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
644 |
|
11278
2b9d769505b5
classFilename for new revisionInfo
Claus Gittinger <cg@exept.de>
parents:
11277
diff
changeset
|
645 |
|owner info fn| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
646 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
647 |
(owner := self owningClass) notNil ifTrue:[^ owner classFilename]. |
10033 | 648 |
classFilename notNil ifTrue:[ ^ classFilename ]. |
10050 | 649 |
|
10033 | 650 |
(info := self revisionInfo) notNil ifTrue:[ |
11278
2b9d769505b5
classFilename for new revisionInfo
Claus Gittinger <cg@exept.de>
parents:
11277
diff
changeset
|
651 |
fn := info fileName. |
2b9d769505b5
classFilename for new revisionInfo
Claus Gittinger <cg@exept.de>
parents:
11277
diff
changeset
|
652 |
fn notNil ifTrue:[ |
2b9d769505b5
classFilename for new revisionInfo
Claus Gittinger <cg@exept.de>
parents:
11277
diff
changeset
|
653 |
^ fn |
10033 | 654 |
]. |
9497 | 655 |
]. |
10053 | 656 |
^ (Smalltalk fileNameForClass:self), '.st' |
10033 | 657 |
|
658 |
" |
|
659 |
Math::ClosedInterval classFilename |
|
660 |
" |
|
661 |
||
11278
2b9d769505b5
classFilename for new revisionInfo
Claus Gittinger <cg@exept.de>
parents:
11277
diff
changeset
|
662 |
"Modified: / 22-10-2008 / 20:58:21 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
663 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
664 |
|
8561
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
665 |
classPool |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
666 |
"return something which allows access to my classVariables via |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
667 |
#at: and #at:put: messages." |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
668 |
|
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
669 |
^ SimulatedClassPool new setClass:self |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
670 |
|
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
671 |
" |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
672 |
Button classPool |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
673 |
" |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
674 |
|
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
675 |
"Modified: 17.10.1997 / 12:12:14 / cg" |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
676 |
! |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
677 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
678 |
classVarAt:aSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
679 |
"return the value of a class variable. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
680 |
Currently, this returns nil if there is no such classvar - |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
681 |
this may change." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
682 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
683 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
684 |
this hides the (current) implementation of classVariables |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
685 |
from the outside world. Currently, classvars are stored in |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
686 |
the Smalltalk dictionary with a funny name, since there are |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
687 |
no classPools yet. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
688 |
" |
6731 | 689 |
^ Smalltalk at:(self globalKeyForClassVar:aSymbol) |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
690 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
691 |
|
5707
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
692 |
classVarAt:aSymbol ifAbsent:exceptionBlock |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
693 |
"return the value of a class variable. |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
694 |
Currently, this returns nil if there is no such classvar - |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
695 |
this may change." |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
696 |
|
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
697 |
" |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
698 |
this hides the (current) implementation of classVariables |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
699 |
from the outside world. Currently, classvars are stored in |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
700 |
the Smalltalk dictionary with a funny name, since there are |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
701 |
no classPools yet. |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
702 |
" |
6731 | 703 |
^ Smalltalk at:(self globalKeyForClassVar:aSymbol) ifAbsent:exceptionBlock |
5707
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
704 |
! |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
705 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
706 |
classVarAt:aSymbol put:something |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
707 |
"store something in a classvariable. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
708 |
Currently this creates a global with a funny name if no such |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
709 |
classVar exists - this may change." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
710 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
711 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
712 |
this hides the (current) implementation of classVariables |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
713 |
from the outside world. Currently, classvars are stored in |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
714 |
the Smalltalk dictionary with a funny name, since there are |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
715 |
no classPools yet. |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
716 |
" |
6731 | 717 |
Smalltalk at:(self globalKeyForClassVar:aSymbol) put:something. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
718 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
719 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
720 |
classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
721 |
"return a collection of the class variable name-strings. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
722 |
Only names of class variables defined in this class are included |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
723 |
in the returned collection - use allClassVarNames, to get all known names." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
724 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
725 |
classvars isNil ifTrue:[ |
8726 | 726 |
^ #() |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
727 |
]. |
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
728 |
classvars isString ifTrue:[ |
8726 | 729 |
classvars := classvars asCollectionOfWords asArray collect:[:varName| varName asSymbol]. |
730 |
^ classvars |
|
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
731 |
]. |
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
732 |
|
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
733 |
^ classvars |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
734 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
735 |
" |
8551 | 736 |
Object classVarNames |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
737 |
Float classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
738 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
739 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
740 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
741 |
classVariableString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
742 |
"return a string of the class variables names. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
743 |
Only names of class variables defined in this class are in the |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
744 |
returned string." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
745 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
746 |
classvars isNil ifTrue:[^ '']. |
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
747 |
classvars isString ifTrue:[ |
8726 | 748 |
^ classvars |
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
749 |
]. |
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
750 |
|
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
751 |
^ classvars asStringWith:(Character space) |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
752 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
753 |
" |
8551 | 754 |
Object classVariableString |
755 |
Float classVariableString |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
756 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
757 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
758 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
759 |
classVariableString:aString |
8551 | 760 |
"set the classes classvarnames string; |
761 |
Initialize new class variables with nil, clear and remove old ones. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
762 |
No change record is written and no classes are recompiled." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
763 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
764 |
|prevVarNames varNames any| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
765 |
|
7517 | 766 |
(aString ~= self classVariableString) ifTrue:[ |
8726 | 767 |
prevVarNames := self classVarNames asOrderedCollection. |
768 |
classvars := aString. |
|
769 |
varNames := self classVarNames. |
|
770 |
||
771 |
"new ones get initialized to nil; |
|
772 |
- old ones are nilled and removed from Smalltalk" |
|
773 |
any := false. |
|
774 |
||
775 |
varNames do:[:aName | |
|
776 |
(prevVarNames includes:aName) ifFalse:[ |
|
777 |
"a new one" |
|
778 |
self classVarAt:aName put:nil. |
|
779 |
any := true. |
|
780 |
] ifTrue:[ |
|
781 |
prevVarNames remove:aName |
|
782 |
] |
|
783 |
]. |
|
784 |
"left overs are gone" |
|
785 |
prevVarNames do:[:aName | |
|
10184 | 786 |
any := true. |
8726 | 787 |
self classVarAt:aName put:nil. |
10184 | 788 |
Smalltalk removeKey:(self globalKeyForClassVar:aName). |
8726 | 789 |
]. |
790 |
any ifTrue:[ |
|
791 |
Smalltalk changed:#classVariables with:self |
|
792 |
]. |
|
453 | 793 |
] |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
794 |
|
10184 | 795 |
"Modified: / 02-04-1997 / 00:16:05 / stefan" |
796 |
"Modified: / 18-11-2006 / 17:13:14 / cg" |
|
453 | 797 |
! |
798 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
799 |
comment |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
800 |
"return the comment (aString) of the class" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
801 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
802 |
|stream string| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
803 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
804 |
"the comment is either a string, or an integer specifying the |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
805 |
position within the classes sourcefile ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
806 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
807 |
comment isNumber ifTrue:[ |
8726 | 808 |
classFilename notNil ifTrue:[ |
809 |
stream := self sourceStream. |
|
810 |
stream notNil ifTrue:[ |
|
811 |
stream position1Based:comment. |
|
812 |
string := String readFrom:stream onError:''. |
|
813 |
stream close. |
|
814 |
^ string |
|
815 |
]. |
|
816 |
^ nil |
|
817 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
818 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
819 |
^ comment |
555 | 820 |
|
821 |
" |
|
8551 | 822 |
Object comment |
7054
685d359f9847
code rewritten to be independent of stream zero-base
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
823 |
RunArray comment |
555 | 824 |
" |
825 |
! |
|
826 |
||
7128 | 827 |
comment:aStringOrNil |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
828 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
829 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
830 |
"set the comment of the class to be the argument, aString; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
831 |
create a change record and notify dependents." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
832 |
|
865
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
833 |
|oldComment newComment| |
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
834 |
|
7128 | 835 |
newComment := aStringOrNil. |
836 |
(aStringOrNil notNil and:[aStringOrNil withoutSeparators isEmpty]) ifTrue:[ |
|
8726 | 837 |
newComment := nil |
865
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
838 |
]. |
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
839 |
comment ~= newComment ifTrue:[ |
8726 | 840 |
oldComment := self comment. |
841 |
comment := newComment. |
|
842 |
self addChangeRecordForClassComment:self. |
|
843 |
self changed:#comment with:oldComment. |
|
844 |
Smalltalk changed:#classComment with:self. |
|
555 | 845 |
] |
846 |
! |
|
847 |
||
2444 | 848 |
environment |
849 |
"return the namespace I am contained in; ST-80 compatible name" |
|
850 |
||
851 |
^ self nameSpace |
|
852 |
! |
|
853 |
||
11866 | 854 |
generateClassFilename |
855 |
"generate the expected filename for this class - without suffix. |
|
856 |
This may be different from the actual classFilename" |
|
857 |
||
858 |
^ self theNonMetaclass name copyReplaceAll:$: with:$_ |
|
859 |
||
860 |
" |
|
861 |
Complex generateClassFilename |
|
862 |
HTML::AbstractElement generateClassFilename |
|
863 |
" |
|
864 |
||
865 |
"Modified: / 06-10-2006 / 16:16:01 / cg" |
|
866 |
! |
|
867 |
||
9497 | 868 |
getClassFilename |
10050 | 869 |
"return the name of the file from which the class was compiled. |
870 |
If the class was loaded via an explicit load (i.e. from the fileBrowser), |
|
871 |
this will be an absolute path. Oherwise, it will be a basename only." |
|
9497 | 872 |
|
873 |
|owner| |
|
874 |
||
10050 | 875 |
(owner := self owningClass) notNil ifTrue:[^ owner getClassFilename]. |
9497 | 876 |
^ classFilename |
10050 | 877 |
|
878 |
"Modified: / 06-10-2006 / 13:32:01 / cg" |
|
9497 | 879 |
! |
880 |
||
9693
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
881 |
getPackage |
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
882 |
"get the package or nil." |
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
883 |
|
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
884 |
^ package |
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
885 |
! |
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
886 |
|
6731 | 887 |
globalKeyForClassVar:aStringOrSymbol |
888 |
"this helps to encapsulate the (current) implementation of classVariables |
|
889 |
from the outside world. Currently, classvars are stored in |
|
890 |
the Smalltalk dictionary with a funny name, since there are |
|
891 |
no classPools yet. |
|
892 |
" |
|
10184 | 893 |
^ (self theNonMetaclass name , ':' , aStringOrSymbol) asSymbol |
894 |
||
895 |
"Modified: / 18-11-2006 / 17:13:39 / cg" |
|
6731 | 896 |
! |
897 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
898 |
name |
8551 | 899 |
"return the name of the class. |
6657 | 900 |
This returns a symbol (but notice, that other smalltalks might return a string)." |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
901 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
902 |
^ name |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
903 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
904 |
"Created: 1.4.1997 / 15:24:32 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
905 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
906 |
|
1919 | 907 |
nameSpace |
2070
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
908 |
"return the namespace I am contained in; |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
909 |
For private or anonymous classes, nil is returned - |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
910 |
for public classes, Smalltalk is returned." |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
911 |
|
7321 | 912 |
|idx nsName e| |
913 |
||
914 |
"/ cached in environment |
|
915 |
environment isNil ifTrue:[ |
|
8726 | 916 |
e := Smalltalk. "/ default |
917 |
||
918 |
name notNil ifTrue:[ |
|
919 |
"/ due to the implementation, extract this from my name |
|
920 |
"/ (physically, all classes are found in Smalltalk) |
|
921 |
||
922 |
idx := name lastIndexOf:$:. |
|
923 |
idx ~~ 0 ifTrue:[ |
|
924 |
(name at:idx-1) == $: ifTrue:[ |
|
925 |
nsName := name copyTo:(idx - 2). |
|
926 |
e := Smalltalk at:nsName asSymbol. |
|
927 |
] |
|
928 |
]. |
|
929 |
]. |
|
930 |
environment := e. |
|
1919 | 931 |
]. |
2493
ba34c6aac597
cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents:
2491
diff
changeset
|
932 |
^ environment |
ba34c6aac597
cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents:
2491
diff
changeset
|
933 |
|
3661 | 934 |
"Modified: / 20.7.1998 / 14:21:36 / cg" |
1919 | 935 |
! |
936 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
937 |
package |
9693
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
938 |
"return the package-ID of the class" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
939 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
940 |
|owner| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
941 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
942 |
(owner := self owningClass) notNil ifTrue:[^ owner package]. |
9693
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
943 |
package isNil ifTrue:[^ Project noProjectID]. |
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
944 |
^ package |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
945 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
946 |
" |
8551 | 947 |
Object package |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
948 |
" |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
949 |
|
3951 | 950 |
"Modified: / 29.12.1998 / 01:15:50 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
951 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
952 |
|
9494 | 953 |
package:aSymbol |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
954 |
"set the package of the class." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
955 |
|
9724 | 956 |
|newPackage oldPackage| |
957 |
||
9693
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
958 |
aSymbol == Project noProjectID ifTrue:[ |
9724 | 959 |
newPackage := nil |
9693
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
960 |
] ifFalse:[ |
9724 | 961 |
newPackage := aSymbol |
962 |
]. |
|
963 |
package ~= newPackage ifTrue:[ |
|
964 |
oldPackage := package. |
|
965 |
package := newPackage. |
|
966 |
||
967 |
self changed:#package. |
|
968 |
Smalltalk changed:#projectOrganization with:(Array with:self with:oldPackage). |
|
969 |
]. |
|
9494 | 970 |
|
971 |
"Modified: / 09-08-2006 / 17:58:53 / fm" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
972 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
973 |
|
4740 | 974 |
packageInfo |
975 |
"return the package-info of the class - or nil. |
|
976 |
The packageManager contains information relevant to the package, |
|
977 |
to which this class belongs - especially, things like pathes to |
|
978 |
resources, additional files etc. can be optioned this way. |
|
11536
d883525654f1
changed #packageInfo - comment
Stefan Vogel <sv@exept.de>
parents:
11484
diff
changeset
|
979 |
A packageInfo loosely relates to what a classLoader is in Java. |
4740 | 980 |
Experimental." |
981 |
||
4742 | 982 |
|packageId prj handle t| |
4740 | 983 |
|
984 |
packageId := self package. |
|
985 |
packageId notNil ifTrue:[ |
|
8726 | 986 |
prj := Project projectWithId:packageId. |
987 |
prj notNil ifTrue:[^ prj]. |
|
988 |
||
989 |
"/ |
|
990 |
"/ intermediate kludge (will be removed) |
|
991 |
"/ search for a loaded class library and extract |
|
992 |
"/ information from it ... |
|
993 |
"/ |
|
994 |
handle := ObjectFileLoader loadedObjectHandles |
|
995 |
detect:[:h | |cls| |
|
996 |
cls := h classes firstIfEmpty:nil. |
|
997 |
cls notNil and:[cls package = packageId] |
|
998 |
] |
|
999 |
ifNone:nil. |
|
1000 |
||
1001 |
handle notNil ifTrue:[ |
|
1002 |
prj := Project new. |
|
1003 |
prj name:packageId. |
|
1004 |
prj directory:(handle pathName asFilename directory pathName). |
|
1005 |
prj package:packageId. |
|
1006 |
t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'. |
|
1007 |
prj repositoryModule:(t first). |
|
1008 |
prj repositoryDirectory:(packageId copyFrom:t first size + 2). |
|
1009 |
prj isLoaded:true. |
|
1010 |
^ prj |
|
1011 |
] |
|
4740 | 1012 |
]. |
1013 |
^ nil |
|
1014 |
||
1015 |
" |
|
8551 | 1016 |
Object packageInfo |
1017 |
OSI::FTAMOperation packageInfo |
|
4740 | 1018 |
" |
1019 |
! |
|
1020 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1021 |
primitiveDefinitions:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1022 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1023 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1024 |
"set the primitiveDefinition string" |
555 | 1025 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1026 |
(self isPrivate) ifTrue:[ |
8726 | 1027 |
self error:'private classes cannot have their own primitiveDefinitions'. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1028 |
]. |
5800
a4386f928cf0
setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents:
5770
diff
changeset
|
1029 |
self setPrimitiveDefinitions:aString. |
555 | 1030 |
self addChangeRecordForPrimitiveDefinitions:self. |
1031 |
||
1032 |
"Created: 29.10.1995 / 19:41:39 / cg" |
|
1033 |
! |
|
1034 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1035 |
primitiveDefinitionsString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1036 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1037 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1038 |
"return the primitiveDefinition string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1039 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1040 |
|owner| |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1041 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1042 |
(owner := self owningClass) notNil ifTrue:[ |
8726 | 1043 |
^ owner primitiveDefinitionsString |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1044 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1045 |
^ self getSourceChunkAttribute:#primitiveDefinitions |
555 | 1046 |
|
1047 |
" |
|
8551 | 1048 |
Object primitiveDefinitionsString |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1049 |
String primitiveDefinitionsString |
555 | 1050 |
" |
1051 |
! |
|
1052 |
||
5875 | 1053 |
primitiveDefinitionsStringOrDefault |
1054 |
"return the primitiveDefinition string or a default" |
|
1055 |
||
1056 |
^ self primitiveDefinitionsString ? '%{ |
|
1057 |
||
1058 |
/* |
|
1059 |
* includes, defines, structure definitions |
|
1060 |
* and typedefs come here. |
|
1061 |
*/ |
|
1062 |
||
1063 |
%}' |
|
1064 |
||
1065 |
" |
|
1066 |
Object primitiveDefinitionsStringOrDefault |
|
1067 |
String primitiveDefinitionsStringOrDefault |
|
1068 |
ExternalStream primitiveDefinitionsStringOrDefault |
|
1069 |
" |
|
1070 |
! |
|
1071 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1072 |
primitiveFunctions:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1073 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1074 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1075 |
"set the primitiveFunction string" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1076 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1077 |
(self isPrivate) ifTrue:[ |
8726 | 1078 |
self error:'private classes cannot have their own primitiveFunctions'. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1079 |
]. |
5800
a4386f928cf0
setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents:
5770
diff
changeset
|
1080 |
self setPrimitiveFunctions:aString. |
555 | 1081 |
self addChangeRecordForPrimitiveFunctions:self. |
1082 |
||
1083 |
"Created: 29.10.1995 / 19:41:48 / cg" |
|
1084 |
! |
|
1085 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1086 |
primitiveFunctionsString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1087 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1088 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1089 |
"return the primitiveFunctions string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1090 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1091 |
|owner| |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1092 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1093 |
(owner := self owningClass) notNil ifTrue:[ |
8726 | 1094 |
^ owner primitiveFunctionsString |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1095 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1096 |
^ self getSourceChunkAttribute:#primitiveFunctions |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1097 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1098 |
|
5875 | 1099 |
primitiveFunctionsStringOrDefault |
1100 |
"return the primitiveFunction string or a default" |
|
1101 |
||
1102 |
^ self primitiveFunctionsString ? '%{ |
|
1103 |
||
8551 | 1104 |
/* |
5875 | 1105 |
* any local C (helper) functions |
1106 |
* come here (please, define as static) |
|
1107 |
*/ |
|
1108 |
||
1109 |
%}' |
|
1110 |
||
1111 |
" |
|
1112 |
Object primitiveFunctionsStringOrDefault |
|
1113 |
String primitiveFunctionsStringOrDefault |
|
1114 |
ExternalStream primitiveFunctionsStringOrDefault |
|
1115 |
" |
|
1116 |
! |
|
1117 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1118 |
primitiveVariables:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1119 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1120 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1121 |
"set the primitiveVariable string" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1122 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1123 |
(self isPrivate) ifTrue:[ |
8726 | 1124 |
self error:'private classes cannot have their own primitiveVariables'. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1125 |
]. |
5800
a4386f928cf0
setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents:
5770
diff
changeset
|
1126 |
self setPrimitiveVariables:aString. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1127 |
self addChangeRecordForPrimitiveVariables:self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1128 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1129 |
"Created: 29.10.1995 / 19:41:58 / cg" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1130 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1131 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1132 |
primitiveVariablesString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1133 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1134 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1135 |
"return the primitiveVariables string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1136 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1137 |
|owner| |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1138 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1139 |
(owner := self owningClass) notNil ifTrue:[ |
8726 | 1140 |
^ owner primitiveVariablesString |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1141 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1142 |
^ self getSourceChunkAttribute:#primitiveVariables |
555 | 1143 |
! |
1144 |
||
5875 | 1145 |
primitiveVariablesStringOrDefault |
1146 |
"return the primitiveVariable string or a default" |
|
1147 |
||
1148 |
^ self primitiveVariablesString ? '%{ |
|
1149 |
||
8551 | 1150 |
/* |
5875 | 1151 |
* any local C variables |
1152 |
* come here (please, define as static) |
|
1153 |
*/ |
|
1154 |
||
1155 |
%}' |
|
1156 |
||
1157 |
" |
|
1158 |
Object primitiveVariablesStringOrDefault |
|
1159 |
String primitiveVariablesStringOrDefault |
|
1160 |
ExternalStream primitiveVariablesStringOrDefault |
|
1161 |
" |
|
1162 |
! |
|
1163 |
||
11137 | 1164 |
privateClassNamed:aClassNameStringOrSymbol |
1165 |
^ self privateClassesAt:aClassNameStringOrSymbol |
|
1166 |
! |
|
1167 |
||
1739 | 1168 |
privateClasses |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1169 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1170 |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1171 |
"return a collection of my private classes (if any). |
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1172 |
The classes are in any order." |
1739 | 1173 |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1174 |
^ self privateClassesOrAll:false |
1739 | 1175 |
|
1176 |
" |
|
1177 |
Object privateClasses |
|
8551 | 1178 |
ObjectMemory privateClasses |
1179 |
UILayoutTool privateClasses |
|
1739 | 1180 |
" |
1181 |
||
3495
31ae10035c74
skip obsolete leftover private classes when enumerating.
Claus Gittinger <cg@exept.de>
parents:
3494
diff
changeset
|
1182 |
"Modified: / 29.5.1998 / 23:23:18 / cg" |
1739 | 1183 |
! |
1184 |
||
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1185 |
privateClassesAt:aClassNameStringOrSymbol |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1186 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1187 |
|
1707 | 1188 |
"return a private class if present; nil otherwise" |
1189 |
||
8726 | 1190 |
|myName nmSym| |
1191 |
||
1192 |
myName := self name. |
|
1193 |
myName isNil ifTrue:[ |
|
1194 |
"/ no name - there cannot be a corresponding private class |
|
1195 |
^ nil |
|
1196 |
]. |
|
1197 |
nmSym := (myName , '::' , aClassNameStringOrSymbol) asSymbolIfInterned. |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
1198 |
nmSym isNil ifTrue:[ |
8726 | 1199 |
"/ no such symbol - there cannot be a corresponding private class |
1200 |
^ nil |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
1201 |
]. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
1202 |
|
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1203 |
^ Smalltalk at:nmSym. |
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1204 |
|
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1205 |
"Modified: 26.6.1997 / 11:44:04 / cg" |
1707 | 1206 |
! |
1207 |
||
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1208 |
privateClassesAt:aClassNameStringOrSymbol put:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1209 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1210 |
|
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1211 |
"add a private class" |
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1212 |
|
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1213 |
self classVarAt:(':' , aClassNameStringOrSymbol) put:aClass |
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1214 |
|
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1215 |
"Modified: 26.6.1997 / 11:44:12 / cg" |
1707 | 1216 |
! |
1217 |
||
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1218 |
privateClassesOrAll:allOfThem |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1219 |
"{ Pragma: +optSpace }" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1220 |
|
4495
4804e3e33d76
tuned #privateClasses access
Claus Gittinger <cg@exept.de>
parents:
4400
diff
changeset
|
1221 |
"return a collection of my direct private classes (if any) |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1222 |
or direct plus indirect private classes (if allOfThem). |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1223 |
An empty collection if there are none. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1224 |
The classes are in any order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1225 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1226 |
|classes myName myNamePrefix myNamePrefixLen| |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1227 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1228 |
myName := self name. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1229 |
myNamePrefix := myName , '::'. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1230 |
myNamePrefixLen := myNamePrefix size. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1231 |
|
4575 | 1232 |
Smalltalk keysDo:[:nm | |
8726 | 1233 |
|cls| |
1234 |
||
1235 |
(nm startsWith:myNamePrefix) ifTrue:[ |
|
1236 |
(allOfThem |
|
1237 |
or:[(nm indexOf:$: startingAt:myNamePrefixLen + 1) == 0]) ifTrue:[ |
|
1238 |
cls := Smalltalk at:nm. |
|
1239 |
||
1240 |
(cls isBehavior and:[cls isMeta not]) ifTrue:[ |
|
1241 |
classes isNil ifTrue:[ |
|
1242 |
classes := Set new:10. |
|
1243 |
]. |
|
1244 |
classes add:cls. |
|
1245 |
] |
|
1246 |
] |
|
1247 |
] |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1248 |
]. |
4575 | 1249 |
|
4578 | 1250 |
^ classes ? #() |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1251 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1252 |
" |
8551 | 1253 |
UILayoutTool privateClassesOrAll:true |
1254 |
UILayoutTool privateClassesOrAll:false |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1255 |
" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1256 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1257 |
"Modified: / 29.5.1998 / 23:23:18 / cg" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1258 |
! |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1259 |
|
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1260 |
privateClassesSorted |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1261 |
"{ Pragma: +optSpace }" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1262 |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1263 |
"return a collection of my private classes (if any). |
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1264 |
The classes are sorted by inheritance." |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1265 |
|
7894 | 1266 |
|classes pivateClassesOf| |
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1267 |
|
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1268 |
classes := self privateClasses. |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1269 |
(classes size > 0) ifTrue:[ |
8726 | 1270 |
classes := classes asOrderedCollection. |
1271 |
classes sort:[:a :b | a name < b name]. |
|
1272 |
||
1273 |
pivateClassesOf := IdentityDictionary new. |
|
1274 |
classes do:[:each | pivateClassesOf at:each put:(each allPrivateClasses)]. |
|
1275 |
||
1276 |
classes topologicalSort:[:a :b | |
|
1277 |
"/ a must come before b iff: |
|
1278 |
"/ b is a subclass of a |
|
1279 |
"/ b has a private class which is a subclass of a |
|
1280 |
||
1281 |
|mustComeBefore pivateClassesOfB| |
|
1282 |
mustComeBefore := b isSubclassOf:a. |
|
1283 |
pivateClassesOfB := pivateClassesOf at:b. |
|
1284 |
pivateClassesOfB do:[:eachClassInB | |
|
1285 |
mustComeBefore := mustComeBefore or:[eachClassInB isSubclassOf:a] |
|
1286 |
]. |
|
1287 |
mustComeBefore |
|
1288 |
]. |
|
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1289 |
]. |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1290 |
^ classes. |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1291 |
|
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1292 |
" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1293 |
Object privateClassesSorted |
5731 | 1294 |
NewSystemBrowser privateClassesSorted |
1295 |
NewSystemBrowser privateClasses |
|
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1296 |
" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1297 |
|
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1298 |
"Created: 22.3.1997 / 16:10:42 / cg" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1299 |
"Modified: 22.3.1997 / 16:11:20 / cg" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1300 |
! |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1301 |
|
9959 | 1302 |
projectDefinition |
1303 |
"return the project definition of the classes package" |
|
1304 |
||
1305 |
^ ProjectDefinition definitionClassForPackage: self package |
|
1306 |
||
1307 |
" |
|
1308 |
Object projectDefinition productVersion |
|
1309 |
DAPASX::DapasUI projectDefinition productVersion |
|
1310 |
" |
|
1311 |
||
1312 |
"Created: / 19-09-2006 / 22:02:06 / cg" |
|
1313 |
! |
|
1314 |
||
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1315 |
realSharedPools |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1316 |
"this returns the namespace aware pool names" |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1317 |
|
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1318 |
|poolNames ns| |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1319 |
|
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1320 |
poolNames := self sharedPools. |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1321 |
(ns := self topNameSpace) notNil ifTrue:[ |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1322 |
^ poolNames |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1323 |
collect:[:nm | |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1324 |
|p| |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1325 |
(p := ns at:nm) notNil ifTrue:[ |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1326 |
p name |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1327 |
] ifFalse:[ |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1328 |
nm |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1329 |
]]. |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1330 |
]. |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1331 |
^ poolNames |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1332 |
|
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1333 |
" |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1334 |
Croquet::OpenGL sharedPools |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1335 |
Croquet::OpenGL realSharedPools |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1336 |
" |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1337 |
! |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1338 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1339 |
removeClassVarName:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1340 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1341 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1342 |
"remove a class variable if not already there. |
5635
036069e1b8f7
change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents:
5614
diff
changeset
|
1343 |
Also writes a change record and notifies dependents." |
036069e1b8f7
change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents:
5614
diff
changeset
|
1344 |
|
6731 | 1345 |
|names newNames| |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1346 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1347 |
names := self classVarNames. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1348 |
(names includes:aString) ifTrue:[ |
8726 | 1349 |
newNames := ''. |
1350 |
names do:[:nm | nm ~= aString ifTrue:[newNames := newNames , nm , ' ']]. |
|
1351 |
self classVariableString:newNames withoutSpaces. |
|
1352 |
Class withoutUpdatingChangesDo:[ |
|
1353 |
self withAllSubclasses do:[:cls| |
|
1354 |
cls recompileMethodsAccessingAnyClassvarOrGlobal: |
|
1355 |
(Array with:aString asSymbol) |
|
1356 |
]. |
|
1357 |
]. |
|
1358 |
self addChangeRecordForClass:self andNotifyChangeOf:#classVariables. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1359 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1360 |
|
3220
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
1361 |
"Created: / 29.10.1995 / 19:42:08 / cg" |
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
1362 |
"Modified: / 23.1.1998 / 15:46:33 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1363 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1364 |
|
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1365 |
setCategory:aStringOrSymbol |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1366 |
"set the category of the class to be the argument, aStringOrSymbol" |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1367 |
|
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1368 |
aStringOrSymbol isNil ifTrue:[ |
8726 | 1369 |
category := aStringOrSymbol |
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1370 |
] ifFalse:[ |
8726 | 1371 |
category := aStringOrSymbol asSymbol |
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1372 |
] |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1373 |
|
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1374 |
"Created: 1.4.1997 / 15:24:04 / stefan" |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1375 |
! |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1376 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1377 |
setClassFilename:aFilename |
8551 | 1378 |
"set the classes filename. |
10050 | 1379 |
This is a dangerous (low level) operation, |
1380 |
since the comment and primitiveSpecs may no longer be accessable, |
|
1381 |
if a wrong filename is set here." |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1382 |
|
10141
669ade985ad7
temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents:
10102
diff
changeset
|
1383 |
"/ cg: somewhere, the filename is set from a temporary (checkout) files name. |
669ade985ad7
temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents:
10102
diff
changeset
|
1384 |
"/ we MUST catch and FIX this. |
10142 | 1385 |
aFilename notNil ifTrue:[ |
1386 |
(aFilename asFilename baseName startsWith:'st') ifTrue:[ |
|
1387 |
(aFilename asFilename baseName at:3) isDigit ifTrue:[ |
|
11261
e8dcdce0b2ae
changed #classMenuCompareTwoRepositoryVersions
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
1388 |
self halt:'this should not be reached' |
10142 | 1389 |
]. |
10141
669ade985ad7
temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents:
10102
diff
changeset
|
1390 |
]. |
669ade985ad7
temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents:
10102
diff
changeset
|
1391 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1392 |
classFilename := aFilename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1393 |
|
10050 | 1394 |
"Modified: / 08-09-1995 / 14:16:48 / claus" |
10142 | 1395 |
"Modified: / 25-10-2006 / 13:50:42 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1396 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1397 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1398 |
setClassVariableString:aString |
8551 | 1399 |
"set the classes classvarnames string. |
1400 |
This is a dangerous (low level) operation, since the |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1401 |
classvariables are not really created or updated. Also, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1402 |
NO change record is written." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1403 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1404 |
classvars := aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1405 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1406 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1407 |
setComment:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1408 |
"set the comment of the class to be the argument, aString; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1409 |
do NOT create a change record" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1410 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1411 |
comment := aString |
1 | 1412 |
! |
1413 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1414 |
setComment:com category:categoryStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1415 |
"set the comment and category of the class; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1416 |
do NOT create a change record" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1417 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1418 |
|cat| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1419 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1420 |
comment := com. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1421 |
categoryStringOrSymbol isNil ifTrue:[ |
8726 | 1422 |
cat := '' |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1423 |
] ifFalse:[ |
8726 | 1424 |
cat := categoryStringOrSymbol |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1425 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1426 |
category := cat asSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1427 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1428 |
|
5248 | 1429 |
setEnvironment:aNamespace |
1430 |
"set the namespace I am contained in; ST-80 compatible name" |
|
1431 |
||
1432 |
environment := aNamespace |
|
1433 |
! |
|
1434 |
||
9494 | 1435 |
setPackage:aSymbol |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1436 |
"set the package of the class." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1437 |
|
9494 | 1438 |
package := aSymbol |
1439 |
||
1440 |
"Modified: / 09-08-2006 / 17:59:13 / fm" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1441 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1442 |
|
8561
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1443 |
sharedPools |
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1444 |
"this returns the plain (non-namespace aware) pool names" |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1445 |
|
8561
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1446 |
|pools| |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1447 |
|
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1448 |
pools := self getAttribute:#sharedPools. |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1449 |
pools isNil ifTrue:[ |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1450 |
^ #(). |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1451 |
]. |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1452 |
pools isString ifTrue:[ |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1453 |
pools := pools asCollectionOfWords asArray collect:[:varName| varName asSymbol]. |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1454 |
self setAttribute:#sharedPools to:pools. |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1455 |
]. |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1456 |
^ pools |
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1457 |
|
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1458 |
" |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1459 |
Croquet::OpenGL sharedPools |
10876 | 1460 |
OpenGLRenderingContext sharedPools |
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1461 |
" |
8561
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1462 |
! |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1463 |
|
8551 | 1464 |
sharedPools:aStringOrCollection |
1465 |
"{ Pragma: +optSpace }" |
|
1466 |
||
1467 |
"set the sharedPools string (no change notifications)" |
|
1468 |
||
1469 |
self setSharedPools:aStringOrCollection. |
|
1470 |
self addChangeRecordForClass:self. |
|
10050 | 1471 |
|
1472 |
"Modified: / 06-10-2006 / 13:35:14 / cg" |
|
8551 | 1473 |
! |
1474 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1475 |
source |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1476 |
"return the classes full source code" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1477 |
|
8737
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1478 |
|code aStream tmpFilename| |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1479 |
|
10050 | 1480 |
" this is too slow for big classes (due to the emphasis stored)... |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1481 |
code := String new:1000. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1482 |
aStream := WriteStream on:code. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1483 |
self fileOutOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1484 |
" |
8737
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1485 |
tmpFilename := Filename newTemporary. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
1486 |
[ |
8737
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1487 |
aStream := tmpFilename newReadWriteStream. |
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1488 |
aStream removeOnClose:true. |
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1489 |
] on:OpenError do:[:ex| |
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1490 |
self warn:'Class>>#source: cannot create temporary file: ', ex description. |
8726 | 1491 |
^ nil |
555 | 1492 |
]. |
8737
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1493 |
[ |
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1494 |
FileOutErrorSignal handle:[:ex | |
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1495 |
aStream nextPut:$" ; nextPutAll:ex description; nextPut:$". |
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1496 |
FileOutErrorSignal isHandled ifTrue:[ |
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1497 |
ex reject. |
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1498 |
]. |
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1499 |
] do:[ |
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1500 |
self fileOutOn:aStream. |
8726 | 1501 |
]. |
8737
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1502 |
aStream reset. |
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1503 |
code := aStream contents. |
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1504 |
] ensure:[ |
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1505 |
aStream close. |
555 | 1506 |
]. |
1507 |
^ code |
|
10050 | 1508 |
|
1509 |
"Modified: / 06-10-2006 / 13:34:18 / cg" |
|
385 | 1510 |
! |
1511 |
||
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1512 |
sourceCodeManager |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1513 |
"return my source code manager. |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1514 |
For now, all classes return the same global manager. |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1515 |
But future versions may support mixed reporitories" |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1516 |
|
10166 | 1517 |
|owner module| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1518 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1519 |
(owner := self owningClass) notNil ifTrue:[^ owner sourceCodeManager]. |
10166 | 1520 |
|
1521 |
"/ see if there is a package-specific manager |
|
1522 |
package notNil ifTrue:[ |
|
10220
7332b36bc81e
avoid need for libbasic3 (due to packageID reference)
Claus Gittinger <cg@exept.de>
parents:
10195
diff
changeset
|
1523 |
module := package upTo:$:. |
10376 | 1524 |
AbstractSourceCodeManager notNil ifTrue:[ |
1525 |
AbstractSourceCodeManager availableManagers do:[:mgr | |
|
1526 |
(mgr isResponsibleForModule:module) ifTrue:[^ mgr ]. |
|
1527 |
] |
|
10166 | 1528 |
]. |
1529 |
]. |
|
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1530 |
^ Smalltalk at:#SourceCodeManager |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1531 |
|
10166 | 1532 |
" |
1533 |
Array sourceCodeManager |
|
1534 |
foo_p1 sourceCodeManager |
|
1535 |
" |
|
1536 |
||
1537 |
"Created: / 07-12-1995 / 13:16:46 / cg" |
|
10220
7332b36bc81e
avoid need for libbasic3 (due to packageID reference)
Claus Gittinger <cg@exept.de>
parents:
10195
diff
changeset
|
1538 |
"Modified: / 05-12-2006 / 22:04:26 / cg" |
1 | 1539 |
! ! |
1540 |
||
5257 | 1541 |
!Class methodsFor:'adding & removing'! |
1 | 1542 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1543 |
unload |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1544 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1545 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1546 |
"if the receiver was autoloaded, unload and reinstall it as |
293 | 1547 |
autoloaded. Can be used to get rid of no longer needed autoloaded |
8551 | 1548 |
classes. |
328 | 1549 |
(maybe, autoloaded classes should unload themselfes when no |
8551 | 1550 |
longer needed - for example, after some delay when the last instance |
328 | 1551 |
is gone ...)" |
293 | 1552 |
|
9371
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1553 |
|nm newClass privateClasses| |
293 | 1554 |
|
216 | 1555 |
self wasAutoloaded ifFalse:[ |
8726 | 1556 |
" |
1557 |
can it be done ? |
|
1558 |
(all of my methods must have a source) |
|
1559 |
" |
|
1560 |
self instAndClassSelectorsAndMethodsDo:[:sel :aMethod | |
|
1561 |
aMethod source isNil ifTrue:[^false]. |
|
1562 |
aMethod hasPrimitiveCode ifTrue:[^ false]. |
|
1563 |
]. |
|
216 | 1564 |
]. |
1565 |
||
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1566 |
"/ cannot unload, if non-autoloaded subclasses exist ... |
9371
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1567 |
self allSubclassesDo:[:eachSubclass | |
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1568 |
eachSubclass wasAutoloaded ifFalse:[ |
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1569 |
eachSubclass isPrivate ifFalse:[ |
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1570 |
self warn:('cannot unload ' , self name , ' (' , eachSubclass name , ' requires it)'). |
8726 | 1571 |
^ false. |
1572 |
] |
|
1573 |
] |
|
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1574 |
]. |
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1575 |
|
9371
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1576 |
self allSubclassesDo:[:eachSubclass | |
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1577 |
eachSubclass wasAutoloaded ifTrue:[ |
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1578 |
eachSubclass unload |
8726 | 1579 |
] ifFalse:[ |
9371
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1580 |
eachSubclass removeFromSystem. |
8726 | 1581 |
] |
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1582 |
]. |
9371
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1583 |
privateClasses := self privateClasses. |
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1584 |
privateClasses notEmpty ifTrue:[ |
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1585 |
self withoutUpdatingChangesDo:[ |
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1586 |
privateClasses do:[:eachPrivateClass | |
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1587 |
eachPrivateClass removeFromSystem. |
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1588 |
]. |
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1589 |
]. |
283 | 1590 |
]. |
1415 | 1591 |
Transcript showCR:'unloading ' , name , ' ...'. |
283 | 1592 |
|
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1593 |
"/ reinstall as autoloaded |
8551 | 1594 |
Autoload removeClass:self. |
293 | 1595 |
nm := name. |
1596 |
Smalltalk at:nm put:nil. |
|
288 | 1597 |
ObjectMemory flushInlineCaches. |
1598 |
ObjectMemory flushMethodCache. |
|
4052 | 1599 |
newClass := Autoload addClass:nm inCategory:category. |
1600 |
newClass notNil ifTrue:[ |
|
8726 | 1601 |
newClass package:package |
4052 | 1602 |
]. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1603 |
Smalltalk flushCachedClasses. |
216 | 1604 |
^ true |
1605 |
||
1606 |
" |
|
1607 |
Clock open. |
|
1608 |
Clock unload. |
|
1609 |
ClockView unload. |
|
1610 |
Clock open |
|
1611 |
" |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1612 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1613 |
"Modified: 7.6.1996 / 09:15:05 / stefan" |
2675
bb724aff9c75
stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents:
2671
diff
changeset
|
1614 |
"Modified: 4.6.1997 / 14:48:02 / cg" |
1 | 1615 |
! ! |
1616 |
||
9821 | 1617 |
!Class methodsFor:'adding/removing'! |
1618 |
||
1619 |
removeFromSystem |
|
1620 |
"ST-80 compatibility |
|
1621 |
remove myself from the system" |
|
1622 |
||
1623 |
Smalltalk removeClass:self. |
|
1624 |
Smalltalk removeKey:name. |
|
1625 |
||
1626 |
"Created: 6.2.1996 / 11:32:58 / stefan" |
|
1627 |
! ! |
|
1628 |
||
11413 | 1629 |
|
1 | 1630 |
!Class methodsFor:'changes management'! |
1631 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1632 |
addChangeRecordForChangeCategory |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1633 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1634 |
|
6097 | 1635 |
"add a category change" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1636 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1637 |
Class updateChangeFileQuerySignal query ifTrue:[ |
8726 | 1638 |
self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category. |
6097 | 1639 |
]. |
1640 |
||
1641 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1642 |
Project notNil ifTrue:[ |
|
8726 | 1643 |
UpdateChangeListQuerySignal query ifTrue:[ |
1644 |
Project addClassDefinitionChangeFor:self |
|
1645 |
] |
|
2256 | 1646 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1647 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1648 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1649 |
addChangeRecordForClass:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1650 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1651 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1652 |
"add a class-definition-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1653 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1654 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8726 | 1655 |
self writingChangePerform:#addChangeRecordForClass:to: with:aClass. |
6166 | 1656 |
]. |
1657 |
||
1658 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1659 |
Project notNil ifTrue:[ |
|
8726 | 1660 |
UpdateChangeListQuerySignal query ifTrue:[ |
1661 |
Project addClassDefinitionChangeFor:aClass |
|
1662 |
] |
|
2256 | 1663 |
] |
1664 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1665 |
"Modified: / 24.1.1997 / 19:09:41 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1666 |
"Modified: / 18.3.1999 / 18:14:04 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1667 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1668 |
|
620 | 1669 |
addChangeRecordForClassCheckIn:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1670 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1671 |
|
620 | 1672 |
"append a class-was-checkedIn-record to the changes file" |
1673 |
||
1938 | 1674 |
|rv| |
1675 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1676 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8726 | 1677 |
rv := aClass revision. |
1678 |
rv isNil ifTrue:[rv := '???']. |
|
1679 |
||
1680 |
self |
|
1681 |
writingChangeWithTimeStamp:false |
|
1682 |
perform:#addInfoRecord:to: |
|
1683 |
with:('checkin ' , aClass name , ' (' , rv , ')'). |
|
2256 | 1684 |
] |
620 | 1685 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1686 |
"Created: / 18.11.1995 / 17:04:58 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1687 |
"Modified: / 24.1.1997 / 19:11:55 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1688 |
"Modified: / 18.3.1999 / 18:14:14 / stefan" |
620 | 1689 |
! |
1690 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1691 |
addChangeRecordForClassComment:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1692 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1693 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1694 |
"add a class-comment-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1695 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1696 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8726 | 1697 |
self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass. |
6166 | 1698 |
]. |
1699 |
||
1700 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1701 |
Project notNil ifTrue:[ |
|
8726 | 1702 |
UpdateChangeListQuerySignal query ifTrue:[ |
1703 |
Project addClassCommentChangeFor:aClass |
|
1704 |
] |
|
2256 | 1705 |
] |
1706 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1707 |
"Modified: / 24.1.1997 / 19:09:59 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1708 |
"Modified: / 18.3.1999 / 18:14:23 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1709 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1710 |
|
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1711 |
addChangeRecordForClassContainerRemove:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1712 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1713 |
|
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1714 |
"append a container-was-removed-record to the changes file" |
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1715 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1716 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8726 | 1717 |
self |
1718 |
writingChangeWithTimeStamp:false |
|
1719 |
perform:#addInfoRecord:to: |
|
1720 |
with:('removed source container of ' , aClass name). |
|
2256 | 1721 |
] |
1722 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1723 |
"Created: / 11.9.1996 / 15:37:19 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1724 |
"Modified: / 24.1.1997 / 19:12:05 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1725 |
"Modified: / 18.3.1999 / 18:14:31 / stefan" |
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1726 |
! |
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1727 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1728 |
addChangeRecordForClassFileOut:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1729 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1730 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1731 |
"append a class-was-filedOut-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1732 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1733 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8726 | 1734 |
self |
1735 |
writingChangeWithTimeStamp:false |
|
1736 |
perform:#addInfoRecord:to: |
|
1737 |
with:('fileOut ' , aClass name). |
|
2256 | 1738 |
] |
1739 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1740 |
"Modified: / 24.1.1997 / 19:12:14 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1741 |
"Modified: / 18.3.1999 / 18:14:36 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1742 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1743 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1744 |
addChangeRecordForClassInstvars:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1745 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1746 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1747 |
"add a class-instvars-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1748 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1749 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8726 | 1750 |
self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass. |
6166 | 1751 |
]. |
1752 |
||
1753 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1754 |
Project notNil ifTrue:[ |
|
8726 | 1755 |
UpdateChangeListQuerySignal query ifTrue:[ |
1756 |
Project addInstVarDefinitionChangeFor:aClass class |
|
1757 |
] |
|
2256 | 1758 |
] |
1759 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1760 |
"Modified: / 24.1.1997 / 19:10:18 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1761 |
"Modified: / 18.3.1999 / 18:14:43 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1762 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1763 |
|
7179 | 1764 |
addChangeRecordForClassRemove |
1765 |
"{ Pragma: +optSpace }" |
|
1766 |
||
1767 |
"add a class-remove-record to the changes file" |
|
1768 |
||
1769 |
UpdateChangeFileQuerySignal query ifTrue:[ |
|
8726 | 1770 |
self writingChangePerform:#addChangeRecordForClassRemove:to: with:self. |
7179 | 1771 |
]. |
1772 |
||
1773 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1774 |
Project notNil ifTrue:[ |
|
8726 | 1775 |
UpdateChangeListQuerySignal query ifTrue:[ |
1776 |
Project addClassRemoveChange:self |
|
1777 |
] |
|
7179 | 1778 |
] |
1779 |
||
1780 |
"Modified: / 24.1.1997 / 19:10:25 / cg" |
|
1781 |
"Modified: / 18.3.1999 / 18:14:53 / stefan" |
|
1782 |
! |
|
1783 |
||
6166 | 1784 |
addChangeRecordForClassRemove:oldClassName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1785 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1786 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1787 |
"add a class-remove-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1788 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1789 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8726 | 1790 |
self writingChangePerform:#addChangeRecordForClassRemove:to: with:self. |
6166 | 1791 |
]. |
1792 |
||
1793 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1794 |
Project notNil ifTrue:[ |
|
8726 | 1795 |
UpdateChangeListQuerySignal query ifTrue:[ |
1796 |
Project addClassRemoveChange:self |
|
1797 |
] |
|
2256 | 1798 |
] |
1799 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1800 |
"Modified: / 24.1.1997 / 19:10:25 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1801 |
"Modified: / 18.3.1999 / 18:14:53 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1802 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1803 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1804 |
addChangeRecordForClassRename:oldName to:newName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1805 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1806 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1807 |
"add a class-rename-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1808 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1809 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8726 | 1810 |
self writingChangeDo:[:aStream | |
1811 |
self addChangeRecordForClassRename:oldName to:newName to:aStream |
|
1812 |
] |
|
6166 | 1813 |
]. |
1814 |
||
1815 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1816 |
Project notNil ifTrue:[ |
|
8726 | 1817 |
UpdateChangeListQuerySignal query ifTrue:[ |
1818 |
Project addClassRenameChangeFrom:oldName to:newName |
|
1819 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1820 |
] |
1846 | 1821 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1822 |
"Modified: / 24.1.1997 / 19:10:35 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1823 |
"Modified: / 18.3.1999 / 18:14:59 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1824 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1825 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1826 |
addChangeRecordForPrimitiveDefinitions:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1827 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1828 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1829 |
"add a primitiveDefinitions-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1830 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1831 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8726 | 1832 |
self writingChangePerform:#addChangeRecordForPrimitiveDefinitions:to: with:aClass. |
6166 | 1833 |
]. |
1834 |
||
1835 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1836 |
Project notNil ifTrue:[ |
|
8726 | 1837 |
UpdateChangeListQuerySignal query ifTrue:[ |
1838 |
Project addPrimitiveDefinitionsChangeFor:aClass |
|
1839 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1840 |
] |
2206 | 1841 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1842 |
"Modified: / 20.1.1997 / 12:36:10 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1843 |
"Modified: / 18.3.1999 / 18:15:04 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1844 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1845 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1846 |
addChangeRecordForPrimitiveFunctions:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1847 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1848 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1849 |
"add a primitiveFunctions-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1850 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1851 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8726 | 1852 |
self writingChangePerform:#addChangeRecordForPrimitiveFunctions:to: with:aClass. |
6166 | 1853 |
]. |
1854 |
||
1855 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1856 |
Project notNil ifTrue:[ |
|
8726 | 1857 |
UpdateChangeListQuerySignal query ifTrue:[ |
1858 |
Project addPrimitiveFunctionsChangeFor:aClass |
|
1859 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1860 |
] |
2206 | 1861 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1862 |
"Modified: / 20.1.1997 / 12:36:13 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1863 |
"Modified: / 18.3.1999 / 18:15:09 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1864 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1865 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1866 |
addChangeRecordForPrimitiveVariables:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1867 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1868 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1869 |
"add a primitiveVariables-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1870 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1871 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8726 | 1872 |
self writingChangePerform:#addChangeRecordForPrimitiveVariables:to: with:aClass. |
6166 | 1873 |
]. |
1874 |
||
1875 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1876 |
Project notNil ifTrue:[ |
|
8726 | 1877 |
UpdateChangeListQuerySignal query ifTrue:[ |
1878 |
Project addPrimitiveVariablesChangeFor:aClass |
|
1879 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1880 |
] |
2206 | 1881 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1882 |
"Modified: / 20.1.1997 / 12:36:16 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1883 |
"Modified: / 18.3.1999 / 18:15:14 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1884 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1885 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1886 |
addChangeRecordForSnapshot:aFileName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1887 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1888 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1889 |
"add a snapshot-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1890 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1891 |
UpdateChangeFileQuerySignal query ifTrue:[ |
8726 | 1892 |
self |
1893 |
writingChangeWithTimeStamp:false |
|
1894 |
perform:#addChangeRecordForSnapshot:to: |
|
1895 |
with:aFileName. |
|
2256 | 1896 |
] |
1897 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1898 |
"Modified: / 24.1.1997 / 19:12:25 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1899 |
"Modified: / 18.3.1999 / 18:15:20 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1900 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1901 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1902 |
addChangeRecordForSnapshot:aFileName to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1903 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1904 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1905 |
"add a snapshot-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1906 |
|
6166 | 1907 |
self addInfoRecord:('snapshot ' , aFileName) to:aStream |
2256 | 1908 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1909 |
"Modified: / 24.1.1997 / 19:11:08 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1910 |
"Modified: / 18.3.1999 / 18:15:30 / stefan" |
2917 | 1911 |
! ! |
1912 |
||
1824 | 1913 |
!Class methodsFor:'enumerating'! |
1914 |
||
3997 | 1915 |
allPrivateClassesDo:aBlock |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1916 |
"evaluate aBlock on all of my private classes (if any). |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1917 |
Evaluation is in no particular order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1918 |
|
8551 | 1919 |
self allPrivateClasses do:aBlock |
3997 | 1920 |
! |
1921 |
||
1824 | 1922 |
privateClassesDo:aBlock |
5715
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
1923 |
"evaluate aBlock on all of my (immediate) private classes (if any). |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1924 |
Evaluation is in no particular order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1925 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1926 |
self privateClasses do:aBlock |
5715
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
1927 |
! |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
1928 |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1929 |
subclassesDo:aBlock |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1930 |
"evaluate the argument, aBlock for all immediate subclasses. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1931 |
This will only enumerate globally known classes - for anonymous |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1932 |
behaviors, you have to walk over all instances of Behavior." |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1933 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1934 |
|coll| |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1935 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1936 |
"/ use cached information (avoid class hierarchy search) |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1937 |
"/ if possible |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1938 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1939 |
SubclassInfo isNil ifTrue:[ |
8726 | 1940 |
Class subclassInfo |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1941 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1942 |
SubclassInfo notNil ifTrue:[ |
8726 | 1943 |
coll := SubclassInfo at:self ifAbsent:nil. |
1944 |
coll notNil ifTrue:[ |
|
1945 |
coll do:aBlock. |
|
1946 |
]. |
|
1947 |
^ self |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1948 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1949 |
|
8285 | 1950 |
coll := OrderedCollection new. |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1951 |
Smalltalk allClassesDo:[:aClass | |
8726 | 1952 |
(aClass superclass == self) ifTrue:[ |
1953 |
coll add:aClass |
|
1954 |
] |
|
8285 | 1955 |
]. |
1956 |
||
1957 |
SubclassInfo notNil ifTrue:[ |
|
8726 | 1958 |
SubclassInfo at:self put:coll. |
8285 | 1959 |
]. |
1960 |
||
1961 |
coll do:aBlock. |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1962 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1963 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1964 |
Collection subclassesDo:[:c | Transcript showCR:(c name)] |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1965 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1966 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1967 |
"Modified: 22.1.1997 / 18:44:01 / cg" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1968 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1969 |
|
5715
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
1970 |
withAllPrivateClassesDo:aBlock |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
1971 |
"evaluate aBlock on myself and all of my private classes (if any). |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
1972 |
This recurses into private classes of private classes. |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
1973 |
Evaluation is in no particular order." |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
1974 |
|
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
1975 |
aBlock value:self. |
8551 | 1976 |
self allPrivateClasses do:aBlock |
1824 | 1977 |
! ! |
1978 |
||
1 | 1979 |
!Class methodsFor:'fileIn interface'! |
1980 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1981 |
primitiveDefinitions |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
1982 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
1983 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
1984 |
It returns a CCReader which reads the next chunks and installs the |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
1985 |
unprocessed contents in the classes primitiveDefinitions section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
1986 |
Thus, although the definitions are NOT processed, they are still visible, |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
1987 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
1988 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
1989 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
1990 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
1991 |
"Modified: 10.2.1996 / 12:47:12 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1992 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1993 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1994 |
primitiveFunctions |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
1995 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
1996 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
1997 |
It returns a CCReader which reads the next chunks and installs the |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
1998 |
unprocessed contents in the classes primitiveFunctions section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
1999 |
Thus, although the functions are NOT processed, they are still visible, |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2000 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2001 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2002 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2003 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2004 |
"Modified: 10.2.1996 / 12:47:07 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2005 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2006 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2007 |
primitiveVariables |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2008 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2009 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2010 |
It returns a CCReader which reads the next chunks and installs the |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2011 |
unprocessed contents in the classes primitiveVariables section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2012 |
Thus, although the variables are NOT processed, they are still visible, |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2013 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2014 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2015 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2016 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2017 |
"Modified: 10.2.1996 / 12:47:28 / cg" |
1 | 2018 |
! ! |
2019 |
||
2020 |
!Class methodsFor:'fileOut'! |
|
2021 |
||
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2022 |
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2023 |
"append an expression on aStream, which defines myself." |
238 | 2024 |
|
5344
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2025 |
self |
8726 | 2026 |
basicFileOutDefinitionOn:aStream |
2027 |
withNameSpace:forceNameSpace |
|
2028 |
withPackage:true |
|
5344
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2029 |
|
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2030 |
! |
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2031 |
|
8551 | 2032 |
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:showPackage |
5344
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2033 |
"append an expression on aStream, which defines myself." |
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2034 |
|
8551 | 2035 |
self class |
8726 | 2036 |
basicFileOutDefinitionOf:self |
2037 |
on:aStream |
|
2038 |
withNameSpace:forceNameSpace withPackage:showPackage |
|
1707 | 2039 |
! |
2040 |
||
8716 | 2041 |
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:showPackage syntaxHilighting:syntaxHilighting |
2042 |
"append an expression on aStream, which defines myself." |
|
2043 |
||
2044 |
self class |
|
2045 |
basicFileOutDefinitionOf:self |
|
2046 |
on:aStream |
|
2047 |
withNameSpace:forceNameSpace |
|
2048 |
withPackage:showPackage |
|
2049 |
syntaxHilighting:syntaxHilighting |
|
2050 |
! |
|
2051 |
||
1707 | 2052 |
basicFileOutInstvarTypeKeywordOn:aStream |
2053 |
"a helper for fileOutDefinition" |
|
2054 |
||
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2055 |
|isVar superclass| |
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2056 |
|
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2057 |
superclass := self superclass. |
1707 | 2058 |
superclass isNil ifTrue:[ |
8726 | 2059 |
isVar := self isVariable |
1707 | 2060 |
] ifFalse:[ |
8726 | 2061 |
"I cant remember what this is for ?" |
2062 |
isVar := (self isVariable and:[superclass isVariable not]) |
|
1707 | 2063 |
]. |
2064 |
||
3920
0c1b9b2fa23b
added longlong indexed instvars;
Claus Gittinger <cg@exept.de>
parents:
3788
diff
changeset
|
2065 |
aStream nextPutAll:(self firstDefinitionSelectorPart). |
1707 | 2066 |
|
2067 |
"Created: 11.10.1996 / 18:57:29 / cg" |
|
1 | 2068 |
! |
2069 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2070 |
fileOut |
894
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2071 |
"create a file 'class.st' consisting of all methods in myself in |
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2072 |
sourceForm, from which the class can be reconstructed (by filing in). |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2073 |
If the current project is not nil, create the file in the projects |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2074 |
directory. Care is taken, to not clobber any existing file in |
8551 | 2075 |
case of errors (for example: disk full). |
2076 |
Also, since the classes methods need a valid sourcefile, the current |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2077 |
sourceFile may not be rewritten." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2078 |
|
7693 | 2079 |
|dirName nm fileName| |
2080 |
||
10053 | 2081 |
nm := (Smalltalk fileNameForClass:self name),'.st'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2082 |
|
139 | 2083 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2084 |
this test allows a smalltalk to be built without Projects/ChangeSets |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2085 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2086 |
Project notNil ifTrue:[ |
8726 | 2087 |
dirName := Project currentProjectDirectory |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2088 |
] ifFalse:[ |
8726 | 2089 |
dirName := Filename currentDirectory |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2090 |
]. |
3788
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2091 |
fileName := (dirName asFilename construct:nm). |
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2092 |
fileName makeLegalFilename. |
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2093 |
|
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2094 |
self fileOutAs:fileName name. |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2095 |
|
2771 | 2096 |
"/ " |
2097 |
"/ add a change record; that way, administration is much easier, |
|
8551 | 2098 |
"/ since we can see in that changeBrowser, which changes have |
2771 | 2099 |
"/ already found their way into a sourceFile and which must be |
2100 |
"/ applied again |
|
2101 |
"/ " |
|
2102 |
"/ self addChangeRecordForClassFileOut:self |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2103 |
|
10053 | 2104 |
"Modified: / 07-06-1996 / 09:14:43 / stefan" |
2105 |
"Modified: / 06-10-2006 / 16:16:19 / cg" |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2106 |
! |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2107 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2108 |
fileOutAllMethodsOn:aStream |
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2109 |
self fileOutAllMethodsOn:aStream methodFilter:nil |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2110 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2111 |
"Created: 15.10.1996 / 11:13:00 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2112 |
"Modified: 22.3.1997 / 16:12:17 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2113 |
! |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2114 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2115 |
fileOutAllMethodsOn:aStream methodFilter:methodFilter |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2116 |
|collectionOfCategories| |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2117 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2118 |
collectionOfCategories := self class categories asSortedCollection. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2119 |
collectionOfCategories notNil ifTrue:[ |
8726 | 2120 |
collectionOfCategories do:[:aCategory | |
2121 |
self class fileOutCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2122 |
aStream cr |
|
2123 |
] |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2124 |
]. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2125 |
collectionOfCategories := self categories asSortedCollection. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2126 |
collectionOfCategories notNil ifTrue:[ |
8726 | 2127 |
collectionOfCategories do:[:aCategory | |
2128 |
self fileOutCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2129 |
aStream cr |
|
2130 |
] |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2131 |
]. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2132 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2133 |
self privateClassesSorted do:[:aClass | |
8726 | 2134 |
aClass fileOutAllMethodsOn:aStream methodFilter:methodFilter |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2135 |
]. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2136 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2137 |
"Created: 15.10.1996 / 11:13:00 / cg" |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2138 |
"Modified: 22.3.1997 / 16:12:17 / cg" |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2139 |
! |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2140 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2141 |
fileOutAs:fileNameString |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2142 |
"create a file consisting of all methods in myself in |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2143 |
sourceForm, from which the class can be reconstructed (by filing in). |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2144 |
The given fileName should be a full path, including suffix. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2145 |
Care is taken, to not clobber any existing file in |
8551 | 2146 |
case of errors (for example: disk full). |
2147 |
Also, since the classes methods need a valid sourcefile, the current |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2148 |
sourceFile may not be rewritten." |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2149 |
|
2958
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
2150 |
|aStream fileName newFileName savFilename needRename |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2151 |
mySourceFileName sameFile s mySourceFileID anySourceRef| |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2152 |
|
3750
d544994a1c3e
in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents:
3702
diff
changeset
|
2153 |
self isLoaded ifFalse:[ |
8726 | 2154 |
^ FileOutErrorSignal |
2155 |
raiseRequestWith:self |
|
2156 |
errorString:' - will not fileOut unloaded class: ', self name |
|
3750
d544994a1c3e
in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents:
3702
diff
changeset
|
2157 |
]. |
d544994a1c3e
in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents:
3702
diff
changeset
|
2158 |
|
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2159 |
fileName := fileNameString asFilename. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2160 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2161 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2162 |
if file exists, copy the existing to a .sav-file, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2163 |
create the new file as XXX.new-file, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2164 |
and, if that worked rename afterwards ... |
153 | 2165 |
" |
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2166 |
(fileName exists) ifTrue:[ |
8726 | 2167 |
sameFile := false. |
2168 |
||
2169 |
"/ check carefully - maybe, my source does not really come from that |
|
2170 |
"/ file (i.e. all of my methods have their source as string) |
|
2171 |
||
2172 |
anySourceRef := false. |
|
2173 |
self instAndClassMethodsDo:[:m | |
|
2174 |
m sourcePosition notNil ifTrue:[ |
|
2175 |
anySourceRef := true |
|
2176 |
] |
|
2177 |
]. |
|
2178 |
||
2179 |
anySourceRef ifTrue:[ |
|
2180 |
s := self sourceStream. |
|
2181 |
s notNil ifTrue:[ |
|
10035
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2182 |
OperatingSystem isUNIXlike ifTrue:[ |
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2183 |
mySourceFileID := s pathName asFilename info id. |
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2184 |
sameFile := (fileName info id) == mySourceFileID. |
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2185 |
] ifFalse:[ |
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2186 |
mySourceFileID := s pathName asFilename asAbsoluteFilename. |
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2187 |
sameFile := (fileName asFilename asAbsoluteFilename) = mySourceFileID. |
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2188 |
]. |
8726 | 2189 |
s close. |
2190 |
] ifFalse:[ |
|
2191 |
classFilename notNil ifTrue:[ |
|
2192 |
" |
|
2193 |
check for overwriting my current source file |
|
2194 |
this is not allowed, since it would clobber my methods source |
|
2195 |
file ... you have to save it to some other place. |
|
2196 |
This happens if you ask for a fileOut into the source-directory |
|
2197 |
(from which my methods get their source) |
|
2198 |
" |
|
2199 |
mySourceFileName := Smalltalk getSourceFileName:classFilename. |
|
2200 |
sameFile := (fileNameString = mySourceFileName). |
|
2201 |
sameFile ifFalse:[ |
|
2202 |
mySourceFileName notNil ifTrue:[ |
|
10035
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2203 |
OperatingSystem isUNIXlike ifTrue:[ |
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2204 |
sameFile := (fileName info id) == (mySourceFileName asFilename info id) |
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2205 |
] |
8726 | 2206 |
] |
2207 |
]. |
|
2208 |
] |
|
2209 |
]. |
|
2210 |
]. |
|
2211 |
||
2212 |
sameFile ifTrue:[ |
|
2213 |
^ FileOutErrorSignal |
|
2214 |
raiseRequestWith:fileNameString |
|
2215 |
errorString:(' - may not overwrite sourcefile:', fileNameString) |
|
2216 |
]. |
|
2217 |
||
2218 |
savFilename := Filename newTemporary. |
|
2219 |
fileName copyTo:savFilename. |
|
2220 |
newFileName := fileName withSuffix:'new'. |
|
2221 |
needRename := true |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2222 |
] ifFalse:[ |
8726 | 2223 |
"/ another possible trap: if my sourceFileName is |
2224 |
"/ the same as the written one AND the new files directory |
|
2225 |
"/ is along the sourcePath, we also need a temporary file |
|
2226 |
"/ first, to avoid accessing the newly written file. |
|
2227 |
||
2228 |
anySourceRef := false. |
|
2229 |
self instAndClassMethodsDo:[:m | |
|
2230 |
|mSrc| |
|
2231 |
||
2232 |
(mSrc := m sourceFilename) notNil ifTrue:[ |
|
2233 |
mSrc asFilename baseName = fileName baseName ifTrue:[ |
|
2234 |
anySourceRef := true |
|
2235 |
] |
|
2236 |
] |
|
2237 |
]. |
|
2238 |
anySourceRef ifTrue:[ |
|
2239 |
newFileName := fileName withSuffix:'new'. |
|
2240 |
needRename := true |
|
2241 |
] ifFalse:[ |
|
2242 |
newFileName := fileName. |
|
2243 |
needRename := false |
|
2244 |
] |
|
1 | 2245 |
]. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2246 |
[ |
8726 | 2247 |
aStream := newFileName writeStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2248 |
] on:FileStream openErrorSignal do:[:ex| |
8726 | 2249 |
savFilename notNil ifTrue:[ |
2250 |
savFilename delete |
|
2251 |
]. |
|
2252 |
^ FileOutErrorSignal |
|
2253 |
raiseRequestWith:newFileName name |
|
2254 |
errorString:(' - cannot create file:', newFileName name) |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2255 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2256 |
self fileOutOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2257 |
aStream close. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2258 |
|
199 | 2259 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2260 |
finally, replace the old-file |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2261 |
be careful, if the old one is a symbolic link; in this case, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2262 |
we have to do a copy ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2263 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2264 |
needRename ifTrue:[ |
8726 | 2265 |
newFileName copyTo:fileName. |
2266 |
newFileName delete |
|
2958
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
2267 |
]. |
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
2268 |
savFilename notNil ifTrue:[ |
8726 | 2269 |
savFilename delete |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2270 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2271 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2272 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2273 |
add a change record; that way, administration is much easier, |
8551 | 2274 |
since we can see in that changeBrowser, which changes have |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2275 |
already found their way into a sourceFile and which must be |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2276 |
applied again |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2277 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2278 |
self addChangeRecordForClassFileOut:self |
1107
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2279 |
|
10035
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2280 |
"Modified: / 07-06-1996 / 09:14:43 / stefan" |
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2281 |
"Created: / 16-04-1997 / 20:44:05 / cg" |
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2282 |
"Modified: / 04-10-2006 / 17:26:23 / cg" |
1753
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2283 |
! |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2284 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2285 |
fileOutClassInstVarDefinitionOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2286 |
"append an expression to define my classInstanceVariables on aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2287 |
|
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8267
diff
changeset
|
2288 |
self class |
8726 | 2289 |
fileOutClassInstVarDefinitionOn:aStream |
2290 |
withNameSpace:false |
|
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2291 |
! |
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2292 |
|
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2293 |
fileOutClassInstVarDefinitionOn:aStream withNameSpace:withNameSpace |
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2294 |
"append an expression to define my classInstanceVariables on aStream" |
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2295 |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2296 |
|anySuperClassInstVar| |
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2297 |
|
5296
12a5de62fef7
class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents:
5257
diff
changeset
|
2298 |
self isLoaded ifFalse:[ |
8726 | 2299 |
^ self basicFileOutDefinitionOn:aStream withNameSpace:withNameSpace |
5296
12a5de62fef7
class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents:
5257
diff
changeset
|
2300 |
]. |
12a5de62fef7
class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents:
5257
diff
changeset
|
2301 |
|
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2302 |
withNameSpace ifTrue:[ |
8726 | 2303 |
self name printOn:aStream. |
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2304 |
] ifFalse:[ |
8726 | 2305 |
self printClassNameOn:aStream. |
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2306 |
]. |
3338
0423dac35a45
dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
2307 |
aStream nextPutAll:' class instanceVariableNames:'''. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2308 |
self class printInstVarNamesOn:aStream indent:8. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2309 |
aStream nextPutAll:''''. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2310 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2311 |
"mhmh - good idea; saw this in SmallDraw sourcecode ..." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2312 |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2313 |
anySuperClassInstVar := false. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2314 |
self allSuperclassesDo:[:aSuperClass | |
8726 | 2315 |
aSuperClass class instVarNames do:[:ignored | anySuperClassInstVar := true]. |
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2316 |
]. |
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2317 |
|
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2318 |
aStream cr; cr; nextPut:(Character doubleQuote); cr; space. |
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2319 |
anySuperClassInstVar ifFalse:[ |
8726 | 2320 |
aStream |
2321 |
nextPutLine:'No other class instance variables are inherited by this class.'. |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2322 |
] ifTrue:[ |
8726 | 2323 |
aStream |
2324 |
nextPutLine:'The following class instance variables are inherited by this class:'. |
|
2325 |
aStream cr. |
|
2326 |
self allSuperclassesDo:[:aSuperClass | |
|
2327 |
aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '. |
|
2328 |
aStream nextPutLine:(aSuperClass class instanceVariableString). |
|
2329 |
]. |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2330 |
|
556 | 2331 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2332 |
aStream nextPut:(Character doubleQuote); cr. |
733
983d045c17f5
make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
2333 |
|
3338
0423dac35a45
dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
2334 |
"Created: / 10.12.1995 / 16:31:25 / cg" |
0423dac35a45
dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
2335 |
"Modified: / 1.4.1997 / 16:00:33 / stefan" |
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2336 |
"Modified: / 3.2.2000 / 23:05:28 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2337 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2338 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2339 |
fileOutCommentOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2340 |
"append an expression on aStream, which defines my comment" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2341 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2342 |
|comment s| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2343 |
|
2011
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
2344 |
self printClassNameOn:aStream. |
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
2345 |
aStream nextPutAll:' comment:'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2346 |
(comment := self comment) isNil ifTrue:[ |
8726 | 2347 |
s := '''''' |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2348 |
] ifFalse:[ |
8726 | 2349 |
s := comment storeString |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2350 |
]. |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2351 |
aStream nextPutAllAsChunk:s. |
1063
b45a722a10c3
oops - forgot excla after comment-chunk
Claus Gittinger <cg@exept.de>
parents:
989
diff
changeset
|
2352 |
aStream nextPutChunkSeparator. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2353 |
aStream cr |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2354 |
|
2011
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
2355 |
"Modified: 21.12.1996 / 13:36:01 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2356 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2357 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2358 |
fileOutDefinitionOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2359 |
"append an expression on aStream, which defines myself." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2360 |
|
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2361 |
^ self basicFileOutDefinitionOn:aStream withNameSpace:false |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2362 |
|
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2363 |
"Modified: 4.1.1997 / 20:55:18 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2364 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2365 |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2366 |
fileOutIn:aDirectoryName |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2367 |
"create a file 'class.st' consisting of all methods in self in |
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2368 |
directory aDirectoryName (ignoring any directory setting in |
8551 | 2369 |
the current project). |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2370 |
This is not logged in that change file (should it be ?)." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2371 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2372 |
|aStream fileName| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2373 |
|
10053 | 2374 |
fileName := (Smalltalk fileNameForClass:self name),'.st'. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2375 |
[ |
8726 | 2376 |
aStream := (aDirectoryName asFilename construct:fileName) writeStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2377 |
] on:FileStream openErrorSignal do:[:ex| |
8726 | 2378 |
^ FileOutErrorSignal |
2379 |
raiseRequestWith:fileName |
|
2380 |
errorString:(' - cannot create file:', fileName) |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2381 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2382 |
self fileOutOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2383 |
aStream close |
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2384 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2385 |
" |
8726 | 2386 |
self fileOutIn:'/tmp' |
2387 |
self fileOutIn:'/tmp/doesNotExistBla' |
|
2388 |
self fileOutIn:'/tmp' asFilename |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2389 |
" |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2390 |
|
10053 | 2391 |
"Modified: / 19-09-1997 / 00:03:53 / stefan" |
2392 |
"Modified: / 06-10-2006 / 16:16:13 / cg" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2393 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2394 |
|
555 | 2395 |
fileOutOn:aStream |
2396 |
"file out my definition and all methods onto aStream" |
|
2397 |
||
2398 |
^ self fileOutOn:aStream withTimeStamp:true |
|
2399 |
||
2400 |
"Created: 15.11.1995 / 12:53:32 / cg" |
|
2046 | 2401 |
"Modified: 3.1.1997 / 17:50:28 / cg" |
555 | 2402 |
! |
2403 |
||
2404 |
fileOutOn:aStream withTimeStamp:stampIt |
|
3339
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2405 |
"file out my definition and all methods onto aStream. |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2406 |
If stampIt is true, a timeStamp comment is prepended." |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2407 |
|
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2408 |
self fileOutOn:aStream withTimeStamp:stampIt withInitialize:true |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2409 |
|
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2410 |
"Modified: / 13.3.1998 / 12:23:02 / cg" |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2411 |
! |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2412 |
|
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2413 |
fileOutOn:aStream withTimeStamp:stampIt withInitialize:initIt |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2414 |
"file out my definition and all methods onto aStream. |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2415 |
If stampIt is true, a timeStamp comment is prepended. |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2416 |
If initIt is true, and the class implements a class-initialize method, |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2417 |
append a corresponding doIt expression for initialization." |
555 | 2418 |
|
8551 | 2419 |
self |
8726 | 2420 |
fileOutOn:aStream |
2421 |
withTimeStamp:stampIt |
|
2422 |
withInitialize:initIt |
|
2423 |
withDefinition:true |
|
2424 |
methodFilter:nil |
|
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2425 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2426 |
"Created: / 15.11.1995 / 12:53:06 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2427 |
"Modified: / 1.4.1997 / 16:01:05 / stefan" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2428 |
"Modified: / 13.3.1998 / 12:23:59 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2429 |
! |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2430 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2431 |
fileOutOn:aStream withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2432 |
"file out my definition and all methods onto aStream. |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2433 |
If stampIt is true, a timeStamp comment is prepended. |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2434 |
If initIt is true, and the class implements a class-initialize method, |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2435 |
append a corresponding doIt expression for initialization. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2436 |
The order by which the fileOut is done is used to put the version string at the end. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2437 |
Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move" |
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2438 |
|
8212 | 2439 |
|encoder any16Bit| |
8164 | 2440 |
|
11699 | 2441 |
any16Bit := self instAndClassMethods |
2442 |
contains:[:m | |
|
2443 |
|src| |
|
2444 |
||
2445 |
src := m source ? ''. |
|
2446 |
(src contains:[:ch | ch codePoint > 16rFF]) |
|
2447 |
]. |
|
2448 |
||
8551 | 2449 |
any16Bit ifTrue:[ |
8726 | 2450 |
encoder := CharacterEncoder encoderForUTF8. |
8075 | 2451 |
]. |
8051
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2452 |
^ self |
8726 | 2453 |
fileOutOn:aStream |
2454 |
withTimeStamp:stampIt |
|
2455 |
withInitialize:initIt |
|
2456 |
withDefinition:withDefinition |
|
2457 |
methodFilter:methodFilter |
|
2458 |
encoder:encoder |
|
8051
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2459 |
! |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2460 |
|
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2461 |
fileOutOn:outStreamArg withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter encoder:encoderOrNil |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2462 |
"file out my definition and all methods onto aStream. |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2463 |
If stampIt is true, a timeStamp comment is prepended. |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2464 |
If initIt is true, and the class implements a class-initialize method, |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2465 |
append a corresponding doIt expression for initialization. |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2466 |
The order by which the fileOut is done is used to put the version string at the end. |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2467 |
Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move" |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2468 |
|
8230 | 2469 |
self class |
8726 | 2470 |
fileOutOn:outStreamArg |
2471 |
withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition |
|
2472 |
methodFilter:methodFilter encoder:encoderOrNil |
|
8230 | 2473 |
|
555 | 2474 |
|
3339
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2475 |
"Created: / 15.11.1995 / 12:53:06 / cg" |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2476 |
"Modified: / 1.4.1997 / 16:01:05 / stefan" |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2477 |
"Modified: / 13.3.1998 / 12:23:59 / cg" |
555 | 2478 |
! |
2479 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2480 |
fileOutPrimitiveDefinitionsOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2481 |
"append primitive defs (if any) to aStream." |
555 | 2482 |
|
2483 |
|s| |
|
2484 |
||
2485 |
" |
|
2486 |
primitive definitions - if any |
|
2487 |
" |
|
2488 |
(s := self primitiveDefinitionsString) notNil ifTrue:[ |
|
8726 | 2489 |
aStream nextPutChunkSeparator. |
2490 |
self printClassNameOn:aStream. |
|
2491 |
aStream nextPutAll:' primitiveDefinitions'; |
|
2492 |
nextPutChunkSeparator; |
|
2493 |
cr. |
|
2494 |
aStream nextPutAll:s. |
|
2495 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
555 | 2496 |
]. |
2497 |
(s := self primitiveVariablesString) notNil ifTrue:[ |
|
8726 | 2498 |
aStream nextPutChunkSeparator. |
2499 |
self printClassNameOn:aStream. |
|
2500 |
aStream nextPutAll:' primitiveVariables'; |
|
2501 |
nextPutChunkSeparator; |
|
2502 |
cr. |
|
2503 |
aStream nextPutAll:s. |
|
2504 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
555 | 2505 |
]. |
2088
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
2506 |
|
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
2507 |
"Modified: 8.1.1997 / 17:45:40 / cg" |
555 | 2508 |
! |
2509 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2510 |
fileOutPrimitiveSpecsOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2511 |
"append primitive defs (if any) to aStream." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2512 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2513 |
|s| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2514 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2515 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2516 |
primitive definitions - if any |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2517 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2518 |
self fileOutPrimitiveDefinitionsOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2519 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2520 |
primitive functions - if any |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2521 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2522 |
(s := self primitiveFunctionsString) notNil ifTrue:[ |
8726 | 2523 |
aStream nextPutChunkSeparator. |
2524 |
self printClassNameOn:aStream. |
|
2525 |
aStream nextPutAll:' primitiveFunctions'; |
|
2526 |
nextPutChunkSeparator; |
|
2527 |
cr. |
|
2528 |
aStream nextPutAll:s. |
|
2529 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2530 |
]. |
2088
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
2531 |
|
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
2532 |
"Modified: 8.1.1997 / 17:45:51 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2533 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2534 |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2535 |
!Class methodsFor:'fileOut-binary'! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2536 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2537 |
binaryFileOut |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2538 |
"create a file 'class.cls' (in the current projects fileOut-directory), |
8551 | 2539 |
consisting of all methods in myself in a portable binary format. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2540 |
The methods source is saved by reference |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2541 |
to the classes sourceFile if there is any. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2542 |
That sourcefile needs to be present after reload in order to be |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2543 |
browsable." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2544 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2545 |
self binaryFileOutWithSourceMode:#reference |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2546 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2547 |
"Modified: 5.1.1997 / 15:40:05 / cg" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2548 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2549 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2550 |
binaryFileOutOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2551 |
"append a binary representation of myself to aStream" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2552 |
|
8551 | 2553 |
self binaryFileOutOn:aStream sourceMode:#reference |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2554 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2555 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2556 |
binaryFileOutOn:aStream sourceMode:sourceMode |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2557 |
"append a binary representation of myself to aStream in |
8551 | 2558 |
a portable binary format. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2559 |
The argument controls how sources are to be saved: |
8726 | 2560 |
#keep - include the source |
2561 |
#reference - include a reference to the sourceFile |
|
2562 |
#discard - dont save sources. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2563 |
|
8551 | 2564 |
With #reference, the sourceFile needs to be present after reload |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2565 |
in order to be browsable." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2566 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2567 |
|bos| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2568 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2569 |
bos := BinaryObjectStorage onNew:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2570 |
bos sourceMode:sourceMode. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2571 |
bos nextPutClasses:(Array with:self). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2572 |
bos close. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2573 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2574 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2575 |
binaryFileOutWithSourceMode:sourceMode |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2576 |
"create a file 'class.cls' (in the current projects fileOut-directory), |
8551 | 2577 |
consisting of all methods in myself in a portable binary format. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2578 |
The argument controls how sources are to be saved: |
8726 | 2579 |
#keep - include the source |
2580 |
#reference - include a reference to the sourceFile |
|
2581 |
#discard - dont save sources. |
|
8551 | 2582 |
|
2583 |
With #reference, the sourceFile needs to be present after reload |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2584 |
in order to be browsable." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2585 |
|
7693 | 2586 |
|fileName dirName| |
2587 |
||
10053 | 2588 |
fileName := (Smalltalk fileNameForClass:self name), '.cls'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2589 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2590 |
Project notNil ifTrue:[ |
8726 | 2591 |
dirName := Project currentProjectDirectory |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2592 |
] ifFalse:[ |
8726 | 2593 |
dirName := '.' |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2594 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2595 |
fileName := dirName asFilename construct:fileName. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2596 |
fileName makeLegalFilename. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2597 |
fileName := fileName name. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2598 |
self binaryFileOutWithSourceMode:sourceMode as:fileName. |
10053 | 2599 |
|
2600 |
"Modified: / 06-10-2006 / 16:16:29 / cg" |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2601 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2602 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2603 |
binaryFileOutWithSourceMode:sourceMode as:fileNameString |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2604 |
"create a file fileNameString, |
8551 | 2605 |
consisting of all methods in myself in a portable binary format. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2606 |
The argument controls how sources are to be saved: |
8726 | 2607 |
#keep - include the source |
2608 |
#reference - include a reference to the sourceFile |
|
2609 |
#discard - dont save sources. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2610 |
|
8551 | 2611 |
With #reference, the sourceFile needs to be present after reload |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2612 |
in order to be browsable." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2613 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2614 |
|fileName aStream| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2615 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2616 |
fileName := fileNameString asFilename. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2617 |
fileName makeLegalFilename. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2618 |
|
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2619 |
[ |
8726 | 2620 |
aStream := fileName newReadWriteStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2621 |
] on:FileStream openErrorSignal do:[:ex| |
8726 | 2622 |
^ FileOutErrorSignal |
2623 |
raiseRequestWith:fileName name |
|
2624 |
errorString:(' - cannot create file:', fileName name) |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2625 |
]. |
8551 | 2626 |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2627 |
aStream binary. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2628 |
self binaryFileOutOn:aStream sourceMode:sourceMode. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2629 |
aStream close. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2630 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2631 |
"Created: / 29.12.1998 / 21:38:38 / cg" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2632 |
! ! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2633 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2634 |
!Class methodsFor:'fileOut-xml'! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2635 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2636 |
fileOutXML |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2637 |
"create a file 'class.xml' consisting of all methods in myself in |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2638 |
XML sourceForm. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2639 |
If the current project is not nil, create the file in the projects |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2640 |
directory. Care is taken, to not clobber any existing file in |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2641 |
case of errors (for example: disk full)" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2642 |
|
7693 | 2643 |
|dirName nm fileName| |
2644 |
||
2645 |
nm := (Smalltalk fileNameForClass:self name) , '.xml'. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2646 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2647 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2648 |
this test allows a smalltalk to be built without Projects/ChangeSets |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2649 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2650 |
Project notNil ifTrue:[ |
8726 | 2651 |
dirName := Project currentProjectDirectory |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2652 |
] ifFalse:[ |
8726 | 2653 |
dirName := Filename currentDirectory |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2654 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2655 |
fileName := (dirName asFilename construct:nm). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2656 |
fileName makeLegalFilename. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2657 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2658 |
self fileOutXMLAs:fileName. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2659 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2660 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2661 |
Class fileOutXML |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2662 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2663 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2664 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2665 |
fileOutXMLAllDefinitionsOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2666 |
"append xml expressions on aStream, which defines myself and all of my private classes." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2667 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2668 |
self fileOutXMLDefinitionOn:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2669 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2670 |
"/ here, the full nameSpace prefixes are output, |
8551 | 2671 |
"/ to avoid confusing stc |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2672 |
"/ (which otherwise could not find the correct superclass) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2673 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2674 |
FileOutNameSpaceQuerySignal answer:true do:[ |
8726 | 2675 |
self privateClassesSorted do:[:aClass | |
2676 |
aClass fileOutXMLAllDefinitionsOn:aStream |
|
2677 |
] |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2678 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2679 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2680 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2681 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2682 |
|
5464 | 2683 |
fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter |
2684 |
|collectionOfCategories| |
|
2685 |
||
2686 |
collectionOfCategories := self class categories asSortedCollection. |
|
2687 |
collectionOfCategories notNil ifTrue:[ |
|
8726 | 2688 |
collectionOfCategories do:[:aCategory | |
2689 |
self class fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2690 |
aStream cr |
|
2691 |
] |
|
5464 | 2692 |
]. |
2693 |
collectionOfCategories := self categories asSortedCollection. |
|
2694 |
collectionOfCategories notNil ifTrue:[ |
|
8726 | 2695 |
collectionOfCategories do:[:aCategory | |
2696 |
self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2697 |
aStream cr |
|
2698 |
] |
|
5464 | 2699 |
]. |
2700 |
||
2701 |
self privateClassesSorted do:[:aClass | |
|
8726 | 2702 |
aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter |
5464 | 2703 |
]. |
2704 |
||
2705 |
! |
|
2706 |
||
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2707 |
fileOutXMLAs:fileNameOrString |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2708 |
"create a file consisting of all methods in myself in |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2709 |
XML sourceForm. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2710 |
The given fileName should be a full path, including suffix." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2711 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2712 |
|aStream fileName| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2713 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2714 |
self isLoaded ifFalse:[ |
8726 | 2715 |
^ FileOutErrorSignal |
2716 |
raiseRequestWith:self |
|
2717 |
errorString:' - will not fileOut unloaded class: ', self name |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2718 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2719 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2720 |
fileName := fileNameOrString asFilename. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2721 |
[ |
8726 | 2722 |
aStream := fileName writeStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2723 |
] on:FileStream openErrorSignal do:[:ex| |
8726 | 2724 |
^ FileOutErrorSignal |
2725 |
raiseRequestWith:fileName name |
|
2726 |
errorString:(' - cannot create file: ', fileName name) |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2727 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2728 |
self fileOutXMLOn:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2729 |
aStream close. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2730 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2731 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2732 |
Class fileOutXMLAs:'test.xml' |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2733 |
Class fileOutXMLAs:'/blaDoesNotExist/test.xml' |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2734 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2735 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2736 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2737 |
fileOutXMLDefinitionOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2738 |
"append an xml expression on aStream, which defines myself." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2739 |
|
6703 | 2740 |
|varNames| |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2741 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2742 |
aStream nextPutLine:'<class>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2743 |
|
5464 | 2744 |
aStream nextPutAll:' <name>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2745 |
aStream nextPutAll:(self nameWithoutPrefix). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2746 |
aStream nextPutLine:'</name>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2747 |
|
5464 | 2748 |
aStream nextPutAll:' <environment>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2749 |
aStream nextPutAll:(self nameSpace name). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2750 |
aStream nextPutLine:'</environment>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2751 |
|
5464 | 2752 |
aStream nextPutAll:' <super>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2753 |
aStream nextPutAll:(self theNonMetaclass superclass name). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2754 |
aStream nextPutLine:'</super>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2755 |
|
5464 | 2756 |
aStream nextPutAll:' <private>'. |
2757 |
aStream nextPutAll:(self isPrivate printString). |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2758 |
aStream nextPutLine:'</private>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2759 |
|
5464 | 2760 |
aStream nextPutAll:' <indexed-type>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2761 |
aStream nextPutAll:'none'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2762 |
aStream nextPutLine:'</indexed-type>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2763 |
|
5464 | 2764 |
aStream nextPutAll:' <inst-vars>'. |
2765 |
varNames := self instVarNames. |
|
2766 |
varNames size > 0 ifTrue:[ |
|
8726 | 2767 |
aStream cr. |
2768 |
varNames do:[:nm | |
|
2769 |
aStream nextPutAll:' <name>'. |
|
2770 |
aStream nextPutAll:nm. |
|
2771 |
aStream nextPutLine:'</name>'. |
|
2772 |
]. |
|
2773 |
aStream nextPutAll:' '. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2774 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2775 |
aStream nextPutLine:'</inst-vars>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2776 |
|
5464 | 2777 |
aStream nextPutAll:' <class-inst-vars>'. |
2778 |
varNames := self class instVarNames. |
|
2779 |
varNames size > 0 ifTrue:[ |
|
8726 | 2780 |
aStream cr. |
2781 |
varNames do:[:nm | |
|
2782 |
aStream nextPutAll:' <name>'. |
|
2783 |
aStream nextPutAll:nm. |
|
2784 |
aStream nextPutLine:'</name>'. |
|
2785 |
]. |
|
2786 |
aStream nextPutAll:' '. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2787 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2788 |
aStream nextPutLine:'</class-inst-vars>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2789 |
|
5464 | 2790 |
aStream nextPutAll:' <imports>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2791 |
aStream nextPutAll:''. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2792 |
aStream nextPutLine:'</imports>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2793 |
|
5464 | 2794 |
aStream nextPutAll:' <category>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2795 |
aStream nextPutAll:self category. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2796 |
aStream nextPutLine:'</category>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2797 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2798 |
aStream nextPutLine:'</class>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2799 |
|
5464 | 2800 |
varNames := self classVarNames. |
2801 |
varNames size > 0 ifTrue:[ |
|
8726 | 2802 |
varNames do:[:nm | |
2803 |
aStream nextPutLine:'<static>'. |
|
2804 |
aStream nextPutAll:' <name>'. |
|
2805 |
aStream nextPutAll:nm. |
|
2806 |
aStream nextPutLine:'</name>'. |
|
2807 |
aStream nextPutAll:' <environment>'. |
|
2808 |
aStream nextPutAll:self name. |
|
2809 |
aStream nextPutLine:'</environment>'. |
|
2810 |
aStream nextPutLine:'</static>'. |
|
2811 |
]. |
|
5464 | 2812 |
]. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2813 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2814 |
|
8551 | 2815 |
fileOutXMLOn:aStream |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2816 |
"WARNING: untested first version. Not for general use (yet) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2817 |
file out my definition and all methods onto aStream in XML format." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2818 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2819 |
self |
8726 | 2820 |
fileOutXMLOn:aStream |
2821 |
withTimeStamp:true |
|
2822 |
withInitialize:true |
|
2823 |
withDefinition:true |
|
2824 |
methodFilter:nil |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2825 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2826 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2827 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2828 |
fileOutXMLOn:aStream withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2829 |
"WARNING: untested first version. Not for general use (yet) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2830 |
file out my definition and all methods onto aStream in XML format. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2831 |
If stampIt is true, a timeStamp comment is prepended. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2832 |
If initIt is true, and the class implements a class-initialize method, |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2833 |
append a corresponding doIt expression for initialization. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2834 |
The order by which the fileOut is done is used to put the version string at the end. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2835 |
Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2836 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2837 |
|collectionOfCategories copyrightMethod copyrightText comment meta| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2838 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2839 |
self isLoaded ifFalse:[ |
8726 | 2840 |
^ FileOutErrorSignal |
2841 |
raiseRequestWith:self |
|
2842 |
errorString:' - will not fileOut unloaded class: ', self name |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2843 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2844 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2845 |
meta := self class. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2846 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2847 |
aStream nextPutLine:'<?xml version="1.0"?>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2848 |
aStream nextPutLine:'<st-source>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2849 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2850 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2851 |
if there is a copyright method, add a copyright element at the beginning, |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2852 |
taking the string from the copyright method. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2853 |
We cannot do this unconditionally - that would lead to my copyrights |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2854 |
being put on your code ;-). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2855 |
On the other hand: I want every file created by myself to have the |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2856 |
copyright string at the beginning be preserved .... even if the |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2857 |
code was edited in the browser and filedOut. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2858 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2859 |
(copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[ |
8726 | 2860 |
" |
2861 |
get the copyright methods source, |
|
2862 |
and insert at beginning. |
|
2863 |
" |
|
2864 |
copyrightText := copyrightMethod source. |
|
2865 |
copyrightText isNil ifTrue:[ |
|
2866 |
" |
|
2867 |
no source available - trigger an error |
|
2868 |
" |
|
2869 |
FileOutErrorSignal |
|
2870 |
raiseRequestWith:' - no source for class: '. |
|
2871 |
^ self |
|
2872 |
]. |
|
2873 |
" |
|
2874 |
strip off the selector-line |
|
2875 |
" |
|
2876 |
copyrightText := copyrightText asCollectionOfLines asStringCollection. |
|
2877 |
copyrightText := copyrightText copyFrom:2 to:(copyrightText size). |
|
2878 |
[copyrightText last isEmpty] whileTrue:[ |
|
2879 |
copyrightText := copyrightText copyWithoutLast:1. |
|
2880 |
]. |
|
2881 |
(copyrightText first = '"') ifTrue:[ |
|
2882 |
(copyrightText last = '"') ifTrue:[ |
|
2883 |
copyrightText := copyrightText copyFrom:2 to:(copyrightText size - 1). |
|
2884 |
] |
|
2885 |
]. |
|
2886 |
copyrightText := copyrightText asString. |
|
2887 |
||
2888 |
aStream nextPutAll:'<copyright>'. |
|
2889 |
self fileOutXMLString:copyrightText on:aStream. |
|
2890 |
aStream nextPutLine:'</copyright>'. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2891 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2892 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2893 |
stampIt ifTrue:[ |
8726 | 2894 |
"/ |
2895 |
"/ first, a timestamp |
|
2896 |
"/ |
|
2897 |
aStream nextPutAll:'<time-stamp>'. |
|
2898 |
self fileOutXMLString:(Smalltalk timeStampString) on:aStream. |
|
2899 |
aStream nextPutLine:'</time-stamp>'. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2900 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2901 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2902 |
withDefinition ifTrue:[ |
8726 | 2903 |
"/ |
2904 |
"/ then the definition |
|
2905 |
"/ |
|
2906 |
self fileOutXMLAllDefinitionsOn:aStream. |
|
2907 |
"/ |
|
2908 |
"/ a comment - if any |
|
2909 |
"/ |
|
2910 |
(comment := self comment) notNil ifTrue:[ |
|
2911 |
aStream nextPutLine:'<comment>'. |
|
2912 |
aStream nextPutAll:'<class-id>'. |
|
2913 |
aStream nextPutAll:(self name). |
|
2914 |
aStream nextPutLine:'</class-id>'. |
|
2915 |
aStream nextPutLine:'</comment>'. |
|
2916 |
]. |
|
2917 |
"/ |
|
2918 |
"/ primitive definitions - if any |
|
2919 |
"/ |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2920 |
"/ self fileOutPrimitiveSpecsOn:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2921 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2922 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2923 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2924 |
"/ methods from all categories in metaclass (i.e. class methods) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2925 |
"/ EXCEPT: the version method is placed at the very end, to |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2926 |
"/ avoid sourcePosition-shifts when checked out later. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2927 |
"/ (RCS expands this string, so its size is not constant) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2928 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2929 |
collectionOfCategories := meta categories asSortedCollection. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2930 |
collectionOfCategories notNil ifTrue:[ |
8726 | 2931 |
collectionOfCategories do:[:aCategory | |
2932 |
meta fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2933 |
] |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2934 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2935 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2936 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2937 |
"/ methods from all categories in myself |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2938 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2939 |
collectionOfCategories := self categories asSortedCollection. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2940 |
collectionOfCategories notNil ifTrue:[ |
8726 | 2941 |
collectionOfCategories do:[:aCategory | |
2942 |
self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2943 |
] |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2944 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2945 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2946 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2947 |
"/ any private classes' methods |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2948 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2949 |
self privateClassesSorted do:[:aClass | |
8726 | 2950 |
aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2951 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2952 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2953 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2954 |
initIt ifTrue:[ |
8726 | 2955 |
"/ |
2956 |
"/ optionally an initialize message |
|
2957 |
"/ |
|
2958 |
(meta includesSelector:#initialize) ifTrue:[ |
|
2959 |
aStream nextPutLine:'<initialize>'. |
|
2960 |
aStream nextPutAll:'<class-id>'. |
|
2961 |
aStream nextPutAll:(self name). |
|
2962 |
aStream nextPutLine:'</class-id>'. |
|
2963 |
aStream nextPutLine:'</initialize>'. |
|
2964 |
] |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2965 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2966 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2967 |
aStream nextPutLine:'</st-source>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2968 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2969 |
" |
8551 | 2970 |
Class |
8726 | 2971 |
fileOutXMLOn:'test.xml' asFilename writeStream |
2972 |
withTimeStamp:true |
|
2973 |
withInitialize:true |
|
2974 |
withDefinition:true |
|
2975 |
methodFilter:nil |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2976 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2977 |
! ! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2978 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2979 |
!Class methodsFor:'printOut'! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2980 |
|
2482 | 2981 |
htmlDocumentation |
8356 | 2982 |
<resource: #obsolete> |
7227
5df22f2ffebc
htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents:
7222
diff
changeset
|
2983 |
self obsoleteMethodWarning:'use HTMLDocGenerator htmlDocOf:'. |
5df22f2ffebc
htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents:
7222
diff
changeset
|
2984 |
|
2482 | 2985 |
^ HTMLDocGenerator htmlDocOf:self |
2986 |
||
2987 |
"Created: 22.3.1997 / 14:18:23 / cg" |
|
2988 |
! |
|
2989 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2990 |
printClassVarNamesOn:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2991 |
"print the class variable names indented and breaking at line end" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2992 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2993 |
self printNameArray:(self classVarNames) on:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2994 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2995 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2996 |
printFullHierarchyOn:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2997 |
"print myself and all subclasses on aStream. |
8551 | 2998 |
recursively calls itself to print subclasses. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2999 |
Can be used to print hierarchy on the printer." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3000 |
|
1996
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3001 |
|nm| |
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3002 |
|
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3003 |
nm := self name. |
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3004 |
aStream spaces:indent; bold; nextPutAll:nm; normal; nextPutAll:' ('. |
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3005 |
self printInstVarNamesOn:aStream indent:(indent + nm size + 2). |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3006 |
aStream nextPutLine:')'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3007 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3008 |
(self subclasses sort:[:a :b | a name < b name]) do:[:aSubclass | |
8726 | 3009 |
aSubclass printFullHierarchyOn:aStream indent:(indent + 2) |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3010 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3011 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3012 |
"|printStream| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3013 |
printStream := Printer new. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3014 |
Object printFullHierarchyOn:printStream indent:0. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3015 |
printStream close" |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3016 |
|
1996
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3017 |
"Modified: 13.12.1996 / 14:13:06 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3018 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3019 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3020 |
printOutDefinitionOn:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3021 |
"print out my definition" |
1 | 3022 |
|
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
3023 |
|comment s superclass| |
333 | 3024 |
|
8551 | 3025 |
aPrintStream nextPutAll:'class '; bold; nextPutLine:self name; normal. |
1 | 3026 |
aPrintStream nextPutAll:'superclass '. |
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
3027 |
superclass := self superclass. |
1 | 3028 |
superclass isNil ifTrue:[ |
8726 | 3029 |
s := 'Object' |
1 | 3030 |
] ifFalse:[ |
8726 | 3031 |
s := superclass name |
1 | 3032 |
]. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3033 |
aPrintStream nextPutLine:s. |
1 | 3034 |
|
3035 |
aPrintStream nextPutAll:'instance Variables '. |
|
3036 |
self printInstVarNamesOn:aPrintStream indent:21. |
|
8551 | 3037 |
aPrintStream cr. |
1 | 3038 |
|
3039 |
aPrintStream nextPutAll:'class Variables '. |
|
3040 |
self printClassVarNamesOn:aPrintStream indent:21. |
|
3041 |
aPrintStream cr. |
|
3042 |
||
3043 |
category notNil ifTrue:[ |
|
8726 | 3044 |
aPrintStream nextPutAll:'category '; |
3045 |
nextPutLine:(category printString). |
|
1 | 3046 |
]. |
3047 |
||
193 | 3048 |
(comment := self comment) notNil ifTrue:[ |
8726 | 3049 |
aPrintStream cr; nextPutLine:'comment:'; italic; nextPutLine:comment; normal |
1 | 3050 |
] |
733
983d045c17f5
make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
3051 |
|
983d045c17f5
make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
3052 |
"Created: 10.12.1995 / 16:30:47 / cg" |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3053 |
"Modified: 9.11.1996 / 00:13:37 / cg" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3054 |
"Modified: 1.4.1997 / 16:01:26 / stefan" |
1 | 3055 |
! |
3056 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3057 |
printOutOn:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3058 |
"print out all methods on aPrintStream which should be a printStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3059 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3060 |
|collectionOfCategories| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3061 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3062 |
self printOutDefinitionOn:aPrintStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3063 |
aPrintStream cr. |
3937 | 3064 |
collectionOfCategories := self class categories asSortedCollection. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3065 |
collectionOfCategories notNil ifTrue:[ |
8726 | 3066 |
aPrintStream nextPutLine:'class protocol'. |
3067 |
aPrintStream cr. |
|
3068 |
collectionOfCategories do:[:aCategory | |
|
3069 |
self class printOutCategory:aCategory on:aPrintStream |
|
3070 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3071 |
]. |
3937 | 3072 |
collectionOfCategories := self categories asSortedCollection. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3073 |
collectionOfCategories notNil ifTrue:[ |
8726 | 3074 |
aPrintStream nextPutLine:'instance protocol'. |
3075 |
aPrintStream cr. |
|
3076 |
collectionOfCategories do:[:aCategory | |
|
3077 |
self printOutCategory:aCategory on:aPrintStream |
|
3078 |
] |
|
555 | 3079 |
] |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3080 |
|
3937 | 3081 |
"Modified: / 25.11.1998 / 12:40:31 / cg" |
5938
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3082 |
! |
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3083 |
|
8551 | 3084 |
printSharedPoolNamesOn:aStream indent:indent |
3085 |
"print the pool names indented and breaking at line end" |
|
3086 |
||
3087 |
self printNameArray:(self sharedPools) on:aStream indent:indent |
|
3088 |
! |
|
3089 |
||
5938
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3090 |
storeOn:aStream |
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3091 |
"append my name only - expects class to be there, when restoring" |
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3092 |
|
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3093 |
aStream nextPutAll:self name |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3094 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3095 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3096 |
!Class methodsFor:'private-accessing'! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3097 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3098 |
attributes |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3099 |
"return the extra class attributes or nil" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3100 |
|
8551 | 3101 |
^ self classAttributes |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3102 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3103 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3104 |
attributes:aClassAttributesObject |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3105 |
"set the extra class attributes" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3106 |
|
8551 | 3107 |
self classAttributes:aClassAttributesObject |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3108 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3109 |
|
7486 | 3110 |
classAttributes |
3111 |
"return the extra class attributes or nil" |
|
3112 |
||
3113 |
attributes isArray ifTrue:[ |
|
8726 | 3114 |
attributes := ClassAttributes new fromSTCPrimitiveArray:attributes. |
7486 | 3115 |
]. |
3116 |
^ attributes |
|
3117 |
! |
|
3118 |
||
3119 |
classAttributes:aClassAttributesObject |
|
3120 |
"set the extra class attributes" |
|
3121 |
||
3122 |
attributes := aClassAttributesObject |
|
3123 |
! |
|
3124 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3125 |
getAttribute:aKey |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3126 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3127 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3128 |
"get an attribute (by symbolic key)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3129 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3130 |
attributes isNil ifTrue:[ ^ nil]. |
7486 | 3131 |
^ self classAttributes perform:aKey asSymbol |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3132 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3133 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3134 |
getSourceChunkAttribute:aKey |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3135 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3136 |
|
7472 | 3137 |
|pos stream string| |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3138 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3139 |
pos := self getAttribute:aKey. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3140 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3141 |
"the attribute is either a string, or an integer specifying the |
7472 | 3142 |
position within the classes sourcefile ..." |
3143 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3144 |
pos isNumber ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3145 |
"/ classFilename notNil ifTrue:[ |
8726 | 3146 |
stream := self sourceStream. |
3147 |
stream notNil ifTrue:[ |
|
3148 |
stream position0Based:pos. |
|
3149 |
string := stream nextChunk. |
|
3150 |
stream close. |
|
3151 |
^ string |
|
3152 |
]. |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3153 |
"/ ]. |
8726 | 3154 |
^ nil |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3155 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3156 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3157 |
^ pos |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3158 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3159 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3160 |
setAttribute:key to:aValue |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3161 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3162 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3163 |
attributes isNil ifTrue:[ |
8726 | 3164 |
attributes := ClassAttributes new. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3165 |
]. |
7486 | 3166 |
self classAttributes perform:(key , ':') asSymbol with:aValue |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3167 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3168 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3169 |
setPrimitiveDefinitions:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3170 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3171 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3172 |
"set the primitiveDefinition string (no change notifications)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3173 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3174 |
^ self setAttribute:#primitiveDefinitions to:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3175 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3176 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3177 |
setPrimitiveFunctions:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3178 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3179 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3180 |
"set the primitiveFunction string (no change notifications)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3181 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3182 |
^ self setAttribute:#primitiveFunctions to:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3183 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3184 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3185 |
setPrimitiveVariables:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3186 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3187 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3188 |
"set the primitiveVariable string (no change notifications)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3189 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3190 |
^ self setAttribute:#primitiveVariables to:aString |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3191 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3192 |
|
8551 | 3193 |
setSharedPools:aStringOrCollection |
3194 |
"{ Pragma: +optSpace }" |
|
3195 |
||
3196 |
"set the sharedPools string (no change notifications)" |
|
3197 |
||
3198 |
^ self setAttribute:#sharedPools to:aStringOrCollection |
|
3199 |
! |
|
3200 |
||
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3201 |
setSuperclass:aClass |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3202 |
"set the superclass of the receiver. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3203 |
this method is for special uses only - there will be no recompilation |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3204 |
and no change record written here. Also, if the receiver class has |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3205 |
already been in use, future operation of the system is not guaranteed to |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3206 |
be correct, since no caches are flushed. |
8072
e7542f2dbb9c
flush cached subclassInfo whenever a superclass changes
Claus Gittinger <cg@exept.de>
parents:
8051
diff
changeset
|
3207 |
Therefore: do NOT use it; use #superclass: (or flush the caches, at least)." |
e7542f2dbb9c
flush cached subclassInfo whenever a superclass changes
Claus Gittinger <cg@exept.de>
parents:
8051
diff
changeset
|
3208 |
|
e7542f2dbb9c
flush cached subclassInfo whenever a superclass changes
Claus Gittinger <cg@exept.de>
parents:
8051
diff
changeset
|
3209 |
SubclassInfo := nil. "/ flush it |
e7542f2dbb9c
flush cached subclassInfo whenever a superclass changes
Claus Gittinger <cg@exept.de>
parents:
8051
diff
changeset
|
3210 |
superclass := aClass |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3211 |
! ! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3212 |
|
7258 | 3213 |
!Class methodsFor:'private-changes management'! |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3214 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3215 |
addChangeRecordForChangeCategory:category to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3216 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3217 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3218 |
"append a category change record to aStream" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3219 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3220 |
self printClassNameOn:aStream. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3221 |
aStream nextPutAll:(' category:' , category storeString). |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3222 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3223 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3224 |
"Created: 3.12.1995 / 13:43:33 / cg" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3225 |
"Modified: 3.12.1995 / 14:10:34 / cg" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3226 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3227 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3228 |
addChangeRecordForClass:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3229 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3230 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3231 |
"append a class-definition-record to aStream" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3232 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3233 |
aClass isLoaded ifTrue:[ |
8726 | 3234 |
aClass basicFileOutDefinitionOn:aStream withNameSpace:true. |
3235 |
aStream nextPutChunkSeparator. |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3236 |
] |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3237 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3238 |
"Created: 3.12.1995 / 13:57:44 / cg" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3239 |
"Modified: 3.12.1995 / 14:11:26 / cg" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3240 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3241 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3242 |
addChangeRecordForClassComment:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3243 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3244 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3245 |
"append a class-comment-record to aStream" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3246 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3247 |
aClass fileOutCommentOn:aStream. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3248 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3249 |
"Modified: 4.3.1996 / 16:49:08 / cg" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3250 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3251 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3252 |
addChangeRecordForClassInstvars:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3253 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3254 |
|
5225
d74b4c895376
comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents:
5190
diff
changeset
|
3255 |
"append an instvars-record to aStream" |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3256 |
|
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8267
diff
changeset
|
3257 |
aClass class fileOutClassInstVarDefinitionOn:aStream withNameSpace:true. |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3258 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3259 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3260 |
|
7179 | 3261 |
addChangeRecordForClassRemove:oldClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3262 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3263 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3264 |
"append a class-remove-record to aStream" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3265 |
|
7179 | 3266 |
aStream nextPutAll:('Smalltalk removeClass:' , oldClass name). |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3267 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3268 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3269 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3270 |
addChangeRecordForClassRename:oldName to:newName to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3271 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3272 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3273 |
"append a class-rename-record to aStream" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3274 |
|
1846 | 3275 |
aStream nextPutAll:('Smalltalk renameClass:' , oldName, ' to:''' , newName , ''''). |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3276 |
aStream nextPutChunkSeparator. |
1846 | 3277 |
|
3278 |
"Modified: 30.10.1996 / 20:27:02 / cg" |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3279 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3280 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3281 |
addChangeRecordForPrimitiveDefinitions:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3282 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3283 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3284 |
"append a primitiveDefinitions-record to aStream" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3285 |
|
8551 | 3286 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveDefinitions:'''; |
8726 | 3287 |
nextPutAll:(aClass primitiveDefinitionsString storeString copyFrom:2). |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3288 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3289 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3290 |
"Modified: 9.11.1996 / 00:09:54 / cg" |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3291 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3292 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3293 |
addChangeRecordForPrimitiveFunctions:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3294 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3295 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3296 |
"append a primitiveFunctions-record to aStream" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3297 |
|
8551 | 3298 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveFunctions:'''; |
8726 | 3299 |
nextPutAll:(aClass primitiveFunctionsString storeString copyFrom:2). |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3300 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3301 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3302 |
"Modified: 9.11.1996 / 00:10:02 / cg" |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3303 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3304 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3305 |
addChangeRecordForPrimitiveVariables:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3306 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3307 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3308 |
"append a primitiveVariables-record to aStream" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3309 |
|
8551 | 3310 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveVariables:'''; |
8726 | 3311 |
nextPutAll:(aClass primitiveVariablesString storeString copyFrom:2). |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3312 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3313 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3314 |
"Modified: 9.11.1996 / 00:10:10 / cg" |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3315 |
! ! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3316 |
|
1237 | 3317 |
!Class methodsFor:'protocol printOut'! |
3318 |
||
3319 |
printOutProtocolOn:aPrintStream |
|
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3320 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3321 |
|
1237 | 3322 |
|collectionOfCategories| |
3323 |
||
3324 |
self printOutDefinitionOn:aPrintStream. |
|
3325 |
aPrintStream cr. |
|
3937 | 3326 |
collectionOfCategories := self class categories asSortedCollection. |
1237 | 3327 |
collectionOfCategories notNil ifTrue:[ |
8726 | 3328 |
aPrintStream nextPutLine:'class protocol'. |
3329 |
aPrintStream cr. |
|
3330 |
collectionOfCategories do:[:aCategory | |
|
3331 |
self class printOutCategoryProtocol:aCategory on:aPrintStream |
|
3332 |
] |
|
1237 | 3333 |
]. |
3937 | 3334 |
collectionOfCategories := self categories asSortedCollection. |
1237 | 3335 |
collectionOfCategories notNil ifTrue:[ |
8726 | 3336 |
aPrintStream nextPutLine:'instance protocol'. |
3337 |
aPrintStream cr. |
|
3338 |
collectionOfCategories do:[:aCategory | |
|
3339 |
self printOutCategoryProtocol:aCategory on:aPrintStream |
|
3340 |
] |
|
1237 | 3341 |
] |
3342 |
||
3937 | 3343 |
"Modified: / 25.11.1998 / 12:40:38 / cg" |
1237 | 3344 |
! ! |
3345 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3346 |
!Class methodsFor:'queries'! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3347 |
|
9815 | 3348 |
canHaveExtensions |
3349 |
"return true, if this class allows extensions from other packages. |
|
3350 |
Private classes, namespaces and projectDefinitions dont allow this" |
|
3351 |
||
3352 |
^ self isPrivate not |
|
3353 |
||
3354 |
" |
|
3355 |
Smalltalk allClasses select:[:each | each canHaveExtensions not] |
|
3356 |
" |
|
3357 |
||
3358 |
"Created: / 30-08-2006 / 15:27:53 / cg" |
|
3359 |
! |
|
3360 |
||
8167 | 3361 |
classResources |
8185 | 3362 |
self isPrivate ifTrue:[ |
8726 | 3363 |
^ self owningClass classResources |
8185 | 3364 |
]. |
9930 | 3365 |
^ ResourcePack for:self cached:true. |
3366 |
||
3367 |
"Modified: / 18-09-2006 / 20:37:16 / cg" |
|
8167 | 3368 |
! |
3369 |
||
10084 | 3370 |
extensions |
3371 |
"return a collection of extension-methods from any package, or empty if there are none." |
|
3372 |
||
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3373 |
|extensions classPackage| |
10084 | 3374 |
|
3375 |
classPackage := self package. |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3376 |
self instAndClassMethodsDo:[:mthd | |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3377 |
mthd package ~= classPackage ifTrue:[ |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3378 |
extensions isNil ifTrue:[ |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3379 |
extensions := OrderedCollection new. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3380 |
]. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3381 |
extensions add:mthd |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3382 |
]. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3383 |
]. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3384 |
^ extensions ? #() |
10084 | 3385 |
|
3386 |
" |
|
3387 |
CType extensions |
|
3388 |
Rectangle extensions |
|
3389 |
Rectangle hasExtensions |
|
3390 |
" |
|
3391 |
||
3392 |
"Created: / 12-10-2006 / 18:29:51 / cg" |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3393 |
"Modified: / 05-03-2007 / 17:12:04 / cg" |
10084 | 3394 |
! |
3395 |
||
9494 | 3396 |
extensionsFrom:aPackageID |
3397 |
"return the set of extension-methods from the given package." |
|
3398 |
||
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3399 |
|extensions| |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3400 |
|
10084 | 3401 |
aPackageID = self package ifTrue:[^ #() ]. |
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3402 |
self instAndClassMethodsDo:[:mthd | |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3403 |
mthd package = aPackageID ifTrue:[ |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3404 |
extensions isNil ifTrue:[ |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3405 |
extensions := OrderedCollection new. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3406 |
]. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3407 |
extensions add:mthd |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3408 |
]. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3409 |
]. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3410 |
^ extensions ? #() |
9494 | 3411 |
|
3412 |
" |
|
10084 | 3413 |
CType extensionsFrom:#'bosch:dapasx' |
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3414 |
Rectangle extensionsFrom:#'bosch:dapasx/support' |
10084 | 3415 |
Rectangle extensions |
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3416 |
Class extensions |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3417 |
Class extensionsFrom:#'stx:libboss' |
9494 | 3418 |
" |
3419 |
||
3420 |
"Created: / 07-08-2006 / 22:02:15 / fm" |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3421 |
"Modified: / 06-03-2007 / 11:54:53 / cg" |
9494 | 3422 |
! |
3423 |
||
5545 | 3424 |
hasExtensions |
3425 |
"return true, if there are methods in the receiver, which belong to |
|
3426 |
a different package (i.e. package of class ~= package of method). |
|
3427 |
Those are class extensions, which must be treated specially when checking classes |
|
8551 | 3428 |
into the sourceCode repository. (extensions are stored separate)" |
5545 | 3429 |
|
6166 | 3430 |
|clsPkg defaultPkg| |
3431 |
||
10084 | 3432 |
defaultPkg := Project noProjectID. |
6166 | 3433 |
clsPkg := self package. |
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3434 |
self instAndClassMethodsDo:[:mthd | |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3435 |
|mthdPkg| |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3436 |
(((mthdPkg := mthd package) ~= clsPkg) and:[ mthdPkg ~= defaultPkg ]) ifTrue:[^ true ]. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3437 |
]. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3438 |
^ false |
5545 | 3439 |
|
3440 |
" |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3441 |
Time millisecondsToRun:[ |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3442 |
Smalltalk allClasses select:[:each | each hasExtensions] |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3443 |
]. 190 130 260 |
10084 | 3444 |
|
3445 |
Dictionary |
|
3446 |
withAssociations: |
|
3447 |
(Smalltalk allClasses |
|
3448 |
select:[:each | each hasExtensions] |
|
3449 |
thenCollect:[:each | each -> each extensions]) |
|
5545 | 3450 |
" |
10084 | 3451 |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3452 |
"Modified: / 05-03-2007 / 17:06:20 / cg" |
5545 | 3453 |
! |
3454 |
||
5659 | 3455 |
hasExtensionsFrom:aPackageID |
3456 |
"return true, if there are methods in the receiver, which belong to |
|
3457 |
the package with aPackageID (i.e. package of class ~= package of method). |
|
3458 |
Those are class extensions, which must be treated specially when checking classes |
|
8551 | 3459 |
into the sourceCode repository. (extensions are stored separate)" |
5659 | 3460 |
|
10084 | 3461 |
|clsPkg| |
3462 |
||
3463 |
clsPkg := self package. |
|
3464 |
aPackageID = clsPkg ifTrue:[^ #()]. |
|
3465 |
||
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3466 |
self instAndClassMethodsDo:[:mthd | |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3467 |
mthd package = aPackageID ifTrue:[ ^ true]. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3468 |
]. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3469 |
^ false |
5659 | 3470 |
|
3471 |
" |
|
10084 | 3472 |
Smalltalk allClasses |
3473 |
select:[:each | each hasExtensionsFrom:'stx:goodies/refactyBrowser'] |
|
3474 |
Smalltalk allClasses |
|
3475 |
select:[:each | each hasExtensionsFrom:'stx:libboss'] |
|
5659 | 3476 |
" |
10084 | 3477 |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3478 |
"Modified: / 06-03-2007 / 11:55:39 / cg" |
5659 | 3479 |
! |
3480 |
||
10042
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
3481 |
isBrowserStartable |
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
3482 |
"return true, if this is an application class, |
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
3483 |
which can be started from the browser" |
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
3484 |
|
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
3485 |
^ self isVisualStartable or:[self isStartableWithStart or:[ self isStartableWithMain ]] |
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
3486 |
|
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
3487 |
"Created: / 06-10-2006 / 11:34:28 / cg" |
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
3488 |
! |
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
3489 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3490 |
isClass |
8551 | 3491 |
"return true, if the receiver is some kind of class |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3492 |
(a real class, not just behavior); |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3493 |
true is returned here - the method is redefined from Object. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3494 |
See also Behavior>>isBehavior." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3495 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3496 |
^ true |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3497 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3498 |
" |
8551 | 3499 |
Point isClass |
3500 |
1 isClass |
|
3501 |
Behavior new isBehavior |
|
3502 |
Behavior new isClass |
|
3503 |
Class new isBehavior |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3504 |
Class new isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3505 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3506 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3507 |
|
8933 | 3508 |
isJavaScriptClass |
8936 | 3509 |
^ self class isJavaScriptMetaclass |
8933 | 3510 |
! |
3511 |
||
6723 | 3512 |
isStartableWithMain |
3513 |
"return true, if this is an application class, |
|
3514 |
which can be started via #main" |
|
3515 |
||
3516 |
^ self theMetaclass includesSelector:#main |
|
3517 |
||
3518 |
"Created: / 2.11.2001 / 09:37:01 / cg" |
|
3519 |
"Modified: / 2.11.2001 / 09:48:05 / cg" |
|
3520 |
! |
|
3521 |
||
8756 | 3522 |
isStartableWithStart |
3523 |
"return true, if this is an application class, |
|
3524 |
which can be started via #start" |
|
3525 |
||
3526 |
^ self theMetaclass includesSelector:#start |
|
3527 |
! |
|
3528 |
||
11382 | 3529 |
packageDirectory |
11413 | 3530 |
"return the packageDirectory of this classes package. |
3531 |
That is usually the directory where my source is, and where package specific additional |
|
3532 |
files (bitmaps, resources etc.) are found." |
|
3533 |
||
11382 | 3534 |
^ Smalltalk getPackageDirectoryForPackage:self package. |
3535 |
||
3536 |
" |
|
3537 |
self packageDirectory |
|
3538 |
stx_libbasic3 packageDirectory |
|
3539 |
Array packageDirectory |
|
3540 |
" |
|
3541 |
! |
|
3542 |
||
2568
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3543 |
rootsOfTheWorld |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3544 |
"return a collection of classes which have a nil superclass" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3545 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3546 |
|set| |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3547 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3548 |
set := IdentitySet new. |
8551 | 3549 |
Smalltalk allClassesDo:[:aClass | |
8726 | 3550 |
aClass superclass isNil ifTrue:[set add:aClass] |
2568
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3551 |
]. |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3552 |
^ set asOrderedCollection |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3553 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3554 |
" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3555 |
Class rootsOfTheWorld |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3556 |
" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3557 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3558 |
"Modified: 18.4.1997 / 20:55:34 / cg" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3559 |
! |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3560 |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3561 |
subclasses |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3562 |
"return a collection of the direct subclasses of the receiver" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3563 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3564 |
|newColl| |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3565 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3566 |
"/ use cached information (avoid class hierarchy search) |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3567 |
"/ if possible |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3568 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3569 |
SubclassInfo notNil ifTrue:[ |
8726 | 3570 |
newColl := SubclassInfo at:self ifAbsent:nil. |
3571 |
newColl notNil ifTrue:[^ newColl asOrderedCollection] |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3572 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3573 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3574 |
newColl := OrderedCollection new. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3575 |
self subclassesDo:[:aClass | |
8726 | 3576 |
newColl add:aClass |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3577 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3578 |
SubclassInfo notNil ifTrue:[ |
8726 | 3579 |
SubclassInfo at:self put:newColl. |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3580 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3581 |
^ newColl |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3582 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3583 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3584 |
Class flushSubclassInfo. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3585 |
Collection subclasses |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3586 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3587 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3588 |
"Modified: 22.1.1997 / 18:43:52 / cg" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3589 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3590 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3591 |
wasAutoloaded |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3592 |
"return true, if this class came into the system via an |
555 | 3593 |
autoload; false otherwise. |
3594 |
This is not an attribute of the class, but instead remembered in |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3595 |
Autoload. The interface here is for your convenience." |
555 | 3596 |
|
3597 |
^ Autoload wasAutoloaded:self |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3598 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3599 |
"Modified: 21.3.1996 / 16:27:09 / cg" |
555 | 3600 |
! |
3601 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3602 |
whichClassDefinesClassVar:aVariableName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3603 |
"return the class which defines the class variable |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3604 |
named aVariableName. This method should not be used for |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3605 |
repeated searches (i.e. in the compiler/parser), since it creates |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3606 |
many throw away intermediate objects." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3607 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3608 |
|cls| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3609 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3610 |
cls := self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3611 |
[cls notNil] whileTrue:[ |
8726 | 3612 |
(cls classVarNames includes:aVariableName) ifTrue:[ ^ cls]. |
3613 |
cls := cls superclass |
|
556 | 3614 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3615 |
^ nil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3616 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3617 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3618 |
StandardSystemView whichClassDefinesClassVar:'ErrorSignal' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3619 |
StandardSystemView whichClassDefinesClassVar:'Foo' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3620 |
" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3621 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3622 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3623 |
!Class methodsFor:'renaming'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3624 |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3625 |
makePrivateIn:newOwner |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3626 |
"make a private class of newOwner from the receiver; |
5612 | 3627 |
the receiver must be a public class. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3628 |
Returns the new private class." |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3629 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3630 |
|sel newClass| |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3631 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3632 |
self owningClass notNil ifTrue:[ |
8726 | 3633 |
^ self |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3634 |
]. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3635 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3636 |
sel := self definitionSelectorPrivate. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3637 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3638 |
newClass := self superclass |
8726 | 3639 |
perform:sel |
3640 |
withArguments:(Array |
|
3641 |
with:(self nameWithoutPrefix asSymbol) |
|
3642 |
with:(self instanceVariableString) |
|
3643 |
with:(self classVariableString) |
|
3644 |
with:'' |
|
3645 |
with:newOwner). |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3646 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3647 |
"/ copy over methods ... |
6023 | 3648 |
ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class. |
3649 |
ClassBuilder copyInvalidatedMethodsFrom:self for:newClass. |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3650 |
newClass class recompileInvalidatedMethods. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3651 |
newClass recompileInvalidatedMethods. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3652 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3653 |
newOwner changed:#newClass with:newClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3654 |
Smalltalk changed:#newClass with:newClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3655 |
|
2835 | 3656 |
self removeFromSystem. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3657 |
^ newClass |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3658 |
|
3494
23a6cf28b3a6
fixed makePrivate, if newOwner is in a nameSpace
Claus Gittinger <cg@exept.de>
parents:
3407
diff
changeset
|
3659 |
"Modified: / 29.5.1998 / 19:03:49 / cg" |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3660 |
! |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3661 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3662 |
makePublic |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3663 |
"make a public class from the receiver. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3664 |
The receiver must be a private class. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3665 |
Returns the new public class." |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3666 |
|
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3667 |
^ self makePublicIn:Smalltalk |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3668 |
! |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3669 |
|
9417 | 3670 |
makePublicIn:newNameSpace |
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3671 |
"make a public class from the receiver. |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3672 |
The receiver must be a private class. |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3673 |
Returns the new public class." |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3674 |
|
9417 | 3675 |
|sel owner baseName newName newClass| |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3676 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3677 |
owner := self topOwningClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3678 |
owner isNil ifTrue:[^ self]. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3679 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3680 |
"/ first, create the public class ... |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3681 |
sel := self definitionSelector. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3682 |
|
9417 | 3683 |
Class nameSpaceQuerySignal answer:newNameSpace |
3044 | 3684 |
do:[ |
9417 | 3685 |
baseName := self nameWithoutPrefix. |
3686 |
"/ (newNameSpace isNil or:[newNameSpace == Smalltalk]) ifTrue:[ |
|
3687 |
"/ newName := baseName |
|
3688 |
"/ ] ifFalse:[ |
|
3689 |
"/ newName := newNameSpace name , '::' , baseName |
|
3690 |
"/ ]. |
|
3691 |
newName := baseName. |
|
3692 |
||
8726 | 3693 |
newClass := self superclass |
3694 |
perform:sel |
|
3695 |
withArguments:(Array |
|
3696 |
with:(newName asSymbol) |
|
3697 |
with:(self instanceVariableString) |
|
3698 |
with:(self classVariableString) |
|
3699 |
with:'' |
|
3700 |
with:(owner category)). |
|
3701 |
||
3702 |
"/ copy over methods ... |
|
3703 |
ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class. |
|
3704 |
ClassBuilder copyInvalidatedMethodsFrom:self for:newClass. |
|
3705 |
newClass class recompileInvalidatedMethods. |
|
3706 |
newClass recompileInvalidatedMethods. |
|
3044 | 3707 |
]. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3708 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3709 |
owner changed:#newClass with:newClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3710 |
Smalltalk changed:#newClass with:newClass. |
9417 | 3711 |
(newNameSpace notNil and:[newNameSpace ~~ Smalltalk]) ifTrue:[ |
3712 |
newNameSpace changed:#newClass with:newClass. |
|
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3713 |
]. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3714 |
|
2835 | 3715 |
self removeFromSystem. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3716 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3717 |
^ newClass |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3718 |
|
9417 | 3719 |
"Created: / 23-06-1997 / 13:28:52 / cg" |
3720 |
"Modified: / 04-07-2006 / 16:27:12 / cg" |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3721 |
! |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3722 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3723 |
renameTo:newName |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3724 |
"change the name of the class. This does not write a change record." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3725 |
|
5863 | 3726 |
<resource:#obsolete> |
3727 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3728 |
|oldSym newSym| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3729 |
|
2835 | 3730 |
"/ the code below is obsolete - it does not deal with |
3731 |
"/ classVariables, private classes and does not |
|
5863 | 3732 |
"/ recompile other classes in order to care for namespace |
2835 | 3733 |
"/ changes. |
3702 | 3734 |
"/ Please use Smalltalk>>renameClass:to:, |
3735 |
"/ which deals with all of that. |
|
3736 |
self obsoleteMethodWarning:'use Smalltalk>>renameClass:to:'. |
|
2835 | 3737 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3738 |
oldSym := name asSymbol. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3739 |
newSym := newName asSymbol. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3740 |
self setName:newSym. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3741 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3742 |
Smalltalk at:oldSym put:nil. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3743 |
Smalltalk removeKey:oldSym. "26.jun 93" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3744 |
Smalltalk at:newSym put:self. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3745 |
|
3702 | 3746 |
"Created: / 1.4.1997 / 15:27:53 / stefan" |
3747 |
"Modified: / 31.7.1998 / 15:21:34 / cg" |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3748 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3749 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3750 |
!Class methodsFor:'signature checking'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3751 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3752 |
classinstSizeFromSignature:aSignature |
8551 | 3753 |
"for checking class compatibility: return some number based on |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3754 |
the classinstSize from a signature key (not always the real classinstsize)." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3755 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3756 |
^ (aSignature bitShift:-7) bitAnd:7 |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3757 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3758 |
"Created: 1.4.1997 / 15:23:01 / stefan" |
556 | 3759 |
! |
3760 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3761 |
instNameKeyFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3762 |
"for checking class compatibility: return a number based on the |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3763 |
names and order of the instance variables from a signature key." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3764 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3765 |
^ (aSignature bitShift:-14) bitAnd:16rFFFF |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3766 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3767 |
" |
8551 | 3768 |
Point instNameKeyFromSignature:Point signature. |
3769 |
Association instNameKeyFromSignature:Association signature. |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3770 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3771 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3772 |
"Created: 1.4.1997 / 15:23:07 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3773 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3774 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3775 |
instSizeFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3776 |
"for checking class compatibility: return the some number based on |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3777 |
the instSize from a signature key (not always the real instSize)." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3778 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3779 |
^ aSignature bitAnd:16r7F |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3780 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3781 |
" |
8551 | 3782 |
Class instSizeFromSignature:Point signature. |
3783 |
Class instSizeFromSignature:Association signature. |
|
3784 |
Class instSizeFromSignature:Dictionary signature. |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3785 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3786 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3787 |
"Created: 1.4.1997 / 15:23:15 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3788 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3789 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3790 |
instTypeFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3791 |
"for checking class compatibility: return some number based on |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3792 |
the instType (i.e. variableBytes/Pointers etc.) from a signature key." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3793 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3794 |
^ (aSignature bitShift:-10) bitAnd:(Class maskIndexType) |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3795 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3796 |
" |
8551 | 3797 |
Class instTypeFromSignature:Object signature. |
3798 |
Class instTypeFromSignature:Array signature. |
|
3799 |
Class instTypeFromSignature:String signature. |
|
3800 |
Class instTypeFromSignature:OrderedCollection signature. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3801 |
" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3802 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3803 |
"Created: 1.4.1997 / 15:23:20 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3804 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3805 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3806 |
signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3807 |
"return a signature number - this number is useful for a quick |
8551 | 3808 |
check for changed classes, and is done in the binary-object loader, |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3809 |
and the dynamic class loader. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3810 |
Do NOT change the algorithm here - others may depend on it. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3811 |
Also, the algorithm may change - so never interpret the returned value |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3812 |
(if at all, use the access #XXXFromSignature: methods)" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3813 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3814 |
|value "{ Class: SmallInteger }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3815 |
nameKey "{ Class: SmallInteger }" | |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3816 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3817 |
signature notNil ifTrue:[^ signature]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3818 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3819 |
value := self flags bitAnd:(Class maskIndexType). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3820 |
value := (value bitShift:3) + ((self class instSize - Class instSize) bitAnd:7). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3821 |
value := (value bitShift:7) + (self instSize bitAnd:16r7F). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3822 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3823 |
nameKey := 0. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3824 |
self allInstVarNames do:[:name | |
8726 | 3825 |
nameKey := nameKey bitShift:1. |
3826 |
(nameKey bitAnd:16r10000) ~~ 0 ifTrue:[ |
|
3827 |
nameKey := nameKey bitXor:1. |
|
3828 |
nameKey := nameKey bitAnd:16rFFFF. |
|
3829 |
]. |
|
3830 |
nameKey := (nameKey + (name at:1) codePoint) bitAnd:16rFFFF. |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3831 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3832 |
value := value + (nameKey bitShift:14). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3833 |
signature := value. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3834 |
^ value |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3835 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3836 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3837 |
Array signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3838 |
ByteArray signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3839 |
View signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3840 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3841 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3842 |
"Created: 1.4.1997 / 15:23:24 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3843 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3844 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3845 |
!Class methodsFor:'source management'! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3846 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3847 |
binaryRevision |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3848 |
"return the revision-ID from which the class was stc-compiled; |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3849 |
nil if its an autoloaded or filedIn class. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3850 |
If a classes binary is up-to-date w.r.t. the source repository, |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3851 |
the returned string is the same as the one returned by #revision." |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3852 |
|
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
3853 |
|owner info c| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
3854 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
3855 |
(owner := self owningClass) notNil ifTrue:[^ owner binaryRevision]. |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
3856 |
|
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
3857 |
revision notNil ifTrue:[ |
8726 | 3858 |
c := revision first. |
3859 |
c == $$ ifTrue:[ |
|
3860 |
info := Class revisionInfoFromString:revision. |
|
3861 |
info isNil ifTrue:[^ '0']. |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
3862 |
^ (info revision) ? '0'. |
8726 | 3863 |
]. |
3864 |
c isDigit ifFalse:[ |
|
3865 |
^ '0' |
|
3866 |
]. |
|
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
3867 |
]. |
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
3868 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3869 |
^ revision |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3870 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3871 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3872 |
Object binaryRevision |
953
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
3873 |
Object class binaryRevision |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3874 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3875 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3876 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3877 |
to find all classes which are not up-to-date: |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3878 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3879 |
|classes| |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3880 |
|
8551 | 3881 |
classes := Smalltalk allClasses |
8726 | 3882 |
select:[:cls | cls binaryRevision notNil and:[cls binaryRevision ~= cls revision]]. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3883 |
SystemBrowser browseClasses:classes title:'classes which are not up-to-date' |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3884 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3885 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
3886 |
"Created: / 07-12-1995 / 10:58:47 / cg" |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
3887 |
"Modified: / 01-04-1997 / 23:33:01 / stefan" |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
3888 |
"Modified: / 22-10-2008 / 20:37:05 / cg" |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3889 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3890 |
|
5183 | 3891 |
currentSourceStream |
3892 |
"return an open stream on the current source of the receiver" |
|
3893 |
||
3894 |
|theWriteStream theCurrentSource| |
|
3895 |
||
8222
f2c454a9a038
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
8212
diff
changeset
|
3896 |
theWriteStream := String writeStream. |
5183 | 3897 |
Method flushSourceStreamCache. |
3898 |
self fileOutOn:theWriteStream withTimeStamp:false. |
|
3899 |
theCurrentSource := theWriteStream contents asString. |
|
3900 |
theWriteStream close. |
|
3901 |
^ theCurrentSource |
|
3902 |
||
3903 |
"Modified: 15.10.1996 / 18:59:40 / cg" |
|
3904 |
"Modified: 1.4.1997 / 14:33:12 / stefan" |
|
3905 |
! |
|
3906 |
||
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3907 |
localSourceStreamFor:sourceFile |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3908 |
"return an open stream on a local sourcefile, nil if that is not available" |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3909 |
|
5073 | 3910 |
|fileName info module dir fn package packageDir zar entry| |
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3911 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3912 |
"/ |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3913 |
"/ old: look in 'source/<filename>' |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3914 |
"/ this is still kept in order to find user-private |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3915 |
"/ classes in her currentDirectory. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3916 |
"/ |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3917 |
fileName := Smalltalk getSourceFileName:sourceFile. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3918 |
fileName notNil ifTrue:[ |
8726 | 3919 |
^ fileName asFilename readStreamOrNil. |
3165
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
3920 |
]. |
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
3921 |
|
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
3922 |
(package := self package) notNil ifTrue:[ |
10009 | 3923 |
"/ newest scheme ... |
8726 | 3924 |
packageDir := package copyReplaceAll:$: with:$/. |
3925 |
packageDir := Smalltalk getPackageFileName:packageDir. |
|
3926 |
packageDir notNil ifTrue:[ |
|
3927 |
"/ present there ? |
|
3928 |
packageDir := packageDir asFilename. |
|
3929 |
(fn := packageDir construct:sourceFile) exists ifTrue:[ |
|
3930 |
^ fn readStreamOrNil. |
|
3931 |
]. |
|
3932 |
||
3933 |
"/ a source subdirectory ? |
|
3934 |
fn := (packageDir construct:'source') construct:sourceFile. |
|
3935 |
fn exists ifTrue:[ |
|
3936 |
^ fn readStreamOrNil. |
|
3937 |
]. |
|
3938 |
||
3939 |
"/ a zip-file ? |
|
3940 |
fn := (packageDir construct:'source.zip'). |
|
3941 |
fn exists ifTrue:[ |
|
3942 |
zar := ZipArchive oldFileNamed:fn. |
|
3943 |
zar notNil ifTrue:[ |
|
3944 |
entry := zar extract:sourceFile. |
|
3945 |
entry notNil ifTrue:[ |
|
3946 |
^ entry asString readStream |
|
3947 |
] |
|
3948 |
] |
|
3949 |
] |
|
3950 |
]. |
|
3951 |
||
3952 |
"/ will vanish ... |
|
3953 |
(package includes:$:) ifTrue:[ |
|
3954 |
package := package asString copyReplaceAll:$: with:$/ |
|
3955 |
] ifFalse:[ |
|
3956 |
package := 'stx/' , package |
|
3957 |
]. |
|
3958 |
fileName := Smalltalk getSourceFileName:(package , '/' , sourceFile). |
|
3959 |
fileName notNil ifTrue:[ |
|
3960 |
^ fileName asFilename readStreamOrNil. |
|
3961 |
]. |
|
3962 |
(package startsWith:'stx/') ifTrue:[ |
|
3963 |
fileName := Smalltalk getSourceFileName:((package copyFrom:5) , '/' , sourceFile). |
|
3964 |
fileName notNil ifTrue:[ |
|
3965 |
^ fileName asFilename readStreamOrNil. |
|
3966 |
] |
|
3967 |
] |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3968 |
]. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3969 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3970 |
"/ |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3971 |
"/ new: look in 'source/<module>/<package>/<filename> |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3972 |
"/ this makes the symbolic links to (or copy of) the source files |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3973 |
"/ obsolete. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3974 |
info := self packageSourceCodeInfo. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3975 |
info notNil ifTrue:[ |
8726 | 3976 |
module := info at:#module ifAbsent:nil. |
3977 |
module notNil ifTrue:[ |
|
3978 |
dir := info at:#directory ifAbsent:nil. |
|
3979 |
dir notNil ifTrue:[ |
|
3980 |
fn := (module asFilename construct:dir) construct:sourceFile. |
|
3981 |
fileName := Smalltalk getSourceFileName:(fn name). |
|
3982 |
fileName notNil ifTrue:[ |
|
3983 |
^ fileName asFilename readStreamOrNil. |
|
3984 |
]. |
|
3985 |
||
3986 |
"/ brand new: look for source/<module>/package.zip |
|
3987 |
"/ containing an entry for <filename> |
|
3988 |
||
3989 |
fn := (module asFilename construct:dir) withSuffix:'zip'. |
|
3990 |
fileName := Smalltalk getSourceFileName:(fn name). |
|
3991 |
fileName notNil ifTrue:[ |
|
3992 |
zar := ZipArchive oldFileNamed:fileName. |
|
3993 |
zar notNil ifTrue:[ |
|
3994 |
entry := zar extract:sourceFile. |
|
3995 |
entry notNil ifTrue:[ |
|
3996 |
^ entry asString readStream |
|
3997 |
] |
|
3998 |
] |
|
3999 |
]. |
|
4000 |
||
4001 |
"/ and also in source/source.zip ... |
|
4002 |
||
4003 |
fileName := Smalltalk getSourceFileName:'source.zip'. |
|
4004 |
fileName notNil ifTrue:[ |
|
4005 |
zar := ZipArchive oldFileNamed:fileName. |
|
4006 |
zar notNil ifTrue:[ |
|
4007 |
entry := zar extract:sourceFile. |
|
4008 |
entry notNil ifTrue:[ |
|
4009 |
^ entry asString readStream |
|
4010 |
] |
|
4011 |
] |
|
4012 |
]. |
|
4013 |
] |
|
4014 |
] |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4015 |
]. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4016 |
^ nil |
3165
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
4017 |
|
3657 | 4018 |
"Modified: / 18.7.1998 / 22:53:19 / cg" |
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4019 |
! |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4020 |
|
7174
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4021 |
nameOfVersionMethod |
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4022 |
^ #version |
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4023 |
! |
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4024 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4025 |
packageSourceCodeInfo |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4026 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4027 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4028 |
"return the sourceCodeInfo, which defines the module and the subdirectory |
8551 | 4029 |
in which the receiver class was built. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4030 |
This info is extracted from the package id (which is added to stc-compiled classes). |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4031 |
This method is to be obsoleted soon, since the same info is now found |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4032 |
in the versionString. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4033 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4034 |
The info returned consists of a dictionary |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4035 |
filled with (at least) values at: #module, #directory and #library. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4036 |
If no such info is present in the class, nil is returned. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4037 |
(this happens with autoloaded and filed-in classes) |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4038 |
Auotloaded classes set their package from the revisionInfo, if present. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4039 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4040 |
By convention, this info is encoded in the classes package |
8551 | 4041 |
string (which is given as argument to stc) as the last word in parenthesis. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4042 |
The info consists of 1 to 3 subcomponents, separated by colons. |
8551 | 4043 |
The first defines the classes module (i.e. some application identifier), |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4044 |
the second defines the subdirectory within that module, the third |
8551 | 4045 |
defines the name of the class library. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4046 |
If left blank, the module info defaults to 'stx', |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4047 |
the directory info defaults to library name. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4048 |
The library name may not be left blank. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4049 |
(this is done for backward compatibility,) |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4050 |
|
8551 | 4051 |
For example: |
8726 | 4052 |
'....(libbasic)' -> module: stx directory: libbasic library: libbasic |
4053 |
'....(stx:libbasic)' -> module: stx directory: libbasic library: libbasic |
|
4054 |
'....(stx:foo:libbfoo)' -> module: stx directory: foo library: libfoo |
|
4055 |
'....(aeg:libIECInterface)' -> module: aeg directory: libIECInterface library:libIECInterface |
|
4056 |
'....(stx:goodies/persistency:libdbase)' -> module: stx directory: goodies/persistency library:libdbase |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4057 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4058 |
The way how the sourceCodeManager uses this to find the source location |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4059 |
depends on the scheme used. For CVS, the module is taken as the -d arg, |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4060 |
while the directory is prepended to the file name. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4061 |
Other schemes may do things differently - these are not yet specified. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4062 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4063 |
Caveat: |
8726 | 4064 |
Encoding this info in the package string seems somewhat kludgy. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4065 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4066 |
|
8551 | 4067 |
|owner sourceInfo packageString idx1 idx2 |
4116 | 4068 |
moduleString directoryString libraryString components component1 component2 dirComponents mgr| |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4069 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4070 |
(owner := self owningClass) notNil ifTrue:[^ owner packageSourceCodeInfo]. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4071 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4072 |
package isNil ifTrue:[^ nil]. |
8085 | 4073 |
package == (Project noProjectID) ifTrue:[^ nil]. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4074 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4075 |
packageString := package asString. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4076 |
idx1 := packageString lastIndexOf:$(. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4077 |
idx1 ~~ 0 ifTrue:[ |
8726 | 4078 |
idx2 := packageString indexOf:$) startingAt:idx1+1. |
4079 |
idx2 ~~ 0 ifTrue:[ |
|
4080 |
sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1 |
|
4081 |
] |
|
2453
603af5a4e0fc
handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents:
2444
diff
changeset
|
4082 |
] ifFalse:[ |
8726 | 4083 |
sourceInfo := packageString |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4084 |
]. |
2453
603af5a4e0fc
handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents:
2444
diff
changeset
|
4085 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4086 |
sourceInfo isNil ifTrue:[^ nil]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4087 |
components := sourceInfo asCollectionOfSubstringsSeparatedBy:$:. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4088 |
components size == 0 ifTrue:[ |
2958
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
4089 |
"/ moduleString := 'stx'. |
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
4090 |
"/ directoryString := libraryString := ''. |
8726 | 4091 |
^ nil |
2454 | 4092 |
]. |
4116 | 4093 |
|
4094 |
component1 := components at:1. |
|
2454 | 4095 |
components size == 1 ifTrue:[ |
8726 | 4096 |
"/ a single name given - the module becomes 'stx' or |
4097 |
"/ the very first directory component (if such a module exists). |
|
4098 |
"/ If the component includes slashes, its the directory |
|
4099 |
"/ otherwise the library. |
|
4100 |
"/ |
|
8737
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
4101 |
dirComponents := Filename components:component1. |
8726 | 4102 |
(dirComponents size > 1 |
4103 |
and:[(mgr := self sourceCodeManager) notNil |
|
4104 |
and:[mgr checkForExistingModule:dirComponents first]]) ifTrue:[ |
|
4105 |
moduleString := dirComponents first. |
|
4106 |
directoryString := libraryString := (Filename fromComponents:(dirComponents copyFrom:2)) asString. |
|
4107 |
] ifFalse:[ |
|
4108 |
"/ non-existing; assume directory under the stx package. |
|
4109 |
moduleString := 'stx'. |
|
4110 |
(component1 startsWith:'stx/') ifTrue:[ |
|
4111 |
component1 := component1 copyFrom:5 |
|
4112 |
]. |
|
4113 |
directoryString := libraryString := component1. |
|
4114 |
]. |
|
4115 |
||
4116 |
(libraryString includes:$/) ifTrue:[ |
|
4117 |
libraryString := libraryString asFilename baseName |
|
4118 |
] |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4119 |
] ifFalse:[ |
8726 | 4120 |
component2 := components at:2. |
4121 |
components size == 2 ifTrue:[ |
|
4122 |
"/ two components - assume its the module and the directory; |
|
4123 |
"/ the library is assumed to be named after the directory |
|
4124 |
"/ except, if slashes are in the name; then the libraryname |
|
4125 |
"/ is the last component. |
|
4126 |
"/ |
|
4127 |
moduleString := component1. |
|
4128 |
directoryString := libraryString := component2. |
|
4129 |
(libraryString includes:$/) ifTrue:[ |
|
4130 |
libraryString := libraryString asFilename baseName |
|
4131 |
] |
|
4132 |
] ifFalse:[ |
|
4133 |
"/ all components given |
|
4134 |
moduleString := component1. |
|
4135 |
directoryString := component2. |
|
4136 |
libraryString := components at:3. |
|
4137 |
] |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4138 |
]. |
2454 | 4139 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4140 |
libraryString isEmpty ifTrue:[ |
8726 | 4141 |
directoryString notEmpty ifTrue:[ |
4142 |
libraryString := directoryString asFilename baseName |
|
4143 |
]. |
|
4144 |
libraryString isEmpty ifTrue:[ |
|
4145 |
"/ lets extract the library from the liblist file ... |
|
4146 |
libraryString := Smalltalk libraryFileNameOfClass:self. |
|
4147 |
libraryString isNil ifTrue:[^ nil]. |
|
4148 |
] |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4149 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4150 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4151 |
moduleString isEmpty ifTrue:[ |
8726 | 4152 |
moduleString := 'stx'. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4153 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4154 |
directoryString isEmpty ifTrue:[ |
8726 | 4155 |
directoryString := libraryString. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4156 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4157 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4158 |
^ IdentityDictionary |
8726 | 4159 |
with:(#module->moduleString) |
4160 |
with:(#directory->directoryString) |
|
4161 |
with:(#library->libraryString) |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4162 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4163 |
" |
8551 | 4164 |
Object packageSourceCodeInfo |
4165 |
View packageSourceCodeInfo |
|
4166 |
Model packageSourceCodeInfo |
|
4167 |
BinaryObjectStorage packageSourceCodeInfo |
|
4168 |
MemoryMonitor packageSourceCodeInfo |
|
4169 |
ClockView packageSourceCodeInfo |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4170 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4171 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4172 |
"Created: 4.11.1995 / 20:36:53 / cg" |
2958
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
4173 |
"Modified: 19.9.1997 / 10:42:25 / cg" |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4174 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4175 |
|
8770 | 4176 |
projectDirectory |
4177 |
"return my projects directory - thats where the sources, binaries, classLib, |
|
4178 |
resources etc. are typically found." |
|
4179 |
||
4180 |
^ Smalltalk projectDirectoryForClass:self |
|
4181 |
||
4182 |
" |
|
4183 |
Object projectDirectory |
|
4184 |
View projectDirectory |
|
4185 |
ApplicationModel projectDirectory |
|
4186 |
" |
|
4187 |
! |
|
4188 |
||
7866 | 4189 |
resourceDirectory |
4190 |
"return the directory where my resource file is supposed to live. |
|
4191 |
Here, take the package and assume that a directory named 'resources' exists |
|
4192 |
in my package directory. |
|
4193 |
Return nil, if no such directory exists." |
|
4194 |
||
10102 | 4195 |
^ Smalltalk resourceDirectoryForPackage:(self package) |
7866 | 4196 |
|
4197 |
" |
|
8551 | 4198 |
Object resourceDirectory |
4199 |
View resourceDirectory |
|
4200 |
ApplicationModel resourceDirectory |
|
7866 | 4201 |
" |
10102 | 4202 |
|
4203 |
"Modified: / 19-10-2006 / 23:08:37 / cg" |
|
7866 | 4204 |
! |
4205 |
||
3248
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4206 |
resourcePackName |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4207 |
"return the name which is used as the fileNameBase of my resource file. |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4208 |
Notice, that this will undergo the same name translation process as |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4209 |
done with class-source file names. (see ResourcePack). |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4210 |
The default here is the classes name - this can be redefined in classes |
10102 | 4211 |
which want to use another classes resources (NewLauncher -> Launcher)." |
3248
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4212 |
|
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4213 |
^ self name |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4214 |
|
10102 | 4215 |
"Created: / 29-01-1998 / 22:20:12 / cg" |
4216 |
"Modified: / 19-10-2006 / 23:11:57 / cg" |
|
3248
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4217 |
! |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4218 |
|
8267 | 4219 |
resourcePackage |
4220 |
"return the package from where my resources are loaded. |
|
4221 |
By default, that is the classes package." |
|
4222 |
||
4223 |
^ self package |
|
4224 |
! |
|
4225 |
||
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4226 |
revision |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4227 |
"return the revision-ID of the class which corresponds to the |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4228 |
cvs-id of the source to which this class is equivalent. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4229 |
Initially, this is the same as #binaryRevision; however, once changes have |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4230 |
been checked into a source repository, the binary continues to remain based upon |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4231 |
the old revision, while logically, the class has the new (checked-in) revision. |
8551 | 4232 |
To check if a source corresponds to a compiled binary, compare this |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4233 |
ID with the one returned by #binaryRevision." |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4234 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4235 |
|info| |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4236 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4237 |
info := self revisionInfo. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4238 |
info notNil ifTrue:[ |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4239 |
^ info revision |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4240 |
]. |
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4241 |
^ self binaryRevision |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4242 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4243 |
" |
8551 | 4244 |
Object revision |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4245 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4246 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4247 |
"Created: / 11-11-1995 / 14:27:20 / cg" |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4248 |
"Modified: / 26-03-1997 / 00:14:00 / stefan" |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4249 |
"Modified: / 22-10-2008 / 20:37:59 / cg" |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4250 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4251 |
|
2582 | 4252 |
revisionDateString |
4253 |
"return the revision-Date of the class as a string. |
|
4254 |
This is extracted from the version string." |
|
4255 |
||
4256 |
|info| |
|
4257 |
||
4258 |
info := self revisionInfo. |
|
4259 |
info notNil ifTrue:[ |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4260 |
^ (info date) ? '??/??/??' |
2582 | 4261 |
]. |
4262 |
^ '??/??/??' |
|
4263 |
||
4264 |
" |
|
8551 | 4265 |
Object revisionDateString |
2582 | 4266 |
" |
4267 |
||
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4268 |
"Created: / 23-04-1997 / 12:29:21 / cg" |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4269 |
"Modified: / 22-10-2008 / 20:38:25 / cg" |
2582 | 4270 |
! |
4271 |
||
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4272 |
revisionInfo |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4273 |
"return an object filled with revision info. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4274 |
This extracts the relevant info from the revisionString. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4275 |
The revisionInfo contains all or a subset of: |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4276 |
binaryRevision - the revision upon which the binary of this class is based |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4277 |
revision - the revision upon which the class is based logically |
8726 | 4278 |
(different, if a changed class was checked in, but not yet recompiled) |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4279 |
user - the user who checked in the logical revision |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4280 |
date - the date when the logical revision was checked in |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4281 |
time - the time when the logical revision was checked in |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4282 |
fileName - the classes source file name |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4283 |
repositoryPath - the classes source container |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4284 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4285 |
|
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
4286 |
|vsnString info mgr| |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4287 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4288 |
vsnString := self revisionString. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4289 |
vsnString notNil ifTrue:[ |
8726 | 4290 |
mgr := self sourceCodeManager. |
4291 |
mgr notNil ifTrue:[ |
|
4292 |
info := mgr revisionInfoFromString:vsnString |
|
4293 |
] ifFalse:[ |
|
4294 |
info := Class revisionInfoFromString:vsnString. |
|
4295 |
]. |
|
4296 |
info notNil ifTrue:[ |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4297 |
info binaryRevision:self binaryRevision. |
8726 | 4298 |
] |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4299 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4300 |
^ info |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4301 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4302 |
" |
8551 | 4303 |
Object revisionString |
4304 |
Object revisionInfo |
|
4305 |
Image revisionInfo |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4306 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4307 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4308 |
"Created: / 11-11-1995 / 14:27:20 / cg" |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4309 |
"Modified: / 26-03-1997 / 00:13:17 / stefan" |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4310 |
"Modified: / 22-10-2008 / 20:35:53 / cg" |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4311 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4312 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4313 |
revisionString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4314 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4315 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4316 |
"return my revision string; that one is extracted from the |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4317 |
classes #version method. Either this is a method returning that string, |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4318 |
or its a comment-only method and the comment defines the version. |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4319 |
If the receiver is unloaded, or the source is not accessable, |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4320 |
or no such method exists, then nil is returned." |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4321 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4322 |
|owner cls meta m src val| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4323 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4324 |
(owner := self owningClass) notNil ifTrue:[^ owner revisionString]. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4325 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4326 |
thisContext isRecursive ifTrue:[^ nil ]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4327 |
|
8551 | 4328 |
meta := self theMetaclass. |
6150
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4329 |
cls := self theNonMetaclass. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4330 |
|
7174
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4331 |
m := meta compiledMethodAt:(self nameOfVersionMethod). |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4332 |
m isNil ifTrue:[ |
8726 | 4333 |
"/ no - do NEVER care for a version method on the instance side |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4334 |
^ nil. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4335 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4336 |
|
1102
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4337 |
m isExecutable ifTrue:[ |
8726 | 4338 |
"/ |
4339 |
"/ if its a method returning the string, |
|
4340 |
"/ thats the returned value |
|
4341 |
"/ |
|
4342 |
val := cls perform:(self nameOfVersionMethod). |
|
4343 |
val isString ifTrue:[^ val]. |
|
1102
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4344 |
]. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4345 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4346 |
"/ |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4347 |
"/ if its a method consisting of a comment only |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4348 |
"/ extract it - this may lead to a recursive call |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4349 |
"/ to myself (thats what the #isRecursive is for) |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4350 |
"/ in case we need to access the source code manager |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4351 |
"/ for the source ... |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4352 |
"/ |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4353 |
src := m source. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4354 |
src isNil ifTrue:[^ nil]. |
8551 | 4355 |
^ Class revisionStringFromSource:src |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4356 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4357 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4358 |
Smalltalk allClassesDo:[:cls | |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4359 |
Transcript show:cls name; show:' -> '; showCR:cls revisionString |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4360 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4361 |
|
8551 | 4362 |
Number revisionString |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4363 |
FileDirectory revisionString |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4364 |
Metaclass revisionString |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4365 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4366 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4367 |
"Created: / 29-10-1995 / 19:28:03 / cg" |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4368 |
"Modified: / 01-04-1997 / 23:37:25 / stefan" |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4369 |
"Modified: / 07-02-2001 / 18:03:39 / ps" |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4370 |
"Modified: / 22-10-2008 / 20:33:49 / cg" |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4371 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4372 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4373 |
setBinaryRevision:aString |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4374 |
"set the revision-ID. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4375 |
This should normally not be done in the running system, as the source-manager |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4376 |
will need this to validate sourcefiles being correct for a given binary |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4377 |
(and optionally: extracting the required sourcefile from the rcs source)" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4378 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4379 |
revision := aString |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4380 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4381 |
"Created: 9.12.1995 / 17:05:17 / cg" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4382 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4383 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4384 |
setPackageFromRevision |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4385 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4386 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4387 |
"set my package from the info found in the revisionString if present. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4388 |
This is used to set some useful packageInfo after autoloading |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4389 |
(otherwise, autoloaded classes/methods would go into your current |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4390 |
package - which is probably not a good idea)" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4391 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4392 |
|info mgr dir lib mod p| |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4393 |
|
1756 | 4394 |
self owningClass notNil ifTrue:[^ self]. |
4395 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4396 |
mgr := self sourceCodeManager. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4397 |
mgr notNil ifTrue:[ |
9839 | 4398 |
info := mgr sourceInfoOfClass:self. |
4399 |
||
4400 |
info notNil ifTrue:[ |
|
4401 |
mod := info at:#module ifAbsent:nil. "/ stx, aeg, <your-organization> |
|
4402 |
dir := info at:#directory ifAbsent:nil. "/ libbasic, libtool ... |
|
4403 |
lib := info at:#library ifAbsent:dir. |
|
4404 |
||
4405 |
p := ''. |
|
4406 |
mod notNil ifTrue:[ |
|
4012
e87e53bc45a6
when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents:
3997
diff
changeset
|
4407 |
"/ mod ~= 'stx' ifTrue:[ |
9839 | 4408 |
p := p , mod |
4012
e87e53bc45a6
when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents:
3997
diff
changeset
|
4409 |
"/ ] |
9839 | 4410 |
]. |
4411 |
dir notNil ifTrue:[ |
|
8726 | 4412 |
p notEmpty ifTrue:[p := p , ':']. |
9839 | 4413 |
p := p , dir. |
4414 |
] ifFalse:[ |
|
4415 |
lib notNil ifTrue:[ |
|
4416 |
p notEmpty ifTrue:[p := p , ':']. |
|
4417 |
p := p , lib. |
|
4418 |
]. |
|
8726 | 4419 |
]. |
9839 | 4420 |
(p notEmpty and:[p ~= package]) ifTrue:[ |
2072
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4421 |
"/ package notNil ifTrue:[ |
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4422 |
"/ (name , ': changing packageID from ''' , package , ''' to ''' , p , '''') infoPrintCR. |
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4423 |
"/ ]. |
9839 | 4424 |
package := p. |
4425 |
||
4426 |
self methodDictionary do:[:aMethod | |
|
4427 |
aMethod package isNil ifTrue:[ |
|
4428 |
aMethod setPackage:p |
|
4429 |
] |
|
8726 | 4430 |
] |
9839 | 4431 |
]. |
8726 | 4432 |
]. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4433 |
]. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4434 |
^ self |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4435 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4436 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4437 |
MemoryMonitor autoload. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4438 |
MemoryMonitor setPackageFromRevision |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4439 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4440 |
|
9839 | 4441 |
"Modified: / 12-06-1996 / 11:49:31 / stefan" |
4442 |
"Modified: / 12-09-2006 / 14:15:47 / cg" |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4443 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4444 |
|
8230 | 4445 |
sourceFileSuffix |
4446 |
^ self class sourceFileSuffix |
|
4447 |
! |
|
4448 |
||
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4449 |
sourceStream |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4450 |
"return an open stream on my sourcefile, nil if that is not available" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4451 |
|
11429 | 4452 |
|owner source stream| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4453 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4454 |
(owner := self owningClass) notNil ifTrue:[^ owner sourceStream]. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4455 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4456 |
classFilename notNil ifTrue:[ |
8711
c5f28b4c719d
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
8605
diff
changeset
|
4457 |
source := classFilename |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4458 |
] ifFalse:[ |
8711
c5f28b4c719d
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
8605
diff
changeset
|
4459 |
source := (Smalltalk fileNameForClass:self) , '.st' |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4460 |
]. |
8149 | 4461 |
stream := self sourceStreamFor:source. |
4462 |
stream notNil ifTrue:[ |
|
8711
c5f28b4c719d
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
8605
diff
changeset
|
4463 |
"/ see if its utf8 encoded... |
11429 | 4464 |
stream := ChangeSet decodedStreamFor:stream. |
8149 | 4465 |
]. |
4466 |
^ stream. |
|
953
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4467 |
! |
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4468 |
|
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4469 |
sourceStreamFor:source |
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4470 |
"return an open stream on a sourcefile, nil if that is not available" |
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4471 |
|
6703 | 4472 |
|owner aStream mgr validated guessedFileName sep mod dir| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4473 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4474 |
(owner := self owningClass) notNil ifTrue:[^ owner sourceStreamFor:source]. |
1909 | 4475 |
validated := false. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4476 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4477 |
"/ |
8551 | 4478 |
"/ if there is no SourceCodeManager, |
892
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4479 |
"/ or TryLocalSourceFirst is true, |
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4480 |
"/ look in standard places first |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4481 |
"/ |
8551 | 4482 |
((mgr := self sourceCodeManager) isNil |
892
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4483 |
or:[TryLocalSourceFirst == true]) ifTrue:[ |
8726 | 4484 |
aStream := self localSourceStreamFor:source. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4485 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4486 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4487 |
aStream isNil ifTrue:[ |
8726 | 4488 |
"/ mhmh - still no source file. |
4489 |
"/ If there is a SourceCodeManager, ask it to aquire the |
|
4490 |
"/ the source for my class, and return an open stream on it. |
|
4491 |
"/ if that one does not know about the source, look in |
|
4492 |
"/ standard places |
|
4493 |
||
4494 |
mgr notNil ifTrue:[ |
|
4495 |
classFilename ~= source ifTrue:[ |
|
4496 |
sep := self package indexOfAny:'/\:'. |
|
4497 |
sep ~~ 0 ifTrue:[ |
|
4498 |
mod := package copyTo:sep - 1. |
|
4499 |
dir := package copyFrom:sep + 1. |
|
4500 |
aStream := mgr streamForClass:nil fileName:source revision:nil directory:dir module:mod cache:true. |
|
4501 |
]. |
|
4502 |
]. |
|
4503 |
aStream isNil ifTrue:[ |
|
4504 |
classFilename isNil ifTrue:[ |
|
4505 |
guessedFileName := (Smalltalk fileNameForClass:self) , '.st'. |
|
4506 |
]. |
|
4507 |
source asFilename baseName = classFilename asFilename baseName ifTrue:[ |
|
4508 |
aStream := mgr getSourceStreamFor:self. |
|
4509 |
] |
|
4510 |
]. |
|
4511 |
aStream notNil ifTrue:[ |
|
4512 |
(self validateSourceStream:aStream) ifFalse:[ |
|
4513 |
('Class [info]: repositories source for `' |
|
4514 |
, (self theNonMetaclass name) |
|
4515 |
, ''' is invalid.') infoPrintCR. |
|
4516 |
aStream close. |
|
4517 |
aStream := nil |
|
4518 |
] ifTrue:[ |
|
4519 |
validated := true. |
|
4520 |
]. |
|
4521 |
]. |
|
4522 |
] |
|
5116
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4523 |
]. |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4524 |
|
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4525 |
aStream isNil ifTrue:[ |
8726 | 4526 |
"/ |
4527 |
"/ hard case - there is no source file for this class |
|
4528 |
"/ (in the source-dir-path). |
|
4529 |
"/ |
|
4530 |
||
4531 |
"/ |
|
4532 |
"/ look if my binary is from a dynamically loaded module, |
|
4533 |
"/ and, if so, look in the modules directory for the |
|
4534 |
"/ source file. |
|
4535 |
"/ |
|
4536 |
ObjectFileLoader notNil ifTrue:[ |
|
4537 |
ObjectFileLoader loadedObjectHandlesDo:[:h | |
|
4538 |
|f classes| |
|
4539 |
||
4540 |
aStream isNil ifTrue:[ |
|
4541 |
(classes := h classes) size > 0 ifTrue:[ |
|
4542 |
(classes includes:self) ifTrue:[ |
|
4543 |
f := h pathName. |
|
4544 |
f := f asFilename directory. |
|
4545 |
f := f construct:source. |
|
4546 |
f exists ifTrue:[ |
|
4547 |
aStream := f readStreamOrNil. |
|
4548 |
]. |
|
4549 |
]. |
|
4550 |
]. |
|
4551 |
] |
|
4552 |
]. |
|
4553 |
]. |
|
5116
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4554 |
]. |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4555 |
|
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4556 |
"/ |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4557 |
"/ try along sourcePath |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4558 |
"/ |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4559 |
aStream isNil ifTrue:[ |
8726 | 4560 |
aStream := self localSourceStreamFor:source. |
5116
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4561 |
]. |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4562 |
|
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4563 |
"/ |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4564 |
"/ final chance: try current directory |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4565 |
"/ |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4566 |
aStream isNil ifTrue:[ |
8726 | 4567 |
aStream := source asFilename readStreamOrNil. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4568 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4569 |
|
1909 | 4570 |
(aStream notNil and:[validated not]) ifTrue:[ |
8726 | 4571 |
(self validateSourceStream:aStream) ifFalse:[ |
4572 |
(Smalltalk releaseIdentification = 'ST/X_free_demo_vsn') ifTrue:[ |
|
3401 | 4573 |
"/ ('Class [info]: source for ''' , self name , ''' is not available in the demo version.') infoPrintCR |
8726 | 4574 |
] ifFalse:[ |
4575 |
('Class [warning]: source for ''' , self name , ''' is invalid or stripped. Take care.') errorPrintCR |
|
4576 |
] |
|
4577 |
]. |
|
1909 | 4578 |
]. |
4744 | 4579 |
(aStream notNil and:[aStream isFileStream]) ifTrue:[ |
9610 | 4580 |
"/ guessedFileName notNil ifTrue:[ |
4581 |
"/ self setClassFilename:(aStream pathName asFilename baseName). |
|
4582 |
"/ ] |
|
4744 | 4583 |
]. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4584 |
^ aStream |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4585 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4586 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4587 |
Object sourceStream |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4588 |
Clock sourceStream |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4589 |
Autoload sourceStream |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4590 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4591 |
|
3391 | 4592 |
"Created: / 10.11.1995 / 21:05:13 / cg" |
4593 |
"Modified: / 22.4.1998 / 19:20:50 / ca" |
|
6150
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4594 |
"Modified: / 5.11.2001 / 16:36:30 / cg" |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4595 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4596 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4597 |
updateVersionMethodFor:newRevisionString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4598 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4599 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4600 |
"helper for the checkin procedure. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4601 |
Update my #version method, to now return newRevisionString." |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4602 |
|
4667 | 4603 |
|cls mthd "vs m mgr"| |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4604 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4605 |
cls := self. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4606 |
self isMeta ifFalse:[ |
8726 | 4607 |
cls := self class |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4608 |
]. |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4609 |
|
8838
81ee56a49ac3
Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents:
8770
diff
changeset
|
4610 |
Class methodRedefinitionNotification answer:#keep do:[ |
8726 | 4611 |
Class withoutUpdatingChangesDo:[ |
9741 | 4612 |
mthd := Compiler compile: |
4613 |
(self nameOfVersionMethod) , ' |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4614 |
^ ''' , newRevisionString , ''' |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4615 |
' |
8726 | 4616 |
forClass:cls |
4617 |
inCategory:#documentation |
|
4618 |
notifying:nil |
|
4619 |
install:true |
|
4620 |
skipIfSame:false |
|
4621 |
silent:true. |
|
4622 |
mthd notNil ifTrue:[ |
|
4623 |
mthd setPackage:self package |
|
4624 |
] |
|
4625 |
] |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4626 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4627 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4628 |
^ true |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4629 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4630 |
"Created: / 07-12-1995 / 20:42:22 / cg" |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4631 |
"Modified: / 22-10-2008 / 20:35:18 / cg" |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4632 |
! |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4633 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4634 |
validateSourceStream:aStream |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4635 |
"check if aStream really contains my source. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4636 |
This is done by checking the version methods return value |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4637 |
against the version string as contained in the version method. |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4638 |
This helps to detect mangled source code." |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4639 |
|
1766 | 4640 |
|cls meta cannotCheckReason versionMethod info |
7748
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4641 |
versionFromCode versionFromSource oldPos pos src rev |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4642 |
versionMethodsName| |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4643 |
|
8551 | 4644 |
meta := self theMetaclass. |
6150
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4645 |
cls := self theNonMetaclass. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4646 |
|
1766 | 4647 |
cannotCheckReason := nil. |
7748
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4648 |
versionMethodsName := self nameOfVersionMethod. |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4649 |
|
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4650 |
versionMethod := meta compiledMethodAt:versionMethodsName. |
8551 | 4651 |
(versionMethod isNil |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4652 |
or:[versionMethod isExecutable not]) ifTrue:[ |
8726 | 4653 |
versionMethod := cls compiledMethodAt:versionMethodsName. |
4654 |
(versionMethod isNil |
|
4655 |
or:[versionMethod isExecutable not]) ifTrue:[ |
|
4656 |
cannotCheckReason := 'no valid version method'. |
|
4657 |
] |
|
2544
c3a2791de289
care for unloaded methods, when validating the source revision
Claus Gittinger <cg@exept.de>
parents:
2516
diff
changeset
|
4658 |
] ifFalse:[ |
8726 | 4659 |
"/ |
4660 |
"/ if its a method returning the string, |
|
4661 |
"/ thats the returned value |
|
4662 |
"/ |
|
4663 |
versionFromCode := cls perform:versionMethodsName. |
|
4664 |
versionFromCode isString ifFalse:[ |
|
4665 |
cannotCheckReason := 'version method does not return a string' |
|
4666 |
]. |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4667 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4668 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4669 |
"/ |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4670 |
"/ if its a method consisting of a comment only |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4671 |
"/ extract it - this may lead to a recursive call |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4672 |
"/ to myself (thats what the #isRecursive is for) |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4673 |
"/ in case we need to access the source code manager |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4674 |
"/ for the source ... |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4675 |
"/ |
1942 | 4676 |
versionMethod notNil ifTrue:[ |
8726 | 4677 |
pos := versionMethod sourcePosition. |
4678 |
pos isInteger ifFalse:[ |
|
4679 |
"/ mhmh - either no version method, |
|
4680 |
"/ or updated due to a checkin. |
|
4681 |
"/ in any case, this should be a good source. |
|
4682 |
||
4683 |
^ true. |
|
4684 |
"/ cannotCheckReason := 'no source position for version-method' |
|
4685 |
] |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4686 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4687 |
|
1766 | 4688 |
cannotCheckReason notNil ifTrue:[ |
8726 | 4689 |
('Class [warning]: ' , cannotCheckReason , ' in ' , self name) infoPrintCR. |
4690 |
'Class [info]: cannot validate source; trusting source' infoPrintCR. |
|
4691 |
^ true |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4692 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4693 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4694 |
oldPos := aStream position. |
3371
1d8aa07c4b7f
care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents:
3365
diff
changeset
|
4695 |
Stream positionErrorSignal handle:[:ex | |
8726 | 4696 |
'Class [info]: position error when accessing source' infoPrintCR. |
4697 |
^ false |
|
3371
1d8aa07c4b7f
care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents:
3365
diff
changeset
|
4698 |
] do:[ |
8726 | 4699 |
aStream position1Based:pos. |
3371
1d8aa07c4b7f
care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents:
3365
diff
changeset
|
4700 |
]. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4701 |
src := aStream nextChunk. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4702 |
aStream position:oldPos. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4703 |
|
9063
953b305e35d6
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
8952
diff
changeset
|
4704 |
(src isEmptyOrNil) ifTrue:[ |
8726 | 4705 |
'Class [info]: empty source for version-method' infoPrintCR. |
4706 |
^ false |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4707 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4708 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4709 |
versionFromSource := Class revisionStringFromSource:src. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4710 |
versionFromSource = versionFromCode ifTrue:[^ true]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4711 |
|
4784 | 4712 |
versionFromSource isNil ifTrue:[ |
8726 | 4713 |
'Class [info]: version-from source is nil' infoPrintCR. |
4714 |
^ false |
|
4784 | 4715 |
]. |
1786 | 4716 |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4717 |
"/ mhmh - check my binary version ... |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4718 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4719 |
info := Class revisionInfoFromString:versionFromSource. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4720 |
info notNil ifTrue:[ |
8726 | 4721 |
rev := info at:#revision. |
4722 |
rev = self binaryRevision ifTrue:[^ true]. |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4723 |
]. |
4784 | 4724 |
'Class [info]: source-version is different from binaryRevision' infoPrintCR. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4725 |
^ false |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4726 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4727 |
"Modified: / 22-10-2008 / 20:30:36 / cg" |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4728 |
! ! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4729 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4730 |
!Class methodsFor:'special accessing'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4731 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4732 |
setName:aString |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4733 |
"set the classes name - be careful, it will be still |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4734 |
in the Smalltalk dictionary - under another key. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4735 |
This is NOT for general use - see renameTo:" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4736 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4737 |
environment := nil. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4738 |
name := aString |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4739 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4740 |
"Created: 1.4.1997 / 15:46:01 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4741 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4742 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4743 |
!Class::ClassAttributes methodsFor:'accessing'! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4744 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4745 |
primitiveDefinitions |
7463 | 4746 |
^ primitiveDefinitions |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4747 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4748 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4749 |
primitiveDefinitions:something |
7463 | 4750 |
primitiveDefinitions := something. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4751 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4752 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4753 |
primitiveFunctions |
7463 | 4754 |
^ primitiveFunctions |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4755 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4756 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4757 |
primitiveFunctions:something |
7463 | 4758 |
primitiveFunctions := something. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4759 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4760 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4761 |
primitiveVariables |
7463 | 4762 |
^ primitiveVariables |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4763 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4764 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4765 |
primitiveVariables:something |
7463 | 4766 |
primitiveVariables := something. |
8551 | 4767 |
! |
4768 |
||
4769 |
sharedPools |
|
4770 |
^ sharedPools |
|
4771 |
! |
|
4772 |
||
4773 |
sharedPools:something |
|
4774 |
sharedPools := something. |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4775 |
! ! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4776 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4777 |
!Class::ClassAttributes methodsFor:'conversion'! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4778 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4779 |
fromSTCPrimitiveArray:anArray |
8551 | 4780 |
"for now, the stc compiler generates a 3- or 4-element primitive spec array |
4781 |
(it does not know anything about the ClassAttributes class). |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4782 |
This method is invoked to convert." |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4783 |
|
7463 | 4784 |
primitiveDefinitions := anArray at:1. |
4785 |
primitiveVariables := anArray at:2. |
|
4786 |
primitiveFunctions := anArray at:3. |
|
8551 | 4787 |
anArray size > 3 ifTrue:[ |
8726 | 4788 |
sharedPools := anArray at:4. |
8551 | 4789 |
]. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4790 |
! ! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4791 |
|
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4792 |
!Class::SimulatedClassPool class methodsFor:'documentation'! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4793 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4794 |
documentation |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4795 |
" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4796 |
in contrast to other smalltalks, ST/X does not keep the classVariables |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4797 |
in a dictionary; instead, classVariables are stored as special globals, |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4798 |
with the className as prefix (colon-separated). |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4799 |
The reason is that stc-compiled code should be allowed to access classVars |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4800 |
in a similar fashion to globals. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4801 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4802 |
Whenever a classes classPool is requested, an instance of myself is |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4803 |
created, which forwards at: and at:put: messages to the original class. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4804 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4805 |
This is an additional goody class; therefore: |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4806 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4807 |
THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTOR ``AS IS'' AND |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4808 |
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4809 |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4810 |
ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTOR BE LIABLE |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4811 |
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4812 |
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4813 |
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4814 |
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4815 |
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4816 |
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4817 |
SUCH DAMAGE. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4818 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4819 |
[author:] |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4820 |
Claus Gittinger |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4821 |
" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4822 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4823 |
! ! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4824 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4825 |
!Class::SimulatedClassPool methodsFor:'accessing'! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4826 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4827 |
associationAt:aName |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4828 |
"simulate an association" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4829 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4830 |
^ SimulatedVariableBinding key:aName value:(class classVarAt:aName) |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4831 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4832 |
"Modified: / 4.2.2000 / 00:27:40 / cg" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4833 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4834 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4835 |
associationAt:aName ifAbsent:exceptionBlock |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4836 |
"simulate an association" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4837 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4838 |
|internalName cls| |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4839 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4840 |
cls := class theNonMetaclass. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4841 |
internalName := (cls name , ':' , aName) asSymbol. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4842 |
^ SimulatedVariableBinding key:internalName value:(cls classVarAt:aName) |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4843 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4844 |
"Created: / 3.2.2000 / 23:30:07 / cg" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4845 |
"Modified: / 4.2.2000 / 01:58:56 / cg" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4846 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4847 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4848 |
associationsDo:aBlock |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4849 |
"evaluate aBlock for all of my simulated classVarName->value associations" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4850 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4851 |
class classVarNames do:[:eachName | |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4852 |
aBlock value:(self associationAt:eachName) |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4853 |
]. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4854 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4855 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4856 |
at:aKey |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4857 |
^ class classVarAt:aKey |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4858 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4859 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4860 |
at:aKey ifAbsent:exceptionBlock |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4861 |
^ class classVarAt:aKey ifAbsent:exceptionBlock |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4862 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4863 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4864 |
at:aKey put:something |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4865 |
^ class classVarAt:aKey put:something |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4866 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4867 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4868 |
keys |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4869 |
^ class classVarNames collect:[:nm | nm asSymbol] |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4870 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4871 |
" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4872 |
Button classPool keys |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4873 |
Button classPool at:#ReturnForm |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4874 |
" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4875 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4876 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4877 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4878 |
keysAndValuesDo:aBlock |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4879 |
"evaluate aBlock for all of my simulated classVarName->value associations" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4880 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4881 |
class classVarNames do:[:eachName | |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4882 |
aBlock value:eachName value:(class classVarAt:eachName) |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4883 |
]. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4884 |
! ! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4885 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4886 |
!Class::SimulatedClassPool methodsFor:'accessing-private'! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4887 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4888 |
setClass:aClass |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4889 |
class := aClass |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4890 |
! ! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4891 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4892 |
!Class::SimulatedClassPool::SimulatedVariableBinding methodsFor:'queries'! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4893 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4894 |
isVariableBinding |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4895 |
^ true |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4896 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4897 |
"Created: / 4.2.2000 / 00:27:20 / cg" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4898 |
! ! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
4899 |
|
1739 | 4900 |
!Class class methodsFor:'documentation'! |
662 | 4901 |
|
4902 |
version |
|
11866 | 4903 |
^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.541 2009-08-19 18:08:45 stefan Exp $' |
708
ba92b2a8477d
include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents:
707
diff
changeset
|
4904 |
! ! |