author | Stefan Vogel <sv@exept.de> |
Sat, 26 May 2012 22:02:59 +0200 | |
changeset 14146 | 94acb9d1afc8 |
parent 14000 | 1b4fbb92d572 |
child 14147 | ba9cc1cb4e0a |
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 |
13756 | 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 |
13093 | 15 |
instanceVariableNames:'name category classvars comment subclasses classFilename package |
16 |
revision environment signature attributes' |
|
17 |
classVariableNames:'DefaultCategoryForSTV DefaultCategoryForVAGE |
|
13860 | 18 |
DefaultCategoryForDolphin ValidateSourceOnlyOnce ValidatedClasses |
19 |
SubclassCacheSequenceNumber' |
|
13093 | 20 |
poolDictionaries:'' |
21 |
category:'Kernel-Classes' |
|
1 | 22 |
! |
23 |
||
13860 | 24 |
Array variableSubclass:#ArrayWithSequenceNumberValidation |
25 |
instanceVariableNames:'sequenceNumber' |
|
26 |
classVariableNames:'' |
|
27 |
poolDictionaries:'' |
|
28 |
privateIn:Class |
|
29 |
! |
|
30 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
31 |
Object subclass:#ClassAttributes |
13093 | 32 |
instanceVariableNames:'primitiveDefinitions primitiveVariables primitiveFunctions |
13716 | 33 |
sharedPools traitComposition localSelectors vGuid fGuid' |
13093 | 34 |
classVariableNames:'' |
35 |
poolDictionaries:'' |
|
36 |
privateIn:Class |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
37 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
38 |
|
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
39 |
Object subclass:#SimulatedClassPool |
13093 | 40 |
instanceVariableNames:'class' |
41 |
classVariableNames:'' |
|
42 |
poolDictionaries:'' |
|
43 |
privateIn:Class |
|
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
44 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
45 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
46 |
Association subclass:#SimulatedVariableBinding |
13093 | 47 |
instanceVariableNames:'' |
48 |
classVariableNames:'' |
|
49 |
poolDictionaries:'' |
|
50 |
privateIn:Class::SimulatedClassPool |
|
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
51 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
52 |
|
1739 | 53 |
!Class class methodsFor:'documentation'! |
68 | 54 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
55 |
copyright |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
56 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
57 |
COPYRIGHT (c) 1989 by Claus Gittinger |
13756 | 58 |
All Rights Reserved |
527
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 |
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
|
61 |
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
|
62 |
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
|
63 |
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
|
64 |
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
|
65 |
hereby transferred. |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
66 |
" |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
67 |
! |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
68 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
69 |
documentation |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
70 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
71 |
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
|
72 |
been defined in Behavior and ClassDescription; this adds naming, categories etc. |
68 | 73 |
|
1287 | 74 |
[Instance variables:] |
75 |
||
13756 | 76 |
name <Symbol> the classes name |
77 |
||
78 |
category <Symbol> the classes category |
|
79 |
||
80 |
classvars <String> the names of the class variables; |
|
81 |
| <Collection of words> initially, stc generates a string; this is converted on the fly |
|
82 |
to an array of names. In the future, stc may be changed. |
|
83 |
||
84 |
comment <String> the classes comment; either a string, |
|
85 |
a number specifying the offset in classFilename, or nil |
|
86 |
||
87 |
subclasses <Collection> cached collection of subclasses |
|
88 |
(not used for execution, but for the IDE to speed up certain operations) |
|
89 |
||
90 |
classFilename <String> the file (or nil) where the classes' sources are found |
|
91 |
||
92 |
package <Symbol> the package, in which the class was defined (inserted by compilers) |
|
93 |
||
94 |
revision <String> revision string - inserted by stc |
|
95 |
||
96 |
environment <Symbol | nil> cached environment (i.e. Smalltalk or a namespace) |
|
97 |
||
98 |
signature <SmallInteger> the classes signature (used to detect obsolete or changed classes with binaryStorage) |
|
99 |
This is filled in lazy - i.e. upon the first signature query. |
|
100 |
||
101 |
attributes <Array | nil> describes primitiveIncludes, primitiveFunctions etc. |
|
102 |
also a place to add additional attributes, 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
|
103 |
|
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
104 |
|
68 | 105 |
WARNING: layout known by compiler and runtime system |
1287 | 106 |
|
107 |
[author:] |
|
13756 | 108 |
Claus Gittinger |
1669 | 109 |
|
110 |
[see also:] |
|
13756 | 111 |
Behavior ClassDescription Metaclass |
68 | 112 |
" |
12014 | 113 |
! |
114 |
||
115 |
versionManagement |
|
116 |
" |
|
117 |
old scheme (up to 5.4.x): |
|
13756 | 118 |
the #version method is supposed to return a CVS (or RCS) version string. |
119 |
this string contains (among other info) the revision number of the CVS container |
|
120 |
from which the class was compiled. |
|
121 |
To access the source code of a class, this file is reconstructed (either cached or |
|
122 |
checked out), and the source-chunk is fetched from that file at the position which |
|
123 |
is stored in the method object. |
|
12014 | 124 |
|
125 |
new scheme (starting with 5.5.0): |
|
13756 | 126 |
a classes sourcecode might be present in multiple source code management systems; |
127 |
for example, a site might decide to use CVS, where another might wonna use SVN |
|
128 |
(or other in the future). |
|
129 |
Therefore, a single version method is no longer sufficient; each sourceCodeManager |
|
130 |
will store its version info in its own format in a separate version method. |
|
131 |
The sourceCodeManager can be asked via #nameOfVersionMethodInClasses for the selector |
|
132 |
of this version. |
|
133 |
Currently these are #version_CVS and #version_SVN. More might be added in the future. |
|
134 |
||
135 |
Two additional identifiers are added to support a unique id, which can be used to |
|
136 |
compare classes and methods coming from different source containers: |
|
137 |
version_VID and version_FID |
|
138 |
Both are UUID's. The VID is updated with every change, whereas the FID is assigned only once. |
|
139 |
The FID can be interpreted as a functional-ID, and the VID as an identity id. |
|
12014 | 140 |
" |
662 | 141 |
! ! |
68 | 142 |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
143 |
!Class class methodsFor:'accessing-flags'! |
362 | 144 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
145 |
tryLocalSourceFirst |
11952 | 146 |
"if true, local source files are tried first, before a sourceCodemanager is |
147 |
consulted. This may speed up the source access, but adds some insecurity, because |
|
148 |
the sourceCodemanager is always getting the source for the classes correct version. |
|
149 |
In contrast, the local file might be different from (edited in an external tool) in |
|
150 |
the meantime. You have been warned - better leave it false (the sourceCodemanager will |
|
151 |
fill its cache and eventually be just as fast...)" |
|
152 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
153 |
^ TryLocalSourceFirst |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
154 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
155 |
"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
|
156 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
157 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
158 |
tryLocalSourceFirst:aBoolean |
11952 | 159 |
"if true, local source files are tried first, before a sourceCodemanager is |
160 |
consulted. This may speed up the source access, but adds some insecurity, because |
|
161 |
the sourceCodemanager is always getting the source for the classes correct version. |
|
162 |
In contrast, the local file might be different from (edited in an external tool) in |
|
163 |
the meantime. You have been warned - better leave it false (the sourceCodemanager will |
|
164 |
fill its cache and eventually be just as fast...)" |
|
165 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
166 |
TryLocalSourceFirst := aBoolean |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
167 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
168 |
"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
|
169 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
170 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
171 |
updateChanges:aBoolean |
858 | 172 |
"turn on/off changes management. Return the prior value of the flag. |
8551 | 173 |
This value is used as a default fallback - a querySignal handler may still |
858 | 174 |
decide to return something else." |
362 | 175 |
|
176 |
|prev| |
|
177 |
||
555 | 178 |
prev := UpdatingChanges. |
179 |
UpdatingChanges := aBoolean. |
|
362 | 180 |
^ prev |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
181 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
182 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
183 |
updatingChanges |
858 | 184 |
"return true if changes are recorded. |
185 |
The value returned here is the default fallback - a querySignal handler may still |
|
186 |
decide to return something else." |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
187 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
188 |
^ UpdatingChanges |
1 | 189 |
! ! |
190 |
||
10474
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
191 |
!Class class methodsFor:'creating new classes'! |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
192 |
|
13756 | 193 |
name:newName |
194 |
subclassOf:aClass |
|
195 |
instanceVariableNames:stringOfInstVarNames |
|
196 |
category:categoryString |
|
10474
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
197 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
198 |
"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
|
199 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
200 |
^ self |
13756 | 201 |
name:newName |
202 |
subclassOf:aClass |
|
203 |
instanceVariableNames:stringOfInstVarNames |
|
204 |
classVariableNames:nil |
|
205 |
poolDictionaries:nil |
|
206 |
category:categoryString |
|
207 |
! |
|
208 |
||
209 |
name:newName |
|
210 |
subclassOf:aClass |
|
211 |
instanceVariableNames:stringOfInstVarNames |
|
212 |
classVariableNames:stringOfClassVarNames |
|
213 |
category:categoryString |
|
10474
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
214 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
215 |
"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
|
216 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
217 |
^ self |
13756 | 218 |
name:newName |
219 |
subclassOf:aClass |
|
220 |
instanceVariableNames:stringOfInstVarNames |
|
221 |
classVariableNames:stringOfClassVarNames |
|
222 |
poolDictionaries:nil |
|
223 |
category:categoryString |
|
224 |
! |
|
225 |
||
226 |
name:newName |
|
227 |
subclassOf:aClass |
|
228 |
instanceVariableNames:stringOfInstVarNames |
|
229 |
classVariableNames:stringOfClassVarNames |
|
230 |
classInstanceVariableNames:stringOfClassInstVarNames |
|
231 |
poolDictionaries:stringOfPoolNames |
|
232 |
category:categoryString |
|
10474
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
233 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
234 |
"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
|
235 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
236 |
^ self class |
13756 | 237 |
name:newName |
238 |
inEnvironment:Smalltalk |
|
239 |
subclassOf:aClass |
|
240 |
instanceVariableNames:stringOfInstVarNames |
|
241 |
variable:false |
|
242 |
words:false |
|
243 |
pointers:false |
|
244 |
classVariableNames:stringOfClassVarNames |
|
245 |
poolDictionaries:stringOfPoolNames |
|
246 |
category:categoryString |
|
247 |
comment:nil |
|
248 |
changed:false |
|
249 |
classInstanceVariableNames:stringOfClassInstVarNames |
|
10474
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
250 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
251 |
"Modified: 16.6.1997 / 11:53:58 / cg" |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
252 |
! |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
253 |
|
13756 | 254 |
name:newName |
255 |
subclassOf:aClass |
|
256 |
instanceVariableNames:stringOfInstVarNames |
|
257 |
classVariableNames:stringOfClassVarNames |
|
258 |
poolDictionaries:stringOfPoolNames |
|
259 |
category:categoryString |
|
10474
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
260 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
261 |
"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
|
262 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
263 |
^ self class |
13756 | 264 |
name:newName |
265 |
inEnvironment:Smalltalk |
|
266 |
subclassOf:aClass |
|
267 |
instanceVariableNames:stringOfInstVarNames |
|
268 |
variable:false |
|
269 |
words:false |
|
270 |
pointers:false |
|
271 |
classVariableNames:stringOfClassVarNames |
|
272 |
poolDictionaries:stringOfPoolNames |
|
273 |
category:categoryString |
|
274 |
comment:nil |
|
275 |
changed:false |
|
276 |
classInstanceVariableNames:nil |
|
10474
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
277 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
278 |
"Modified: 16.6.1997 / 11:53:58 / cg" |
13418 | 279 |
! |
280 |
||
281 |
undeclared: name |
|
282 |
||
283 |
" |
|
13756 | 284 |
Creates an 'undeclared' class, a placeholder for |
285 |
superclass when loading/filing-in a class whose |
|
286 |
superclass does not exists. |
|
13418 | 287 |
" |
288 |
Transcript showCR:'Smalltalk [info]: Declaring undeclared class: ', name. |
|
289 |
^Object subclass: name asSymbol |
|
13756 | 290 |
instanceVariableNames:'' |
291 |
classVariableNames:'' |
|
292 |
poolDictionaries:'' |
|
293 |
category:'* undeclared classes!! *' |
|
13418 | 294 |
|
295 |
"Created: / 08-11-2010 / 16:08:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10474
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
296 |
! ! |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
297 |
|
1739 | 298 |
!Class class methodsFor:'helpers'! |
620 | 299 |
|
12004 | 300 |
nameWithoutPrefix:name |
301 |
"helper for fileOut and others - return a name's printString, |
|
302 |
without any owningClass or nameSpace prefix" |
|
303 |
||
304 |
|idx| |
|
305 |
||
306 |
idx := name lastIndexOf:$:. |
|
307 |
[idx > 1 and:[ (name at:(idx-1)) ~~ $: ]] whileTrue:[ |
|
13756 | 308 |
idx := name lastIndexOf:$: startingAt:idx-2. |
12004 | 309 |
]. |
310 |
idx == 0 ifTrue:[ |
|
13756 | 311 |
^ name |
12004 | 312 |
]. |
313 |
||
314 |
^ name copyFrom:idx+1. |
|
315 |
||
316 |
"a public class: |
|
317 |
Class nameWithoutPrefix:'Array' |
|
318 |
Class nameWithoutPrefix:'Tools::Array' |
|
319 |
" |
|
320 |
! |
|
321 |
||
620 | 322 |
revisionInfoFromString:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
323 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
324 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
325 |
"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
|
326 |
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
|
327 |
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
|
328 |
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
|
329 |
its sourceCode manager." |
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
330 |
|
7754 | 331 |
|mgr| |
620 | 332 |
|
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
333 |
"/ |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
334 |
"/ mhmh - ask the default manager. |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
335 |
"/ 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
|
336 |
"/ |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
337 |
mgr := SourceCodeManager ? CVSSourceCodeManager. |
7754 | 338 |
"/ |
7755 | 339 |
"/ care for standAlone apps which have no CVS (libbasic3) included |
7754 | 340 |
"/ |
341 |
mgr isNil ifTrue:[ |
|
13759
60d609b1d5fb
changed: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
13756
diff
changeset
|
342 |
AbstractSourceCodeManager notNil ifTrue:[ |
60d609b1d5fb
changed: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
13756
diff
changeset
|
343 |
^ CVSVersionInfo fromRCSString:aString |
60d609b1d5fb
changed: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
13756
diff
changeset
|
344 |
]. |
60d609b1d5fb
changed: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
13756
diff
changeset
|
345 |
^ nil |
7754 | 346 |
]. |
347 |
^ mgr revisionInfoFromString:aString. |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
348 |
|
13759
60d609b1d5fb
changed: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
13756
diff
changeset
|
349 |
"Modified: / 29-09-2011 / 21:53:29 / cg" |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
350 |
! |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
351 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
352 |
revisionStringFromSource:aMethodSourceString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
353 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
354 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
355 |
"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
|
356 |
Caveat: Assumes CVS." |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
357 |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
358 |
|lines line| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
359 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
360 |
lines := aMethodSourceString asCollectionOfLines. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
361 |
lines do:[:l | |
13756 | 362 |
|i| |
363 |
||
364 |
i := l indexOfSubCollection:'$Header: '. |
|
13418 | 365 |
"JV @ 2009-12-13: Also search for '$Id: ' (because of SVN-only classes)" |
366 |
i == 0 ifTrue:[ |
|
367 |
i := l indexOfSubCollection:'$Id: ']. |
|
13756 | 368 |
i ~~ 0 ifTrue:[ |
369 |
line := l copyFrom:i. |
|
370 |
i := line lastIndexOf:$$. |
|
371 |
i > 1 ifTrue:[ |
|
372 |
line := line copyTo:i. |
|
373 |
]. |
|
374 |
^ line |
|
375 |
] |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
376 |
]. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
377 |
^ nil |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
378 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
379 |
"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
|
380 |
"Modified: / 22-10-2008 / 20:29:50 / cg" |
620 | 381 |
! ! |
382 |
||
3618
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
383 |
!Class class methodsFor:'misc'! |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
384 |
|
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
385 |
template:aCategoryString |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
386 |
"return a class-definition template" |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
387 |
|
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
388 |
^ 'NameOfSuperclass subclass:#NameOfClass |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
389 |
instanceVariableNames:''instVarName1 instVarName2'' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
390 |
classVariableNames:''classVarName1 classVarName2'' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
391 |
poolDictionaries:'''' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
392 |
category:''' , aCategoryString , '''' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
393 |
|
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
394 |
"Created: / 19.6.1998 / 02:09:06 / cg" |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
395 |
! ! |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
396 |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
397 |
!Class class methodsFor:'private'! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
398 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
399 |
flushSubclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
400 |
"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
|
401 |
by #subclassInfo. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
402 |
This is private protocol" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
403 |
|
13860 | 404 |
SubclassCacheSequenceNumber := (SubclassCacheSequenceNumber ? 0) + 1. |
405 |
||
406 |
"/ self allSubInstancesDo:[:cls | |
|
407 |
"/ cls flushSubclasses |
|
408 |
"/ ]. |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
409 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
410 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
411 |
Class flushSubclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
412 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
413 |
|
13861 | 414 |
"Modified: / 06-12-2011 / 16:20:13 / cg" |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
415 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
416 |
|
12507
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
417 |
flushSubclassInfoFor:aClass |
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
418 |
"throw away (forget) the cached subclass information for aClass, as created |
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
419 |
by #subclassInfo. |
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
420 |
This is private protocol" |
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
421 |
|
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
422 |
aClass notNil ifTrue:[ |
13861 | 423 |
aClass flushSubclasses |
12507
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
424 |
]. |
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
425 |
|
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
426 |
" |
12694 | 427 |
Class flushSubclassInfoFor:View |
12507
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
428 |
" |
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
429 |
|
13861 | 430 |
"Modified: / 06-12-2011 / 16:20:49 / cg" |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
431 |
! ! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
432 |
|
1739 | 433 |
!Class class methodsFor:'queries'! |
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
434 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
435 |
isBuiltInClass |
1266 | 436 |
"return true if this class is known by the run-time-system. |
437 |
Here, true is returned for myself, false for subclasses." |
|
438 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
439 |
^ self == Class class or:[self == Class] |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
440 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
441 |
"Created: 15.4.1996 / 17:17:13 / cg" |
1266 | 442 |
"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
|
443 |
! ! |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
444 |
|
13474 | 445 |
|
7261 | 446 |
!Class methodsFor:'Compatibility-Dolphin'! |
6823 | 447 |
|
448 |
defaultCategoryForDolphinClasses |
|
449 |
^ DefaultCategoryForDolphin ? 'Dolphin classes'. |
|
450 |
! |
|
451 |
||
13715 | 452 |
guid |
13716 | 453 |
^ self getAttribute:#fGuid |
13715 | 454 |
|
455 |
"Created: / 23-09-2011 / 10:24:44 / cg" |
|
456 |
! |
|
457 |
||
458 |
guid:aUUID |
|
13716 | 459 |
^ self setAttribute:#fGuid to:aUUID |
13715 | 460 |
|
461 |
"Created: / 23-09-2011 / 10:25:04 / cg" |
|
462 |
! |
|
463 |
||
11162 | 464 |
stb_version |
465 |
^ 0 |
|
466 |
! |
|
467 |
||
6823 | 468 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames |
469 |
"{ Pragma: +optSpace }" |
|
470 |
||
471 |
"this method allows fileIn of Dolphin classes " |
|
472 |
||
8551 | 473 |
^ self subclass:t |
13756 | 474 |
instanceVariableNames:f |
475 |
classVariableNames:d |
|
476 |
poolDictionaries:s |
|
477 |
category:(self defaultCategoryForDolphinClasses) |
|
478 |
classInstanceVariableNames:classInstanceVariableNames |
|
6823 | 479 |
|
480 |
"Modified: / 15.6.1998 / 21:31:34 / cg" |
|
481 |
"Modified: / 18.3.1999 / 18:16:11 / stefan" |
|
482 |
! |
|
483 |
||
484 |
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames |
|
485 |
"{ Pragma: +optSpace }" |
|
486 |
||
487 |
"this method allows fileIn of Dolphin classes " |
|
488 |
||
8551 | 489 |
^ self variableSubclass:t |
13756 | 490 |
instanceVariableNames:f |
491 |
classVariableNames:d |
|
492 |
poolDictionaries:s |
|
493 |
category:(self defaultCategoryForDolphinClasses) |
|
494 |
classInstanceVariableNames:classInstanceVariableNames |
|
6823 | 495 |
|
496 |
"Modified: / 15.6.1998 / 21:31:34 / cg" |
|
497 |
"Modified: / 18.3.1999 / 18:16:11 / stefan" |
|
498 |
! ! |
|
499 |
||
7261 | 500 |
!Class methodsFor:'Compatibility-ST/V and V''Age'! |
6225 | 501 |
|
502 |
defaultCategoryForSTVorVAGEClasses |
|
503 |
|cat app| |
|
504 |
||
505 |
DefaultApplicationQuerySignal isHandled ifTrue:[ |
|
14000
1b4fbb92d572
changed: #defaultCategoryForSTVorVAGEClasses
Claus Gittinger <cg@exept.de>
parents:
13999
diff
changeset
|
506 |
app := DefaultApplicationQuerySignal query. |
1b4fbb92d572
changed: #defaultCategoryForSTVorVAGEClasses
Claus Gittinger <cg@exept.de>
parents:
13999
diff
changeset
|
507 |
app notNil ifTrue:[ |
1b4fbb92d572
changed: #defaultCategoryForSTVorVAGEClasses
Claus Gittinger <cg@exept.de>
parents:
13999
diff
changeset
|
508 |
cat := "'Applications-' ," app nameWithoutPrefix. |
1b4fbb92d572
changed: #defaultCategoryForSTVorVAGEClasses
Claus Gittinger <cg@exept.de>
parents:
13999
diff
changeset
|
509 |
] ifFalse:[ |
1b4fbb92d572
changed: #defaultCategoryForSTVorVAGEClasses
Claus Gittinger <cg@exept.de>
parents:
13999
diff
changeset
|
510 |
cat := DefaultCategoryForVAGE ? 'V''Age classes'. |
1b4fbb92d572
changed: #defaultCategoryForSTVorVAGEClasses
Claus Gittinger <cg@exept.de>
parents:
13999
diff
changeset
|
511 |
]. |
6225 | 512 |
] ifFalse:[ |
14000
1b4fbb92d572
changed: #defaultCategoryForSTVorVAGEClasses
Claus Gittinger <cg@exept.de>
parents:
13999
diff
changeset
|
513 |
cat := DefaultCategoryForSTV ? 'ST/V classes'. |
6225 | 514 |
]. |
515 |
||
516 |
^ cat |
|
14000
1b4fbb92d572
changed: #defaultCategoryForSTVorVAGEClasses
Claus Gittinger <cg@exept.de>
parents:
13999
diff
changeset
|
517 |
|
1b4fbb92d572
changed: #defaultCategoryForSTVorVAGEClasses
Claus Gittinger <cg@exept.de>
parents:
13999
diff
changeset
|
518 |
"Modified: / 07-02-2012 / 17:40:35 / cg" |
6225 | 519 |
! |
520 |
||
9178
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
521 |
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
|
522 |
"{ Pragma: +optSpace }" |
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
523 |
|
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
524 |
"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
|
525 |
|
13756 | 526 |
^ self |
527 |
subclass:nm |
|
528 |
instanceVariableNames:iV |
|
529 |
classVariableNames:cV |
|
530 |
poolDictionaries:p |
|
531 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
532 |
classInstanceVariableNames:cIV |
|
9178
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
533 |
! |
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
534 |
|
6225 | 535 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s |
536 |
"{ Pragma: +optSpace }" |
|
537 |
||
8551 | 538 |
"this method allows fileIn of ST/V and V'Age classes |
6225 | 539 |
(which seem to have no category)" |
540 |
||
13756 | 541 |
^ self |
542 |
subclass:t |
|
543 |
instanceVariableNames:f |
|
544 |
classVariableNames:d |
|
545 |
poolDictionaries:s |
|
546 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 547 |
|
548 |
"Modified: / 15.6.1998 / 21:31:34 / cg" |
|
549 |
"Modified: / 18.3.1999 / 18:16:11 / stefan" |
|
550 |
! |
|
551 |
||
552 |
variableByteSubclass:t classVariableNames:d poolDictionaries:s |
|
553 |
"{ Pragma: +optSpace }" |
|
554 |
||
8551 | 555 |
"this method allows fileIn of ST/V and V'Age variable byte classes |
6225 | 556 |
(which seem to have no category and no instvars)" |
557 |
||
8551 | 558 |
^ self variableByteSubclass:t |
13756 | 559 |
instanceVariableNames:'' |
560 |
classVariableNames:d |
|
561 |
poolDictionaries:s |
|
562 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 563 |
|
564 |
"Modified: / 15.6.1998 / 21:31:38 / cg" |
|
565 |
"Modified: / 18.3.1999 / 18:16:21 / stefan" |
|
566 |
! |
|
567 |
||
568 |
variableLongSubclass:t classVariableNames:d poolDictionaries:s |
|
569 |
"{ Pragma: +optSpace }" |
|
570 |
||
8551 | 571 |
"this method allows fileIn of ST/V and V'Age variable long (32bit integers) classes |
6225 | 572 |
(which seem to have no category and no instvars)" |
573 |
||
8551 | 574 |
^ self variableLongSubclass:t |
13756 | 575 |
instanceVariableNames:'' |
576 |
classVariableNames:d |
|
577 |
poolDictionaries:s |
|
578 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 579 |
! |
580 |
||
581 |
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s |
|
582 |
"{ Pragma: +optSpace }" |
|
583 |
||
8551 | 584 |
"this method allows fileIn of ST/V and V'Age variable pointer classes |
6225 | 585 |
(which seem to have no category)" |
586 |
||
8551 | 587 |
^ self variableSubclass:t |
13756 | 588 |
instanceVariableNames:f |
589 |
classVariableNames:d |
|
590 |
poolDictionaries:s |
|
591 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 592 |
|
593 |
"Modified: / 15.6.1998 / 21:31:41 / cg" |
|
594 |
"Modified: / 18.3.1999 / 18:16:33 / stefan" |
|
595 |
! |
|
596 |
||
597 |
variableWordSubclass:t classVariableNames:d poolDictionaries:s |
|
598 |
"{ Pragma: +optSpace }" |
|
599 |
||
8551 | 600 |
"this method allows fileIn of ST/V and V'Age variable word (16bit integers) classes |
6225 | 601 |
(which seem to have no category and no instvars)" |
602 |
||
8551 | 603 |
^ self variableWordSubclass:t |
13756 | 604 |
instanceVariableNames:'' |
605 |
classVariableNames:d |
|
606 |
poolDictionaries:s |
|
607 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 608 |
! ! |
609 |
||
7261 | 610 |
!Class methodsFor:'Compatibility-ST80'! |
5190 | 611 |
|
612 |
fileOutSourceOn:aStream |
|
613 |
self fileOutOn:aStream withTimeStamp:false |
|
614 |
||
615 |
"Created: 20.6.1997 / 17:18:14 / cg" |
|
616 |
"Modified: 20.6.1997 / 17:18:26 / cg" |
|
617 |
! |
|
618 |
||
6723 | 619 |
rename:newName |
620 |
"same as renameTo: - for ST80 compatibility" |
|
621 |
||
622 |
^ Smalltalk renameClass:self to:newName. |
|
623 |
"/ ^ self renameTo:newName |
|
624 |
||
625 |
"Created: / 18.6.1998 / 22:08:45 / cg" |
|
626 |
! ! |
|
627 |
||
13507
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
628 |
|
1 | 629 |
!Class methodsFor:'accessing'! |
630 |
||
6731 | 631 |
addChangeRecordForClass:aClass andNotifyChangeOf:aspect |
632 |
"writes a change record and notifies dependents." |
|
633 |
||
634 |
|namespace| |
|
635 |
||
636 |
self addChangeRecordForClass:aClass. |
|
637 |
||
638 |
aClass changed:#definition. |
|
639 |
||
640 |
namespace := aClass nameSpace. |
|
641 |
namespace changed:#classDefinition with:aClass. |
|
642 |
namespace ~~ Smalltalk ifTrue:[ |
|
13756 | 643 |
Smalltalk changed:#classDefinition with:aClass. |
6731 | 644 |
]. |
645 |
namespace changed:aspect with:aClass. |
|
646 |
namespace ~~ Smalltalk ifTrue:[ |
|
13756 | 647 |
Smalltalk changed:aspect with:aClass. |
6731 | 648 |
]. |
649 |
! |
|
650 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
651 |
addClassVarName:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
652 |
"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
|
653 |
Also writes a change record and notifies dependents." |
555 | 654 |
|
13209 | 655 |
self addClassVarNames:(Array with:aString). |
656 |
||
657 |
"Created: / 29-10-1995 / 19:40:51 / cg" |
|
658 |
"Modified: / 23-01-1998 / 15:46:23 / stefan" |
|
659 |
"Modified: / 15-01-2011 / 14:17:41 / cg" |
|
660 |
! |
|
661 |
||
662 |
addClassVarNames:aCollectionOfStrings |
|
663 |
"add a number of class variables if not already there and initialize them with nil. |
|
664 |
Also writes a change record and notifies dependents." |
|
665 |
||
666 |
|newVariables| |
|
667 |
||
668 |
newVariables := aCollectionOfStrings reject:[:each | self classVarNames includes:each]. |
|
669 |
newVariables isEmpty ifTrue:[^ self]. |
|
670 |
||
671 |
newVariables := newVariables collect:[:each | each asSymbol]. |
|
672 |
self classVariableString:(self classVariableString , ' ' , (newVariables asStringWith:' ')). |
|
673 |
Class withoutUpdatingChangesDo:[ |
|
13756 | 674 |
self withAllSubclasses do:[:cls| |
675 |
cls recompileMethodsAccessingAnyClassvarOrGlobal:newVariables |
|
676 |
]. |
|
13209 | 677 |
]. |
678 |
self addChangeRecordForClass:self andNotifyChangeOf:#classVariables. |
|
679 |
||
680 |
"Modified: / 23-01-1998 / 15:46:23 / stefan" |
|
681 |
"Created: / 15-01-2011 / 14:17:21 / cg" |
|
555 | 682 |
! |
683 |
||
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
684 |
allPrivateClasses |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
685 |
"{ Pragma: +optSpace }" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
686 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
687 |
"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
|
688 |
The classes are in any order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
689 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
690 |
^ self privateClassesOrAll:true |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
691 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
692 |
! |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
693 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
694 |
category |
8551 | 695 |
"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
|
696 |
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
|
697 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
698 |
|owner| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
699 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
700 |
(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
|
701 |
^ category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
702 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
703 |
" |
8551 | 704 |
Point category |
705 |
Dictionary category |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
706 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
707 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
708 |
"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
|
709 |
"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
|
710 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
711 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
712 |
category:aStringOrSymbol |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
713 |
"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
|
714 |
|
7579
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
715 |
|ns| |
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
716 |
|
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
717 |
self setCategory:aStringOrSymbol. |
10195
2484228d4c95
the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents:
10184
diff
changeset
|
718 |
self addChangeRecordForClass:self. |
7579
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
719 |
ns := self nameSpace. |
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
720 |
ns changed:#organization. |
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
721 |
ns ~~ Smalltalk ifTrue:[ |
13756 | 722 |
Smalltalk changed:#organization. |
7579
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
723 |
] |
10195
2484228d4c95
the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents:
10184
diff
changeset
|
724 |
|
2484228d4c95
the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents:
10184
diff
changeset
|
725 |
"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
|
726 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
727 |
|
10078 | 728 |
classBaseFilename |
729 |
"return the baseName of the file from which the class was compiled. |
|
730 |
In contrast to classFilename, this will always be a plain basename." |
|
731 |
||
732 |
^ self classFilename asFilename baseName |
|
733 |
||
734 |
" |
|
735 |
Math::ClosedInterval classFilename |
|
736 |
" |
|
737 |
||
738 |
"Created: / 12-10-2006 / 15:49:32 / cg" |
|
739 |
! |
|
740 |
||
12018
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
741 |
classFilename |
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
742 |
"return the name of the file from which the class was compiled. |
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
743 |
If the class was loaded via an explicit load (i.e. from the fileBrowser), |
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
744 |
this will be an absolute path. Oherwise, it will be a basename only. |
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
745 |
See classBaseFilename for a method which always returns the basename." |
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
746 |
|
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
747 |
|owner info fn| |
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
748 |
|
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
749 |
(owner := self owningClass) notNil ifTrue:[^ owner classFilename]. |
12020 | 750 |
|
12303 | 751 |
"/ This was added as an extension of libsvn - should be no longer needed |
752 |
"/ compatQuery := Smalltalk classNamed: 'SVN::CompatModeQuery'. |
|
13756 | 753 |
"/ (compatQuery notNil |
754 |
"/ and:[compatQuery isLoaded |
|
12303 | 755 |
"/ and:[(compatQuery query ? true) not]]) |
756 |
"/ ifTrue:[^SVN::Repository containerNameForClass: self]. |
|
12020 | 757 |
|
12018
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
758 |
classFilename notNil ifTrue:[ ^ classFilename ]. |
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
759 |
|
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
760 |
(info := self revisionInfo) notNil ifTrue:[ |
13756 | 761 |
fn := info fileName. |
762 |
fn notNil ifTrue:[ |
|
763 |
^ fn |
|
764 |
]. |
|
12018
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
765 |
]. |
12303 | 766 |
^ (Smalltalk fileNameForClass:self), '.', self sourceFileSuffix |
12018
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
767 |
|
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
768 |
" |
13756 | 769 |
SVN::Repository classFilename |
770 |
Array classFilename |
|
12018
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
771 |
" |
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
772 |
|
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
773 |
"Modified: / 22-10-2008 / 20:58:21 / cg" |
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
774 |
! |
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
775 |
|
8561
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
776 |
classPool |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
777 |
"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
|
778 |
#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
|
779 |
|
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
780 |
^ SimulatedClassPool new setClass:self |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
781 |
|
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
782 |
" |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
783 |
Button classPool |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
784 |
" |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
785 |
|
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
786 |
"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
|
787 |
! |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
788 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
789 |
classVarAt:aSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
790 |
"return the value of a class variable. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
791 |
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
|
792 |
this may change." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
793 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
794 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
795 |
this hides the (current) implementation of classVariables |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
796 |
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
|
797 |
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
|
798 |
no classPools yet. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
799 |
" |
6731 | 800 |
^ Smalltalk at:(self globalKeyForClassVar:aSymbol) |
557
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 |
|
5707
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
803 |
classVarAt:aSymbol ifAbsent:exceptionBlock |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
804 |
"return the value of a class variable. |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
805 |
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
|
806 |
this may change." |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
807 |
|
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
808 |
" |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
809 |
this hides the (current) implementation of classVariables |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
810 |
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
|
811 |
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
|
812 |
no classPools yet. |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
813 |
" |
6731 | 814 |
^ Smalltalk at:(self globalKeyForClassVar:aSymbol) ifAbsent:exceptionBlock |
5707
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
815 |
! |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
816 |
|
13106
f2f4b6db778c
comment/format in: #classVarAt:put:
Claus Gittinger <cg@exept.de>
parents:
13093
diff
changeset
|
817 |
classVarAt:aSymbolOrString put:something |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
818 |
"store something in a classvariable. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
819 |
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
|
820 |
classVar exists - this may change." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
821 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
822 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
823 |
this hides the (current) implementation of classVariables |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
824 |
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
|
825 |
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
|
826 |
no classPools yet. |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
827 |
" |
13106
f2f4b6db778c
comment/format in: #classVarAt:put:
Claus Gittinger <cg@exept.de>
parents:
13093
diff
changeset
|
828 |
Smalltalk at:(self globalKeyForClassVar:aSymbolOrString) put:something. |
f2f4b6db778c
comment/format in: #classVarAt:put:
Claus Gittinger <cg@exept.de>
parents:
13093
diff
changeset
|
829 |
|
f2f4b6db778c
comment/format in: #classVarAt:put:
Claus Gittinger <cg@exept.de>
parents:
13093
diff
changeset
|
830 |
"Modified: / 27-10-2010 / 16:35:17 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
831 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
832 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
833 |
classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
834 |
"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
|
835 |
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
|
836 |
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
|
837 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
838 |
classvars isNil ifTrue:[ |
13756 | 839 |
^ #() |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
840 |
]. |
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
841 |
classvars isString ifTrue:[ |
13756 | 842 |
classvars := classvars asCollectionOfWords collect:[:varName| varName asSymbol] as:Array. |
843 |
^ classvars |
|
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
844 |
]. |
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
845 |
|
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
846 |
^ classvars |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
847 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
848 |
" |
8551 | 849 |
Object classVarNames |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
850 |
Float classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
851 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
852 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
853 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
854 |
classVariableString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
855 |
"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
|
856 |
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
|
857 |
returned string." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
858 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
859 |
classvars isNil ifTrue:[^ '']. |
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
860 |
classvars isString ifTrue:[ |
13756 | 861 |
^ classvars |
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
862 |
]. |
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
863 |
|
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
864 |
^ classvars asStringWith:(Character space) |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
865 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
866 |
" |
8551 | 867 |
Object classVariableString |
868 |
Float classVariableString |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
869 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
870 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
871 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
872 |
classVariableString:aString |
8551 | 873 |
"set the classes classvarnames string; |
874 |
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
|
875 |
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
|
876 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
877 |
|prevVarNames varNames any| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
878 |
|
7517 | 879 |
(aString ~= self classVariableString) ifTrue:[ |
13756 | 880 |
prevVarNames := self classVarNames asOrderedCollection. |
881 |
classvars := aString. |
|
882 |
varNames := self classVarNames. |
|
883 |
||
884 |
"new ones get initialized to nil; |
|
885 |
- old ones are nilled and removed from Smalltalk" |
|
886 |
any := false. |
|
887 |
||
888 |
varNames do:[:aName | |
|
889 |
(prevVarNames includes:aName) ifFalse:[ |
|
890 |
"a new one" |
|
891 |
self classVarAt:aName put:nil. |
|
892 |
any := true. |
|
893 |
] ifTrue:[ |
|
894 |
prevVarNames remove:aName |
|
895 |
] |
|
896 |
]. |
|
897 |
"left overs are gone" |
|
898 |
prevVarNames do:[:aName | |
|
899 |
any := true. |
|
900 |
self classVarAt:aName put:nil. |
|
901 |
Smalltalk removeKey:(self globalKeyForClassVar:aName). |
|
902 |
]. |
|
903 |
any ifTrue:[ |
|
904 |
Smalltalk changed:#classVariables with:self |
|
905 |
]. |
|
453 | 906 |
] |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
907 |
|
10184 | 908 |
"Modified: / 02-04-1997 / 00:16:05 / stefan" |
909 |
"Modified: / 18-11-2006 / 17:13:14 / cg" |
|
453 | 910 |
! |
911 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
912 |
comment |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
913 |
"return the comment (aString) of the class" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
914 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
915 |
|stream string| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
916 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
917 |
"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
|
918 |
position within the classes sourcefile ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
919 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
920 |
comment isNumber ifTrue:[ |
13756 | 921 |
classFilename notNil ifTrue:[ |
922 |
stream := self sourceStream. |
|
923 |
stream notNil ifTrue:[ |
|
924 |
stream position1Based:comment. |
|
925 |
string := String readFrom:stream onError:''. |
|
926 |
stream close. |
|
927 |
^ string |
|
928 |
]. |
|
929 |
^ nil |
|
930 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
931 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
932 |
^ comment |
555 | 933 |
|
934 |
" |
|
8551 | 935 |
Object comment |
7054
685d359f9847
code rewritten to be independent of stream zero-base
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
936 |
RunArray comment |
555 | 937 |
" |
938 |
! |
|
939 |
||
7128 | 940 |
comment:aStringOrNil |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
941 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
942 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
943 |
"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
|
944 |
create a change record and notify dependents." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
945 |
|
865
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
946 |
|oldComment newComment| |
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
947 |
|
7128 | 948 |
newComment := aStringOrNil. |
949 |
(aStringOrNil notNil and:[aStringOrNil withoutSeparators isEmpty]) ifTrue:[ |
|
13756 | 950 |
newComment := nil |
865
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
951 |
]. |
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
952 |
comment ~= newComment ifTrue:[ |
13756 | 953 |
oldComment := self comment. |
954 |
comment := newComment. |
|
955 |
self addChangeRecordForClassComment:self. |
|
956 |
self changed:#comment with:oldComment. |
|
957 |
Smalltalk changed:#classComment with:self. |
|
555 | 958 |
] |
959 |
! |
|
960 |
||
2444 | 961 |
environment |
962 |
"return the namespace I am contained in; ST-80 compatible name" |
|
963 |
||
964 |
^ self nameSpace |
|
965 |
! |
|
966 |
||
11866 | 967 |
generateClassFilename |
968 |
"generate the expected filename for this class - without suffix. |
|
969 |
This may be different from the actual classFilename" |
|
970 |
||
971 |
^ self theNonMetaclass name copyReplaceAll:$: with:$_ |
|
972 |
||
973 |
" |
|
974 |
Complex generateClassFilename |
|
975 |
HTML::AbstractElement generateClassFilename |
|
976 |
" |
|
977 |
||
978 |
"Modified: / 06-10-2006 / 16:16:01 / cg" |
|
979 |
! |
|
980 |
||
9497 | 981 |
getClassFilename |
10050 | 982 |
"return the name of the file from which the class was compiled. |
983 |
If the class was loaded via an explicit load (i.e. from the fileBrowser), |
|
984 |
this will be an absolute path. Oherwise, it will be a basename only." |
|
9497 | 985 |
|
986 |
|owner| |
|
987 |
||
10050 | 988 |
(owner := self owningClass) notNil ifTrue:[^ owner getClassFilename]. |
9497 | 989 |
^ classFilename |
10050 | 990 |
|
991 |
"Modified: / 06-10-2006 / 13:32:01 / cg" |
|
9497 | 992 |
! |
993 |
||
9693
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
994 |
getPackage |
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
995 |
"get the package or nil." |
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
996 |
|
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
997 |
^ package |
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
998 |
! |
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
999 |
|
6731 | 1000 |
globalKeyForClassVar:aStringOrSymbol |
1001 |
"this helps to encapsulate the (current) implementation of classVariables |
|
1002 |
from the outside world. Currently, classvars are stored in |
|
1003 |
the Smalltalk dictionary with a funny name, since there are |
|
1004 |
no classPools yet. |
|
1005 |
" |
|
10184 | 1006 |
^ (self theNonMetaclass name , ':' , aStringOrSymbol) asSymbol |
1007 |
||
1008 |
"Modified: / 18-11-2006 / 17:13:39 / cg" |
|
6731 | 1009 |
! |
1010 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
1011 |
name |
8551 | 1012 |
"return the name of the class. |
6657 | 1013 |
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
|
1014 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
1015 |
^ name |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
1016 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
1017 |
"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
|
1018 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
1019 |
|
1919 | 1020 |
nameSpace |
2070
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
1021 |
"return the namespace I am contained in; |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
1022 |
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
|
1023 |
for public classes, Smalltalk is returned." |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
1024 |
|
7321 | 1025 |
|idx nsName e| |
1026 |
||
1027 |
"/ cached in environment |
|
1028 |
environment isNil ifTrue:[ |
|
13756 | 1029 |
e := Smalltalk. "/ default |
1030 |
||
1031 |
name notNil ifTrue:[ |
|
1032 |
"/ due to the implementation, extract this from my name |
|
1033 |
"/ (physically, all classes are found in Smalltalk) |
|
1034 |
||
1035 |
idx := name lastIndexOf:$:. |
|
1036 |
idx ~~ 0 ifTrue:[ |
|
1037 |
(name at:idx-1) == $: ifTrue:[ |
|
1038 |
nsName := name copyTo:(idx - 2). |
|
1039 |
e := Smalltalk at:nsName asSymbol. |
|
1040 |
] |
|
1041 |
]. |
|
1042 |
]. |
|
1043 |
environment := e. |
|
1919 | 1044 |
]. |
2493
ba34c6aac597
cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents:
2491
diff
changeset
|
1045 |
^ environment |
ba34c6aac597
cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents:
2491
diff
changeset
|
1046 |
|
3661 | 1047 |
"Modified: / 20.7.1998 / 14:21:36 / cg" |
1919 | 1048 |
! |
1049 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1050 |
package |
12361
58f46d1d341b
removed the obsolete #packageInfo
Claus Gittinger <cg@exept.de>
parents:
12308
diff
changeset
|
1051 |
"return the package-ID-Symbol of the class." |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1052 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1053 |
|owner| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1054 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1055 |
(owner := self owningClass) notNil ifTrue:[^ owner package]. |
12219
dd55372693c1
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
12197
diff
changeset
|
1056 |
package isNil ifTrue:[^ PackageId noProjectID]. |
9693
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
1057 |
^ package |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1058 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1059 |
" |
8551 | 1060 |
Object package |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1061 |
" |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1062 |
|
3951 | 1063 |
"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
|
1064 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1065 |
|
9494 | 1066 |
package:aSymbol |
12361
58f46d1d341b
removed the obsolete #packageInfo
Claus Gittinger <cg@exept.de>
parents:
12308
diff
changeset
|
1067 |
"set the package-ID.Symbol of the class." |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1068 |
|
9724 | 1069 |
|newPackage oldPackage| |
1070 |
||
12219
dd55372693c1
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
12197
diff
changeset
|
1071 |
aSymbol == PackageId noProjectID ifTrue:[ |
13756 | 1072 |
newPackage := nil |
9693
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
1073 |
] ifFalse:[ |
13756 | 1074 |
newPackage := aSymbol |
9724 | 1075 |
]. |
1076 |
package ~= newPackage ifTrue:[ |
|
13756 | 1077 |
oldPackage := package. |
1078 |
package := newPackage. |
|
1079 |
||
1080 |
self changed:#package. |
|
1081 |
Smalltalk changed:#projectOrganization with:(Array with:self with:oldPackage). |
|
9724 | 1082 |
]. |
9494 | 1083 |
|
1084 |
"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
|
1085 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1086 |
|
13188 | 1087 |
poolDictionaries |
1088 |
"this returns the concatenated pool name string" |
|
1089 |
||
13214 | 1090 |
^ self sharedPoolNames asStringWith:' ' |
1091 |
||
1092 |
"Modified: / 18-01-2011 / 17:56:12 / cg" |
|
13188 | 1093 |
! |
1094 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1095 |
primitiveDefinitions:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1096 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1097 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1098 |
"set the primitiveDefinition string" |
555 | 1099 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1100 |
(self isPrivate) ifTrue:[ |
13756 | 1101 |
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
|
1102 |
]. |
5800
a4386f928cf0
setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents:
5770
diff
changeset
|
1103 |
self setPrimitiveDefinitions:aString. |
555 | 1104 |
self addChangeRecordForPrimitiveDefinitions:self. |
1105 |
||
1106 |
"Created: 29.10.1995 / 19:41:39 / cg" |
|
1107 |
! |
|
1108 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1109 |
primitiveDefinitionsString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1110 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1111 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1112 |
"return the primitiveDefinition string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1113 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1114 |
|owner| |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1115 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1116 |
(owner := self owningClass) notNil ifTrue:[ |
13756 | 1117 |
^ owner primitiveDefinitionsString |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1118 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1119 |
^ self getSourceChunkAttribute:#primitiveDefinitions |
555 | 1120 |
|
1121 |
" |
|
8551 | 1122 |
Object primitiveDefinitionsString |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1123 |
String primitiveDefinitionsString |
555 | 1124 |
" |
1125 |
! |
|
1126 |
||
5875 | 1127 |
primitiveDefinitionsStringOrDefault |
1128 |
"return the primitiveDefinition string or a default" |
|
1129 |
||
1130 |
^ self primitiveDefinitionsString ? '%{ |
|
1131 |
||
1132 |
/* |
|
1133 |
* includes, defines, structure definitions |
|
1134 |
* and typedefs come here. |
|
1135 |
*/ |
|
1136 |
||
1137 |
%}' |
|
1138 |
||
1139 |
" |
|
1140 |
Object primitiveDefinitionsStringOrDefault |
|
1141 |
String primitiveDefinitionsStringOrDefault |
|
1142 |
ExternalStream primitiveDefinitionsStringOrDefault |
|
1143 |
" |
|
1144 |
! |
|
1145 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1146 |
primitiveFunctions:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1147 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1148 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1149 |
"set the primitiveFunction string" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1150 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1151 |
(self isPrivate) ifTrue:[ |
13756 | 1152 |
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
|
1153 |
]. |
5800
a4386f928cf0
setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents:
5770
diff
changeset
|
1154 |
self setPrimitiveFunctions:aString. |
555 | 1155 |
self addChangeRecordForPrimitiveFunctions:self. |
1156 |
||
1157 |
"Created: 29.10.1995 / 19:41:48 / cg" |
|
1158 |
! |
|
1159 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1160 |
primitiveFunctionsString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1161 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1162 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1163 |
"return the primitiveFunctions string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1164 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1165 |
|owner| |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1166 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1167 |
(owner := self owningClass) notNil ifTrue:[ |
13756 | 1168 |
^ owner primitiveFunctionsString |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1169 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1170 |
^ self getSourceChunkAttribute:#primitiveFunctions |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1171 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1172 |
|
5875 | 1173 |
primitiveFunctionsStringOrDefault |
1174 |
"return the primitiveFunction string or a default" |
|
1175 |
||
1176 |
^ self primitiveFunctionsString ? '%{ |
|
1177 |
||
8551 | 1178 |
/* |
5875 | 1179 |
* any local C (helper) functions |
1180 |
* come here (please, define as static) |
|
1181 |
*/ |
|
1182 |
||
1183 |
%}' |
|
1184 |
||
1185 |
" |
|
1186 |
Object primitiveFunctionsStringOrDefault |
|
1187 |
String primitiveFunctionsStringOrDefault |
|
1188 |
ExternalStream primitiveFunctionsStringOrDefault |
|
1189 |
" |
|
1190 |
! |
|
1191 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1192 |
primitiveVariables:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1193 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1194 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1195 |
"set the primitiveVariable string" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1196 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1197 |
(self isPrivate) ifTrue:[ |
13756 | 1198 |
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
|
1199 |
]. |
5800
a4386f928cf0
setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents:
5770
diff
changeset
|
1200 |
self setPrimitiveVariables:aString. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1201 |
self addChangeRecordForPrimitiveVariables:self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1202 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1203 |
"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
|
1204 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1205 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1206 |
primitiveVariablesString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1207 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1208 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1209 |
"return the primitiveVariables string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1210 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1211 |
|owner| |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1212 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1213 |
(owner := self owningClass) notNil ifTrue:[ |
13756 | 1214 |
^ owner primitiveVariablesString |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1215 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1216 |
^ self getSourceChunkAttribute:#primitiveVariables |
555 | 1217 |
! |
1218 |
||
5875 | 1219 |
primitiveVariablesStringOrDefault |
1220 |
"return the primitiveVariable string or a default" |
|
1221 |
||
1222 |
^ self primitiveVariablesString ? '%{ |
|
1223 |
||
8551 | 1224 |
/* |
5875 | 1225 |
* any local C variables |
1226 |
* come here (please, define as static) |
|
1227 |
*/ |
|
1228 |
||
1229 |
%}' |
|
1230 |
||
1231 |
" |
|
1232 |
Object primitiveVariablesStringOrDefault |
|
1233 |
String primitiveVariablesStringOrDefault |
|
1234 |
ExternalStream primitiveVariablesStringOrDefault |
|
1235 |
" |
|
1236 |
! |
|
1237 |
||
11137 | 1238 |
privateClassNamed:aClassNameStringOrSymbol |
1239 |
^ self privateClassesAt:aClassNameStringOrSymbol |
|
1240 |
! |
|
1241 |
||
1739 | 1242 |
privateClasses |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1243 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1244 |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1245 |
"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
|
1246 |
The classes are in any order." |
1739 | 1247 |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1248 |
^ self privateClassesOrAll:false |
1739 | 1249 |
|
1250 |
" |
|
1251 |
Object privateClasses |
|
8551 | 1252 |
ObjectMemory privateClasses |
1253 |
UILayoutTool privateClasses |
|
1739 | 1254 |
" |
1255 |
||
3495
31ae10035c74
skip obsolete leftover private classes when enumerating.
Claus Gittinger <cg@exept.de>
parents:
3494
diff
changeset
|
1256 |
"Modified: / 29.5.1998 / 23:23:18 / cg" |
1739 | 1257 |
! |
1258 |
||
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1259 |
privateClassesAt:aClassNameStringOrSymbol |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1260 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1261 |
|
1707 | 1262 |
"return a private class if present; nil otherwise" |
1263 |
||
8726 | 1264 |
|myName nmSym| |
1265 |
||
1266 |
myName := self name. |
|
1267 |
myName isNil ifTrue:[ |
|
13756 | 1268 |
"/ no name - there cannot be a corresponding private class |
1269 |
^ nil |
|
8726 | 1270 |
]. |
1271 |
nmSym := (myName , '::' , aClassNameStringOrSymbol) asSymbolIfInterned. |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
1272 |
nmSym isNil ifTrue:[ |
13756 | 1273 |
"/ no such symbol - there cannot be a corresponding private class |
1274 |
^ nil |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
1275 |
]. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
1276 |
|
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1277 |
^ Smalltalk at:nmSym. |
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1278 |
|
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1279 |
"Modified: 26.6.1997 / 11:44:04 / cg" |
1707 | 1280 |
! |
1281 |
||
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1282 |
privateClassesAt:aClassNameStringOrSymbol put:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1283 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1284 |
|
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1285 |
"add a private class" |
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1286 |
|
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1287 |
self classVarAt:(':' , aClassNameStringOrSymbol) put:aClass |
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1288 |
|
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1289 |
"Modified: 26.6.1997 / 11:44:12 / cg" |
1707 | 1290 |
! |
1291 |
||
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1292 |
privateClassesOrAll:allOfThem |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1293 |
"{ Pragma: +optSpace }" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1294 |
|
4495
4804e3e33d76
tuned #privateClasses access
Claus Gittinger <cg@exept.de>
parents:
4400
diff
changeset
|
1295 |
"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
|
1296 |
or direct plus indirect private classes (if allOfThem). |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1297 |
An empty collection if there are none. |
13507
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1298 |
The classes are in no particular order." |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1299 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1300 |
|classes myName myNamePrefix myNamePrefixLen| |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1301 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1302 |
myName := self name. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1303 |
myNamePrefix := myName , '::'. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1304 |
myNamePrefixLen := myNamePrefix size. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1305 |
|
4575 | 1306 |
Smalltalk keysDo:[:nm | |
13756 | 1307 |
|cls| |
1308 |
||
1309 |
(nm startsWith:myNamePrefix) ifTrue:[ |
|
1310 |
(allOfThem |
|
1311 |
or:[(nm indexOf:$: startingAt:myNamePrefixLen + 1) == 0]) ifTrue:[ |
|
1312 |
cls := Smalltalk at:nm. |
|
1313 |
||
1314 |
(cls isBehavior and:[cls isMeta not]) ifTrue:[ |
|
1315 |
classes isNil ifTrue:[ |
|
1316 |
classes := Set new:10. |
|
1317 |
]. |
|
1318 |
classes add:cls. |
|
1319 |
] |
|
1320 |
] |
|
1321 |
] |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1322 |
]. |
4575 | 1323 |
|
4578 | 1324 |
^ classes ? #() |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1325 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1326 |
" |
8551 | 1327 |
UILayoutTool privateClassesOrAll:true |
1328 |
UILayoutTool privateClassesOrAll:false |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1329 |
" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1330 |
|
13507
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1331 |
"Modified: / 29-05-1998 / 23:23:18 / cg" |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1332 |
"Modified (comment): / 18-07-2011 / 09:15:39 / cg" |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1333 |
! |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1334 |
|
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1335 |
privateClassesSorted |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1336 |
"{ Pragma: +optSpace }" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1337 |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1338 |
"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
|
1339 |
The classes are sorted by inheritance." |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1340 |
|
7894 | 1341 |
|classes pivateClassesOf| |
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1342 |
|
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1343 |
classes := self privateClasses. |
14146 | 1344 |
classes notEmpty ifTrue:[ |
1345 |
classes := classes asOrderedCollection. |
|
1346 |
classes sort:[:a :b | a name < b name]. |
|
1347 |
||
1348 |
pivateClassesOf := IdentityDictionary new. |
|
1349 |
classes do:[:each | pivateClassesOf at:each put:(each allPrivateClasses)]. |
|
1350 |
||
1351 |
classes topologicalSort:[:a :b | |
|
1352 |
"/ a must come before b iff: |
|
1353 |
"/ b is a subclass of a |
|
1354 |
"/ b has a private class which is a subclass of a |
|
1355 |
||
1356 |
|mustComeBefore pivateClassesOfB| |
|
1357 |
mustComeBefore := b isSubclassOf:a. |
|
1358 |
pivateClassesOfB := pivateClassesOf at:b. |
|
1359 |
pivateClassesOfB do:[:eachClassInB | |
|
1360 |
mustComeBefore := mustComeBefore or:[eachClassInB isSubclassOf:a] |
|
1361 |
]. |
|
1362 |
mustComeBefore |
|
1363 |
]. |
|
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1364 |
]. |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1365 |
^ classes. |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1366 |
|
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1367 |
" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1368 |
Object privateClassesSorted |
14146 | 1369 |
Class privateClassesSorted |
1370 |
Class privateClasses |
|
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1371 |
" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1372 |
|
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1373 |
"Created: 22.3.1997 / 16:10:42 / cg" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1374 |
"Modified: 22.3.1997 / 16:11:20 / cg" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1375 |
! |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1376 |
|
9959 | 1377 |
projectDefinition |
12197
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1378 |
<resource: #obsolete> |
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1379 |
"return the project definition of the classes package" |
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1380 |
|
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1381 |
self obsoleteMethodWarning. |
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1382 |
^ self projectDefinitionClass |
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1383 |
|
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1384 |
" |
13756 | 1385 |
Object projectDefinition productVersion |
1386 |
DAPASX::DapasUI projectDefinition productVersion |
|
12197
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1387 |
" |
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1388 |
|
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1389 |
"Created: / 19-09-2006 / 22:02:06 / cg" |
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1390 |
! |
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1391 |
|
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1392 |
projectDefinitionClass |
9959 | 1393 |
"return the project definition of the classes package" |
1394 |
||
1395 |
^ ProjectDefinition definitionClassForPackage: self package |
|
1396 |
||
1397 |
" |
|
13756 | 1398 |
Object projectDefinitionClass productVersion |
1399 |
DAPASX::DapasUI projectDefinitionClass productVersion |
|
9959 | 1400 |
" |
1401 |
||
1402 |
"Created: / 19-09-2006 / 22:02:06 / cg" |
|
1403 |
! |
|
1404 |
||
13214 | 1405 |
realSharedPoolNames |
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1406 |
"this returns the namespace aware pool names" |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1407 |
|
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1408 |
|poolNames ns| |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1409 |
|
13214 | 1410 |
poolNames := self sharedPoolNames. |
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1411 |
(ns := self topNameSpace) notNil ifTrue:[ |
13766 | 1412 |
^ poolNames |
1413 |
collect:[:nm | |
|
1414 |
|p| |
|
1415 |
(p := ns at:nm asSymbol) notNil ifTrue:[ |
|
1416 |
p name |
|
1417 |
] ifFalse:[ |
|
1418 |
nm |
|
1419 |
]]. |
|
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1420 |
]. |
13756 | 1421 |
^ poolNames |
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1422 |
|
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1423 |
" |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1424 |
Croquet::OpenGL sharedPools |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1425 |
Croquet::OpenGL realSharedPools |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1426 |
" |
13214 | 1427 |
|
1428 |
"Created: / 18-01-2011 / 18:02:25 / cg" |
|
1429 |
! |
|
1430 |
||
1431 |
realSharedPools |
|
1432 |
"this returns the namespace aware pools" |
|
1433 |
||
1434 |
|ns| |
|
1435 |
||
1436 |
ns := self topNameSpace. |
|
1437 |
^ self sharedPoolNames collect:[:nm | ns at:nm] |
|
1438 |
||
1439 |
" |
|
1440 |
Croquet::OpenGL sharedPools |
|
1441 |
Croquet::OpenGL realSharedPools |
|
1442 |
||
1443 |
Win32OperatingSystem realSharedPools |
|
1444 |
Win32OperatingSystem realSharedPoolNames |
|
1445 |
" |
|
1446 |
||
1447 |
"Modified: / 18-01-2011 / 18:05:19 / cg" |
|
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1448 |
! |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1449 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1450 |
removeClassVarName:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1451 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1452 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1453 |
"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
|
1454 |
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
|
1455 |
|
6731 | 1456 |
|names newNames| |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1457 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1458 |
names := self classVarNames. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1459 |
(names includes:aString) ifTrue:[ |
13756 | 1460 |
newNames := ''. |
1461 |
names do:[:nm | nm ~= aString ifTrue:[newNames := newNames , nm , ' ']]. |
|
1462 |
self classVariableString:newNames withoutSpaces. |
|
1463 |
Class withoutUpdatingChangesDo:[ |
|
1464 |
self withAllSubclasses do:[:cls| |
|
1465 |
cls recompileMethodsAccessingAnyClassvarOrGlobal: |
|
1466 |
(Array with:aString asSymbol) |
|
1467 |
]. |
|
1468 |
]. |
|
1469 |
self addChangeRecordForClass:self andNotifyChangeOf:#classVariables. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1470 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1471 |
|
3220
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
1472 |
"Created: / 29.10.1995 / 19:42:08 / cg" |
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
1473 |
"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
|
1474 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1475 |
|
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1476 |
setCategory:aStringOrSymbol |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1477 |
"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
|
1478 |
|
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1479 |
aStringOrSymbol isNil ifTrue:[ |
13756 | 1480 |
category := aStringOrSymbol |
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1481 |
] ifFalse:[ |
13756 | 1482 |
category := aStringOrSymbol asSymbol |
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1483 |
] |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1484 |
|
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1485 |
"Created: 1.4.1997 / 15:24:04 / stefan" |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1486 |
! |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1487 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1488 |
setClassFilename:aFilename |
8551 | 1489 |
"set the classes filename. |
13756 | 1490 |
This is a dangerous (low level) operation, |
1491 |
since the comment and primitiveSpecs may no longer be accessable, |
|
10050 | 1492 |
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
|
1493 |
|
10141
669ade985ad7
temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents:
10102
diff
changeset
|
1494 |
"/ 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
|
1495 |
"/ we MUST catch and FIX this. |
10142 | 1496 |
aFilename notNil ifTrue:[ |
1497 |
(aFilename asFilename baseName startsWith:'st') ifTrue:[ |
|
13756 | 1498 |
(aFilename asFilename baseName at:3) isDigit ifTrue:[ |
1499 |
self halt:'this should not be reached' |
|
1500 |
]. |
|
10141
669ade985ad7
temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents:
10102
diff
changeset
|
1501 |
]. |
669ade985ad7
temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents:
10102
diff
changeset
|
1502 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1503 |
classFilename := aFilename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1504 |
|
10050 | 1505 |
"Modified: / 08-09-1995 / 14:16:48 / claus" |
10142 | 1506 |
"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
|
1507 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1508 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1509 |
setClassVariableString:aString |
8551 | 1510 |
"set the classes classvarnames string. |
1511 |
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
|
1512 |
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
|
1513 |
NO change record is written." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1514 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1515 |
classvars := aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1516 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1517 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1518 |
setComment:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1519 |
"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
|
1520 |
do NOT create a change record" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1521 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1522 |
comment := aString |
1 | 1523 |
! |
1524 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1525 |
setComment:com category:categoryStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1526 |
"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
|
1527 |
do NOT create a change record" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1528 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1529 |
|cat| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1530 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1531 |
comment := com. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1532 |
categoryStringOrSymbol isNil ifTrue:[ |
13756 | 1533 |
cat := '' |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1534 |
] ifFalse:[ |
13756 | 1535 |
cat := categoryStringOrSymbol |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1536 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1537 |
category := cat asSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1538 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1539 |
|
5248 | 1540 |
setEnvironment:aNamespace |
1541 |
"set the namespace I am contained in; ST-80 compatible name" |
|
1542 |
||
1543 |
environment := aNamespace |
|
1544 |
! |
|
1545 |
||
9494 | 1546 |
setPackage:aSymbol |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1547 |
"set the package of the class." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1548 |
|
9494 | 1549 |
package := aSymbol |
1550 |
||
1551 |
"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
|
1552 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1553 |
|
13214 | 1554 |
sharedPoolNames |
1555 |
"this returns a collection of the plain (non-namespace aware) pool names" |
|
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1556 |
|
8561
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1557 |
|pools| |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1558 |
|
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1559 |
pools := self getAttribute:#sharedPools. |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1560 |
pools isNil ifTrue:[ |
13756 | 1561 |
^ #(). |
8561
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1562 |
]. |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1563 |
pools isString ifTrue:[ |
13756 | 1564 |
pools := pools asCollectionOfWords collect:[:varName| varName asSymbol] as:Array. |
1565 |
self setAttribute:#sharedPools to:pools. |
|
8561
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1566 |
]. |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1567 |
^ pools |
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1568 |
|
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1569 |
" |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1570 |
Croquet::OpenGL sharedPools |
13756 | 1571 |
OpenGLRenderingContext sharedPools |
1572 |
Character sharedPools |
|
1573 |
Win32OperatingSystem sharedPools |
|
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1574 |
" |
13188 | 1575 |
|
13214 | 1576 |
"Created: / 18-01-2011 / 17:55:42 / cg" |
1577 |
! |
|
1578 |
||
1579 |
sharedPoolNames:aStringOrCollection |
|
8551 | 1580 |
"{ Pragma: +optSpace }" |
1581 |
||
1582 |
"set the sharedPools string (no change notifications)" |
|
1583 |
||
13221
11f21a9fb78d
added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents:
13214
diff
changeset
|
1584 |
self setSharedPoolNames:aStringOrCollection. |
8551 | 1585 |
self addChangeRecordForClass:self. |
10050 | 1586 |
|
13214 | 1587 |
"Created: / 18-01-2011 / 17:55:48 / cg" |
13221
11f21a9fb78d
added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents:
13214
diff
changeset
|
1588 |
"Modified: / 18-01-2011 / 20:41:17 / cg" |
13214 | 1589 |
! |
1590 |
||
1591 |
sharedPools |
|
13762 | 1592 |
"this returns a collection of the real pools (i.e. the PoolDictionaries)" |
1593 |
||
13999 | 1594 |
|ns pools| |
1595 |
||
1596 |
ns := self nameSpace. |
|
1597 |
pools := |
|
1598 |
self sharedPoolNames |
|
1599 |
collect:[:eachName | |
|
1600 |
|pool| |
|
1601 |
||
1602 |
ns ~= Smalltalk ifTrue:[ |
|
1603 |
pool := ns at:eachName asSymbol. |
|
1604 |
]. |
|
1605 |
pool isNil ifTrue:[ |
|
1606 |
pool := Smalltalk at:eachName asSymbol. |
|
1607 |
pool isNil ifTrue:[ |
|
1608 |
Transcript showCR:('Warning: no such pool: ',eachName). |
|
1609 |
] |
|
1610 |
]. |
|
1611 |
pool |
|
1612 |
] |
|
1613 |
as:OrderedCollection. |
|
1614 |
||
1615 |
^ pools select:[:pool | pool notNil ] |
|
13214 | 1616 |
|
1617 |
" |
|
1618 |
Croquet::OpenGL sharedPools |
|
13756 | 1619 |
OpenGLRenderingContext sharedPools |
13762 | 1620 |
Character sharedPools |
13756 | 1621 |
Win32OperatingSystem sharedPools |
13214 | 1622 |
" |
1623 |
||
13999 | 1624 |
"Modified: / 07-02-2012 / 16:52:07 / cg" |
13762 | 1625 |
! |
1626 |
||
1627 |
sharedPools:aCollection |
|
13214 | 1628 |
"{ Pragma: +optSpace }" |
1629 |
||
13762 | 1630 |
"set the sharedPools expects the real pools (i.e. the PoolDictionaries)" |
1631 |
||
1632 |
"/ for backward compatibility.. |
|
1633 |
aCollection isString ifTrue:[ |
|
1634 |
Transcript showCR:'warning: string passed to sharedPools:'. |
|
13766 | 1635 |
self sharedPoolNames:(aCollection asCollectionOfWords collect:[:each | each asSymbol]). |
13762 | 1636 |
^ self. |
1637 |
]. |
|
1638 |
self sharedPoolNames: |
|
1639 |
(aCollection |
|
1640 |
collect:[:each | |
|
1641 |
each isString |
|
13764 | 1642 |
ifTrue:[ each asSymbol ] |
13762 | 1643 |
ifFalse:[ each name ] |
1644 |
] |
|
1645 |
). |
|
1646 |
||
13766 | 1647 |
"Modified: / 03-10-2011 / 10:30:30 / cg" |
8551 | 1648 |
! |
1649 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1650 |
source |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1651 |
"return the classes full source code" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1652 |
|
8737
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1653 |
|code aStream tmpFilename| |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1654 |
|
10050 | 1655 |
" 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
|
1656 |
code := String new:1000. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1657 |
aStream := WriteStream on:code. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1658 |
self fileOutOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1659 |
" |
8737
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1660 |
tmpFilename := Filename newTemporary. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
1661 |
[ |
13756 | 1662 |
aStream := tmpFilename newReadWriteStream. |
1663 |
aStream removeOnClose:true. |
|
8737
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1664 |
] on:OpenError do:[:ex| |
13756 | 1665 |
self warn:'Class>>#source: cannot create temporary file: ', ex description. |
1666 |
^ nil |
|
555 | 1667 |
]. |
8737
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1668 |
[ |
13756 | 1669 |
FileOutErrorSignal handle:[:ex | |
1670 |
aStream nextPut:$" ; nextPutAll:ex description; nextPut:$". |
|
1671 |
FileOutErrorSignal isHandled ifTrue:[ |
|
1672 |
ex reject. |
|
1673 |
]. |
|
1674 |
] do:[ |
|
1675 |
self fileOutOn:aStream. |
|
1676 |
]. |
|
1677 |
aStream reset. |
|
1678 |
code := aStream contents. |
|
8737
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1679 |
] ensure:[ |
13756 | 1680 |
aStream close. |
555 | 1681 |
]. |
1682 |
^ code |
|
10050 | 1683 |
|
1684 |
"Modified: / 06-10-2006 / 13:34:18 / cg" |
|
385 | 1685 |
! |
1686 |
||
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1687 |
sourceCodeManager |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1688 |
"return my source code manager. |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1689 |
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
|
1690 |
But future versions may support mixed reporitories" |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1691 |
|
12308 | 1692 |
|owner| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1693 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1694 |
(owner := self owningClass) notNil ifTrue:[^ owner sourceCodeManager]. |
10166 | 1695 |
|
1696 |
"/ see if there is a package-specific manager |
|
12308 | 1697 |
AbstractSourceCodeManager notNil ifTrue:[ |
13756 | 1698 |
^ AbstractSourceCodeManager sourceCodeManagerForPackage: package. |
10166 | 1699 |
]. |
12308 | 1700 |
|
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1701 |
^ Smalltalk at:#SourceCodeManager |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1702 |
|
10166 | 1703 |
" |
1704 |
Array sourceCodeManager |
|
1705 |
foo_p1 sourceCodeManager |
|
1706 |
" |
|
1707 |
||
1708 |
"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
|
1709 |
"Modified: / 05-12-2006 / 22:04:26 / cg" |
12857
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1710 |
! |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1711 |
|
12903 | 1712 |
subclasses |
1713 |
"return a collection of the direct subclasses of the receiver" |
|
1714 |
||
1715 |
"/ use cached information (avoid class hierarchy search), if possible |
|
13860 | 1716 |
(subclasses isNil |
1717 |
or:[ subclasses sequenceNumber ~= SubclassCacheSequenceNumber ]) ifTrue:[ |
|
1718 |
self updateAllCachedSubclasses. |
|
1719 |
"subclasses may still be nil - obsolete classes may not be updated" |
|
1720 |
^ subclasses ? #(). |
|
12903 | 1721 |
]. |
12906 | 1722 |
^ subclasses. |
12903 | 1723 |
|
1724 |
" |
|
1725 |
Class flushSubclassInfo. |
|
12906 | 1726 |
Class subclasses. |
1727 |
SmallInteger subclasses |
|
12903 | 1728 |
" |
1729 |
||
13860 | 1730 |
"Modified: / 06-12-2011 / 16:05:16 / cg" |
12903 | 1731 |
! |
1732 |
||
12857
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1733 |
superclass:aClass |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1734 |
"set the superclass - this actually creates a new class, |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1735 |
recompiling all methods for the new one. The receiving class stays |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1736 |
around anonymously to allow existing instances some life. |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1737 |
This may change in the future (adjusting existing instances)" |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1738 |
|
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1739 |
|owner ns name| |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1740 |
|
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1741 |
"must flush caches since lookup chain changes" |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1742 |
ObjectMemory flushCaches. |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1743 |
|
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1744 |
"/ for correct recompilation, just create a new class ... |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1745 |
"/ but care to avoid a nameSpace change, by giving my |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1746 |
"/ full name and answering with Smalltalk to a nameSpace query. |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1747 |
|
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1748 |
(owner := self owningClass) notNil ifTrue:[ |
13756 | 1749 |
ns := owner. |
1750 |
name := self nameWithoutPrefix asSymbol |
|
12857
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1751 |
] ifFalse:[ |
13756 | 1752 |
ns := Smalltalk. |
1753 |
name := self name |
|
12857
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1754 |
]. |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1755 |
|
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1756 |
Class classRedefinitionNotification answer:#keep do:[ |
13756 | 1757 |
Class nameSpaceQuerySignal |
1758 |
answer:ns |
|
1759 |
do:[ |
|
1760 |
aClass |
|
1761 |
perform:(self definitionSelector) |
|
1762 |
withArguments:(Array with:name |
|
1763 |
with:(self instanceVariableString) |
|
1764 |
with:(self classVariableString) |
|
1765 |
with:'' "/ pool |
|
1766 |
with:(self category)). |
|
1767 |
] |
|
12857
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1768 |
] |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1769 |
|
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1770 |
"Modified: / 20.6.1998 / 18:17:37 / cg" |
13507
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1771 |
! |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1772 |
|
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1773 |
withAllPrivateClasses |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1774 |
"return a collection containing the receiver plus all of my private classes (if any). |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1775 |
This also inclueds all private classes of private classes, recursively. |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1776 |
Elements are in no particular order." |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1777 |
|
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1778 |
|coll| |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1779 |
|
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1780 |
coll := OrderedCollection new. |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1781 |
self withAllPrivateClassesDo:[:cls | coll add:cls]. |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1782 |
^ coll |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1783 |
|
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1784 |
"Created: / 18-07-2011 / 09:14:38 / cg" |
1 | 1785 |
! ! |
1786 |
||
5257 | 1787 |
!Class methodsFor:'adding & removing'! |
1 | 1788 |
|
12903 | 1789 |
removeFromSystem |
1790 |
"ST-80 compatibility |
|
1791 |
remove myself from the system" |
|
1792 |
||
1793 |
Smalltalk removeClass:self. |
|
1794 |
Smalltalk removeKey:name. |
|
1795 |
||
1796 |
"Created: 6.2.1996 / 11:32:58 / stefan" |
|
1797 |
! |
|
1798 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1799 |
unload |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1800 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1801 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1802 |
"if the receiver was autoloaded, unload and reinstall it as |
293 | 1803 |
autoloaded. Can be used to get rid of no longer needed autoloaded |
8551 | 1804 |
classes. |
328 | 1805 |
(maybe, autoloaded classes should unload themselfes when no |
8551 | 1806 |
longer needed - for example, after some delay when the last instance |
328 | 1807 |
is gone ...)" |
293 | 1808 |
|
9371
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1809 |
|nm newClass privateClasses| |
293 | 1810 |
|
216 | 1811 |
self wasAutoloaded ifFalse:[ |
13756 | 1812 |
" |
1813 |
can it be done ? |
|
1814 |
(all of my methods must have a source) |
|
1815 |
" |
|
1816 |
self instAndClassSelectorsAndMethodsDo:[:sel :aMethod | |
|
1817 |
aMethod source isNil ifTrue:[^false]. |
|
1818 |
aMethod hasPrimitiveCode ifTrue:[^ false]. |
|
1819 |
]. |
|
216 | 1820 |
]. |
1821 |
||
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1822 |
"/ 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
|
1823 |
self allSubclassesDo:[:eachSubclass | |
13756 | 1824 |
eachSubclass wasAutoloaded ifFalse:[ |
1825 |
eachSubclass isPrivate ifFalse:[ |
|
1826 |
self warn:('cannot unload ' , self name , ' (' , eachSubclass name , ' requires it)'). |
|
1827 |
^ false. |
|
1828 |
] |
|
1829 |
] |
|
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1830 |
]. |
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1831 |
|
9371
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1832 |
self allSubclassesDo:[:eachSubclass | |
13756 | 1833 |
eachSubclass wasAutoloaded ifTrue:[ |
1834 |
eachSubclass unload |
|
1835 |
] ifFalse:[ |
|
1836 |
eachSubclass removeFromSystem. |
|
1837 |
] |
|
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1838 |
]. |
9371
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1839 |
privateClasses := self privateClasses. |
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
1840 |
privateClasses notEmpty ifTrue:[ |
13756 | 1841 |
self withoutUpdatingChangesDo:[ |
1842 |
privateClasses do:[:eachPrivateClass | |
|
1843 |
eachPrivateClass removeFromSystem. |
|
1844 |
]. |
|
1845 |
]. |
|
283 | 1846 |
]. |
1415 | 1847 |
Transcript showCR:'unloading ' , name , ' ...'. |
283 | 1848 |
|
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1849 |
"/ reinstall as autoloaded |
8551 | 1850 |
Autoload removeClass:self. |
293 | 1851 |
nm := name. |
1852 |
Smalltalk at:nm put:nil. |
|
288 | 1853 |
ObjectMemory flushInlineCaches. |
1854 |
ObjectMemory flushMethodCache. |
|
4052 | 1855 |
newClass := Autoload addClass:nm inCategory:category. |
1856 |
newClass notNil ifTrue:[ |
|
13756 | 1857 |
newClass package:package |
4052 | 1858 |
]. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1859 |
Smalltalk flushCachedClasses. |
12701 | 1860 |
Class flushSubclassInfoFor:self. |
216 | 1861 |
^ true |
1862 |
||
1863 |
" |
|
1864 |
Clock open. |
|
1865 |
Clock unload. |
|
1866 |
ClockView unload. |
|
1867 |
Clock open |
|
1868 |
" |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1869 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1870 |
"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
|
1871 |
"Modified: 4.6.1997 / 14:48:02 / cg" |
1 | 1872 |
! ! |
1873 |
||
13474 | 1874 |
|
1 | 1875 |
!Class methodsFor:'changes management'! |
1876 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1877 |
addChangeRecordForChangeCategory |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1878 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1879 |
|
6097 | 1880 |
"add a category change" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1881 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1882 |
Class updateChangeFileQuerySignal query ifTrue:[ |
13756 | 1883 |
self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category. |
6097 | 1884 |
]. |
1885 |
||
1886 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1887 |
Project notNil ifTrue:[ |
|
13756 | 1888 |
UpdateChangeListQuerySignal query ifTrue:[ |
1889 |
Project addClassDefinitionChangeFor:self |
|
1890 |
] |
|
2256 | 1891 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1892 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1893 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1894 |
addChangeRecordForClass:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1895 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1896 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1897 |
"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
|
1898 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1899 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 1900 |
self writingChangePerform:#addChangeRecordForClass:to: with:aClass. |
6166 | 1901 |
]. |
1902 |
||
1903 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1904 |
Project notNil ifTrue:[ |
|
13756 | 1905 |
UpdateChangeListQuerySignal query ifTrue:[ |
1906 |
Project addClassDefinitionChangeFor:aClass |
|
1907 |
] |
|
2256 | 1908 |
] |
1909 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1910 |
"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
|
1911 |
"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
|
1912 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1913 |
|
620 | 1914 |
addChangeRecordForClassCheckIn:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1915 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1916 |
|
620 | 1917 |
"append a class-was-checkedIn-record to the changes file" |
1918 |
||
12052
7aabd3b316a6
changed: #addChangeRecordForClassCheckIn:
Claus Gittinger <cg@exept.de>
parents:
12044
diff
changeset
|
1919 |
|rv pkg| |
1938 | 1920 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1921 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 1922 |
rv := aClass revision. |
1923 |
rv isNil ifTrue:[rv := '???']. |
|
1924 |
pkg := aClass package. |
|
1925 |
||
1926 |
self |
|
1927 |
writingChangeWithTimeStamp:false |
|
1928 |
perform:#addInfoRecord:to: |
|
1929 |
with:('checkin %1 into %2 (%3)' |
|
1930 |
bindWith:aClass name |
|
1931 |
with:pkg |
|
1932 |
with:rv). |
|
2256 | 1933 |
] |
620 | 1934 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1935 |
"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
|
1936 |
"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
|
1937 |
"Modified: / 18.3.1999 / 18:14:14 / stefan" |
620 | 1938 |
! |
1939 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1940 |
addChangeRecordForClassComment:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1941 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1942 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1943 |
"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
|
1944 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1945 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 1946 |
self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass. |
6166 | 1947 |
]. |
1948 |
||
1949 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1950 |
Project notNil ifTrue:[ |
|
13756 | 1951 |
UpdateChangeListQuerySignal query ifTrue:[ |
1952 |
Project addClassCommentChangeFor:aClass |
|
1953 |
] |
|
2256 | 1954 |
] |
1955 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1956 |
"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
|
1957 |
"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
|
1958 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1959 |
|
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1960 |
addChangeRecordForClassContainerRemove:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1961 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1962 |
|
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1963 |
"append a container-was-removed-record to the changes file" |
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1964 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1965 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 1966 |
self |
1967 |
writingChangeWithTimeStamp:false |
|
1968 |
perform:#addInfoRecord:to: |
|
1969 |
with:('removed source container of ' , aClass name). |
|
2256 | 1970 |
] |
1971 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1972 |
"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
|
1973 |
"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
|
1974 |
"Modified: / 18.3.1999 / 18:14:31 / stefan" |
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1975 |
! |
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1976 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1977 |
addChangeRecordForClassFileOut:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1978 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1979 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1980 |
"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
|
1981 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1982 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 1983 |
self |
1984 |
writingChangeWithTimeStamp:false |
|
1985 |
perform:#addInfoRecord:to: |
|
1986 |
with:('fileOut ' , aClass name). |
|
2256 | 1987 |
] |
1988 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1989 |
"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
|
1990 |
"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
|
1991 |
! |
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 |
addChangeRecordForClassInstvars:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1994 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1995 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1996 |
"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
|
1997 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1998 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 1999 |
self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass. |
6166 | 2000 |
]. |
2001 |
||
2002 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2003 |
Project notNil ifTrue:[ |
|
13756 | 2004 |
UpdateChangeListQuerySignal query ifTrue:[ |
2005 |
Project addInstVarDefinitionChangeFor:aClass class |
|
2006 |
] |
|
2256 | 2007 |
] |
2008 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2009 |
"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
|
2010 |
"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
|
2011 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2012 |
|
7179 | 2013 |
addChangeRecordForClassRemove |
2014 |
"{ Pragma: +optSpace }" |
|
2015 |
||
2016 |
"add a class-remove-record to the changes file" |
|
2017 |
||
2018 |
UpdateChangeFileQuerySignal query ifTrue:[ |
|
13756 | 2019 |
self writingChangePerform:#addChangeRecordForClassRemove:to: with:self. |
7179 | 2020 |
]. |
2021 |
||
2022 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2023 |
Project notNil ifTrue:[ |
|
13756 | 2024 |
UpdateChangeListQuerySignal query ifTrue:[ |
2025 |
Project addClassRemoveChange:self |
|
2026 |
] |
|
7179 | 2027 |
] |
2028 |
||
2029 |
"Modified: / 24.1.1997 / 19:10:25 / cg" |
|
2030 |
"Modified: / 18.3.1999 / 18:14:53 / stefan" |
|
2031 |
! |
|
2032 |
||
6166 | 2033 |
addChangeRecordForClassRemove:oldClassName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2034 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2035 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2036 |
"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
|
2037 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2038 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2039 |
self writingChangePerform:#addChangeRecordForClassRemove:to: with:self. |
6166 | 2040 |
]. |
2041 |
||
2042 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2043 |
Project notNil ifTrue:[ |
|
13756 | 2044 |
UpdateChangeListQuerySignal query ifTrue:[ |
2045 |
Project addClassRemoveChange:self |
|
2046 |
] |
|
2256 | 2047 |
] |
2048 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2049 |
"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
|
2050 |
"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
|
2051 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2052 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2053 |
addChangeRecordForClassRename:oldName to:newName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2054 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2055 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2056 |
"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
|
2057 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2058 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2059 |
self writingChangeDo:[:aStream | |
2060 |
self addChangeRecordForClassRename:oldName to:newName to:aStream |
|
2061 |
] |
|
6166 | 2062 |
]. |
2063 |
||
2064 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2065 |
Project notNil ifTrue:[ |
|
13756 | 2066 |
UpdateChangeListQuerySignal query ifTrue:[ |
2067 |
Project addClassRenameChangeFrom:oldName to:newName |
|
2068 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2069 |
] |
1846 | 2070 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2071 |
"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
|
2072 |
"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
|
2073 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2074 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2075 |
addChangeRecordForPrimitiveDefinitions:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2076 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2077 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2078 |
"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
|
2079 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2080 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2081 |
self writingChangePerform:#addChangeRecordForPrimitiveDefinitions:to: with:aClass. |
6166 | 2082 |
]. |
2083 |
||
2084 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2085 |
Project notNil ifTrue:[ |
|
13756 | 2086 |
UpdateChangeListQuerySignal query ifTrue:[ |
2087 |
Project addPrimitiveDefinitionsChangeFor:aClass |
|
2088 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
2089 |
] |
2206 | 2090 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2091 |
"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
|
2092 |
"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
|
2093 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2094 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2095 |
addChangeRecordForPrimitiveFunctions:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2096 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2097 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2098 |
"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
|
2099 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2100 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2101 |
self writingChangePerform:#addChangeRecordForPrimitiveFunctions:to: with:aClass. |
6166 | 2102 |
]. |
2103 |
||
2104 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2105 |
Project notNil ifTrue:[ |
|
13756 | 2106 |
UpdateChangeListQuerySignal query ifTrue:[ |
2107 |
Project addPrimitiveFunctionsChangeFor:aClass |
|
2108 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
2109 |
] |
2206 | 2110 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2111 |
"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
|
2112 |
"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
|
2113 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2114 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2115 |
addChangeRecordForPrimitiveVariables:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2116 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2117 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2118 |
"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
|
2119 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2120 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2121 |
self writingChangePerform:#addChangeRecordForPrimitiveVariables:to: with:aClass. |
6166 | 2122 |
]. |
2123 |
||
2124 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2125 |
Project notNil ifTrue:[ |
|
13756 | 2126 |
UpdateChangeListQuerySignal query ifTrue:[ |
2127 |
Project addPrimitiveVariablesChangeFor:aClass |
|
2128 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
2129 |
] |
2206 | 2130 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2131 |
"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
|
2132 |
"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
|
2133 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2134 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2135 |
addChangeRecordForSnapshot:aFileName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2136 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2137 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2138 |
"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
|
2139 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2140 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2141 |
self |
2142 |
writingChangeWithTimeStamp:false |
|
2143 |
perform:#addChangeRecordForSnapshot:to: |
|
2144 |
with:aFileName. |
|
2256 | 2145 |
] |
2146 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2147 |
"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
|
2148 |
"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
|
2149 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2150 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2151 |
addChangeRecordForSnapshot:aFileName to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2152 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2153 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2154 |
"add a snapshot-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2155 |
|
6166 | 2156 |
self addInfoRecord:('snapshot ' , aFileName) to:aStream |
2256 | 2157 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2158 |
"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
|
2159 |
"Modified: / 18.3.1999 / 18:15:30 / stefan" |
2917 | 2160 |
! ! |
2161 |
||
1824 | 2162 |
!Class methodsFor:'enumerating'! |
2163 |
||
3997 | 2164 |
allPrivateClassesDo:aBlock |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
2165 |
"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
|
2166 |
Evaluation is in no particular order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
2167 |
|
8551 | 2168 |
self allPrivateClasses do:aBlock |
3997 | 2169 |
! |
2170 |
||
1824 | 2171 |
privateClassesDo:aBlock |
5715
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2172 |
"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
|
2173 |
Evaluation is in no particular order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
2174 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
2175 |
self privateClasses do:aBlock |
5715
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2176 |
! |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2177 |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2178 |
subclassesDo:aBlock |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2179 |
"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
|
2180 |
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
|
2181 |
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
|
2182 |
|
13860 | 2183 |
self subclasses do:aBlock |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2184 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2185 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2186 |
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
|
2187 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2188 |
|
13860 | 2189 |
"Modified: / 06-12-2011 / 15:59:49 / cg" |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2190 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2191 |
|
5715
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2192 |
withAllPrivateClassesDo:aBlock |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2193 |
"evaluate aBlock on myself and all of my private classes (if any). |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2194 |
This recurses into private classes of private classes. |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2195 |
Evaluation is in no particular order." |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2196 |
|
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2197 |
aBlock value:self. |
8551 | 2198 |
self allPrivateClasses do:aBlock |
1824 | 2199 |
! ! |
2200 |
||
1 | 2201 |
!Class methodsFor:'fileIn interface'! |
2202 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2203 |
primitiveDefinitions |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2204 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2205 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2206 |
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
|
2207 |
unprocessed contents in the classes primitiveDefinitions section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2208 |
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
|
2209 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2210 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2211 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2212 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2213 |
"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
|
2214 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2215 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2216 |
primitiveFunctions |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2217 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2218 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2219 |
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
|
2220 |
unprocessed contents in the classes primitiveFunctions section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2221 |
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
|
2222 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2223 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2224 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2225 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2226 |
"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
|
2227 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2228 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2229 |
primitiveVariables |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2230 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2231 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2232 |
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
|
2233 |
unprocessed contents in the classes primitiveVariables section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2234 |
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
|
2235 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2236 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2237 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2238 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2239 |
"Modified: 10.2.1996 / 12:47:28 / cg" |
1 | 2240 |
! ! |
2241 |
||
2242 |
!Class methodsFor:'fileOut'! |
|
2243 |
||
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2244 |
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2245 |
"append an expression on aStream, which defines myself." |
238 | 2246 |
|
5344
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2247 |
self |
13756 | 2248 |
basicFileOutDefinitionOn:aStream |
2249 |
withNameSpace:forceNameSpace |
|
2250 |
withPackage:true |
|
5344
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2251 |
|
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2252 |
! |
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2253 |
|
8551 | 2254 |
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
|
2255 |
"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
|
2256 |
|
8551 | 2257 |
self class |
13756 | 2258 |
basicFileOutDefinitionOf:self |
2259 |
on:aStream |
|
2260 |
withNameSpace:forceNameSpace withPackage:showPackage |
|
1707 | 2261 |
! |
2262 |
||
8716 | 2263 |
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:showPackage syntaxHilighting:syntaxHilighting |
2264 |
"append an expression on aStream, which defines myself." |
|
2265 |
||
2266 |
self class |
|
13756 | 2267 |
basicFileOutDefinitionOf:self |
2268 |
on:aStream |
|
2269 |
withNameSpace:forceNameSpace |
|
2270 |
withPackage:showPackage |
|
2271 |
syntaxHilighting:syntaxHilighting |
|
8716 | 2272 |
! |
2273 |
||
1707 | 2274 |
basicFileOutInstvarTypeKeywordOn:aStream |
2275 |
"a helper for fileOutDefinition" |
|
2276 |
||
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2277 |
|isVar superclass| |
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2278 |
|
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2279 |
superclass := self superclass. |
1707 | 2280 |
superclass isNil ifTrue:[ |
13756 | 2281 |
isVar := self isVariable |
1707 | 2282 |
] ifFalse:[ |
13756 | 2283 |
"I cant remember what this is for ?" |
2284 |
isVar := (self isVariable and:[superclass isVariable not]) |
|
1707 | 2285 |
]. |
2286 |
||
3920
0c1b9b2fa23b
added longlong indexed instvars;
Claus Gittinger <cg@exept.de>
parents:
3788
diff
changeset
|
2287 |
aStream nextPutAll:(self firstDefinitionSelectorPart). |
1707 | 2288 |
|
2289 |
"Created: 11.10.1996 / 18:57:29 / cg" |
|
1 | 2290 |
! |
2291 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2292 |
fileOut |
894
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2293 |
"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
|
2294 |
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
|
2295 |
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
|
2296 |
directory. Care is taken, to not clobber any existing file in |
8551 | 2297 |
case of errors (for example: disk full). |
2298 |
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
|
2299 |
sourceFile may not be rewritten." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2300 |
|
7693 | 2301 |
|dirName nm fileName| |
2302 |
||
10053 | 2303 |
nm := (Smalltalk fileNameForClass:self name),'.st'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2304 |
|
139 | 2305 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2306 |
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
|
2307 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2308 |
Project notNil ifTrue:[ |
13756 | 2309 |
dirName := Project currentProjectDirectory |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2310 |
] ifFalse:[ |
13756 | 2311 |
dirName := Filename currentDirectory |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2312 |
]. |
3788
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2313 |
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
|
2314 |
fileName makeLegalFilename. |
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2315 |
|
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2316 |
self fileOutAs:fileName name. |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2317 |
|
2771 | 2318 |
"/ " |
2319 |
"/ add a change record; that way, administration is much easier, |
|
8551 | 2320 |
"/ since we can see in that changeBrowser, which changes have |
2771 | 2321 |
"/ already found their way into a sourceFile and which must be |
2322 |
"/ applied again |
|
2323 |
"/ " |
|
2324 |
"/ self addChangeRecordForClassFileOut:self |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2325 |
|
10053 | 2326 |
"Modified: / 07-06-1996 / 09:14:43 / stefan" |
2327 |
"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
|
2328 |
! |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2329 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2330 |
fileOutAllMethodsOn:aStream |
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2331 |
self fileOutAllMethodsOn:aStream methodFilter:nil |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2332 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2333 |
"Created: 15.10.1996 / 11:13:00 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2334 |
"Modified: 22.3.1997 / 16:12:17 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2335 |
! |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2336 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2337 |
fileOutAllMethodsOn:aStream methodFilter:methodFilter |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2338 |
|collectionOfCategories| |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2339 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2340 |
collectionOfCategories := self class categories asSortedCollection. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2341 |
collectionOfCategories notNil ifTrue:[ |
13756 | 2342 |
collectionOfCategories do:[:aCategory | |
2343 |
self class fileOutCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2344 |
aStream cr |
|
2345 |
] |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2346 |
]. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2347 |
collectionOfCategories := self categories asSortedCollection. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2348 |
collectionOfCategories notNil ifTrue:[ |
13756 | 2349 |
collectionOfCategories do:[:aCategory | |
2350 |
self fileOutCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2351 |
aStream cr |
|
2352 |
] |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2353 |
]. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2354 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2355 |
self privateClassesSorted do:[:aClass | |
13756 | 2356 |
aClass fileOutAllMethodsOn:aStream methodFilter:methodFilter |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2357 |
]. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2358 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2359 |
"Created: 15.10.1996 / 11:13:00 / cg" |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2360 |
"Modified: 22.3.1997 / 16:12:17 / cg" |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2361 |
! |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2362 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2363 |
fileOutAs:fileNameString |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2364 |
"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
|
2365 |
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
|
2366 |
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
|
2367 |
Care is taken, to not clobber any existing file in |
8551 | 2368 |
case of errors (for example: disk full). |
2369 |
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
|
2370 |
sourceFile may not be rewritten." |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2371 |
|
2958
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
2372 |
|aStream fileName newFileName savFilename needRename |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2373 |
mySourceFileName sameFile s mySourceFileID anySourceRef| |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2374 |
|
3750
d544994a1c3e
in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents:
3702
diff
changeset
|
2375 |
self isLoaded ifFalse:[ |
13756 | 2376 |
^ FileOutErrorSignal |
2377 |
raiseRequestWith:self |
|
2378 |
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
|
2379 |
]. |
d544994a1c3e
in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents:
3702
diff
changeset
|
2380 |
|
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2381 |
fileName := fileNameString asFilename. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2382 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2383 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2384 |
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
|
2385 |
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
|
2386 |
and, if that worked rename afterwards ... |
153 | 2387 |
" |
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2388 |
(fileName exists) ifTrue:[ |
13756 | 2389 |
sameFile := false. |
2390 |
||
2391 |
"/ check carefully - maybe, my source does not really come from that |
|
2392 |
"/ file (i.e. all of my methods have their source as string) |
|
2393 |
||
2394 |
anySourceRef := false. |
|
2395 |
self instAndClassMethodsDo:[:m | |
|
2396 |
m sourcePosition notNil ifTrue:[ |
|
2397 |
anySourceRef := true |
|
2398 |
] |
|
2399 |
]. |
|
2400 |
||
2401 |
anySourceRef ifTrue:[ |
|
2402 |
s := self sourceStream. |
|
2403 |
s notNil ifTrue:[ |
|
2404 |
OperatingSystem isUNIXlike ifTrue:[ |
|
2405 |
mySourceFileID := s pathName asFilename info id. |
|
2406 |
sameFile := (fileName info id) == mySourceFileID. |
|
2407 |
] ifFalse:[ |
|
2408 |
mySourceFileID := s pathName asFilename asAbsoluteFilename. |
|
2409 |
sameFile := (fileName asFilename asAbsoluteFilename) = mySourceFileID. |
|
2410 |
]. |
|
2411 |
s close. |
|
2412 |
] ifFalse:[ |
|
2413 |
classFilename notNil ifTrue:[ |
|
2414 |
" |
|
2415 |
check for overwriting my current source file |
|
2416 |
this is not allowed, since it would clobber my methods source |
|
2417 |
file ... you have to save it to some other place. |
|
2418 |
This happens if you ask for a fileOut into the source-directory |
|
2419 |
(from which my methods get their source) |
|
2420 |
" |
|
2421 |
mySourceFileName := Smalltalk getSourceFileName:classFilename. |
|
2422 |
sameFile := (fileNameString = mySourceFileName). |
|
2423 |
sameFile ifFalse:[ |
|
2424 |
mySourceFileName notNil ifTrue:[ |
|
2425 |
OperatingSystem isUNIXlike ifTrue:[ |
|
2426 |
sameFile := (fileName info id) == (mySourceFileName asFilename info id) |
|
2427 |
] |
|
2428 |
] |
|
2429 |
]. |
|
2430 |
] |
|
2431 |
]. |
|
2432 |
]. |
|
2433 |
||
2434 |
sameFile ifTrue:[ |
|
2435 |
^ FileOutErrorSignal |
|
2436 |
raiseRequestWith:fileNameString |
|
2437 |
errorString:(' - may not overwrite sourcefile:', fileNameString) |
|
2438 |
]. |
|
2439 |
||
2440 |
savFilename := Filename newTemporary. |
|
2441 |
fileName copyTo:savFilename. |
|
2442 |
newFileName := fileName withSuffix:'new'. |
|
2443 |
needRename := true |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2444 |
] ifFalse:[ |
13756 | 2445 |
"/ another possible trap: if my sourceFileName is |
2446 |
"/ the same as the written one AND the new files directory |
|
2447 |
"/ is along the sourcePath, we also need a temporary file |
|
2448 |
"/ first, to avoid accessing the newly written file. |
|
2449 |
||
2450 |
anySourceRef := false. |
|
2451 |
self instAndClassMethodsDo:[:m | |
|
2452 |
|mSrc| |
|
2453 |
||
2454 |
(mSrc := m sourceFilename) notNil ifTrue:[ |
|
2455 |
mSrc asFilename baseName = fileName baseName ifTrue:[ |
|
2456 |
anySourceRef := true |
|
2457 |
] |
|
2458 |
] |
|
2459 |
]. |
|
2460 |
anySourceRef ifTrue:[ |
|
2461 |
newFileName := fileName withSuffix:'new'. |
|
2462 |
needRename := true |
|
2463 |
] ifFalse:[ |
|
2464 |
newFileName := fileName. |
|
2465 |
needRename := false |
|
2466 |
] |
|
1 | 2467 |
]. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2468 |
[ |
13756 | 2469 |
aStream := newFileName writeStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2470 |
] on:FileStream openErrorSignal do:[:ex| |
13756 | 2471 |
savFilename notNil ifTrue:[ |
2472 |
savFilename delete |
|
2473 |
]. |
|
2474 |
^ FileOutErrorSignal |
|
2475 |
raiseRequestWith:newFileName name |
|
2476 |
errorString:(' - cannot create file:', newFileName name) |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2477 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2478 |
self fileOutOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2479 |
aStream close. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2480 |
|
199 | 2481 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2482 |
finally, replace the old-file |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2483 |
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
|
2484 |
we have to do a copy ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2485 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2486 |
needRename ifTrue:[ |
13756 | 2487 |
newFileName copyTo:fileName. |
2488 |
newFileName delete |
|
2958
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
2489 |
]. |
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
2490 |
savFilename notNil ifTrue:[ |
13756 | 2491 |
savFilename delete |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2492 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2493 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2494 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2495 |
add a change record; that way, administration is much easier, |
8551 | 2496 |
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
|
2497 |
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
|
2498 |
applied again |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2499 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2500 |
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
|
2501 |
|
10035
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2502 |
"Modified: / 07-06-1996 / 09:14:43 / stefan" |
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2503 |
"Created: / 16-04-1997 / 20:44:05 / cg" |
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2504 |
"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
|
2505 |
! |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2506 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2507 |
fileOutClassInstVarDefinitionOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2508 |
"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
|
2509 |
|
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8267
diff
changeset
|
2510 |
self class |
13756 | 2511 |
fileOutClassInstVarDefinitionOn:aStream |
2512 |
withNameSpace:false |
|
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2513 |
! |
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2514 |
|
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2515 |
fileOutClassInstVarDefinitionOn:aStream withNameSpace:withNameSpace |
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2516 |
"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
|
2517 |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2518 |
|anySuperClassInstVar| |
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2519 |
|
5296
12a5de62fef7
class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents:
5257
diff
changeset
|
2520 |
self isLoaded ifFalse:[ |
13756 | 2521 |
^ self basicFileOutDefinitionOn:aStream withNameSpace:withNameSpace |
5296
12a5de62fef7
class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents:
5257
diff
changeset
|
2522 |
]. |
12a5de62fef7
class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents:
5257
diff
changeset
|
2523 |
|
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2524 |
withNameSpace ifTrue:[ |
13756 | 2525 |
self name printOn:aStream. |
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2526 |
] ifFalse:[ |
13756 | 2527 |
self printClassNameOn:aStream. |
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2528 |
]. |
3338
0423dac35a45
dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
2529 |
aStream nextPutAll:' class instanceVariableNames:'''. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2530 |
self class printInstVarNamesOn:aStream indent:8. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2531 |
aStream nextPutAll:''''. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2532 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2533 |
"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
|
2534 |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2535 |
anySuperClassInstVar := false. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2536 |
self allSuperclassesDo:[:aSuperClass | |
13756 | 2537 |
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
|
2538 |
]. |
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2539 |
|
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2540 |
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
|
2541 |
anySuperClassInstVar ifFalse:[ |
13756 | 2542 |
aStream |
2543 |
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
|
2544 |
] ifTrue:[ |
13756 | 2545 |
aStream |
2546 |
nextPutLine:'The following class instance variables are inherited by this class:'. |
|
2547 |
aStream cr. |
|
2548 |
self allSuperclassesDo:[:aSuperClass | |
|
2549 |
aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '. |
|
2550 |
aStream nextPutLine:(aSuperClass class instanceVariableString). |
|
2551 |
]. |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2552 |
|
556 | 2553 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2554 |
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
|
2555 |
|
3338
0423dac35a45
dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
2556 |
"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
|
2557 |
"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
|
2558 |
"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
|
2559 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2560 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2561 |
fileOutCommentOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2562 |
"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
|
2563 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2564 |
|comment s| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2565 |
|
2011
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
2566 |
self printClassNameOn:aStream. |
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
2567 |
aStream nextPutAll:' comment:'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2568 |
(comment := self comment) isNil ifTrue:[ |
13756 | 2569 |
s := '''''' |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2570 |
] ifFalse:[ |
13756 | 2571 |
s := comment storeString |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2572 |
]. |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2573 |
aStream nextPutAllAsChunk:s. |
1063
b45a722a10c3
oops - forgot excla after comment-chunk
Claus Gittinger <cg@exept.de>
parents:
989
diff
changeset
|
2574 |
aStream nextPutChunkSeparator. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2575 |
aStream cr |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2576 |
|
2011
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
2577 |
"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
|
2578 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2579 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2580 |
fileOutDefinitionOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2581 |
"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
|
2582 |
|
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2583 |
^ 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
|
2584 |
|
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2585 |
"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
|
2586 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2587 |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2588 |
fileOutIn:aDirectoryName |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2589 |
"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
|
2590 |
directory aDirectoryName (ignoring any directory setting in |
8551 | 2591 |
the current project). |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2592 |
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
|
2593 |
|
12297
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2594 |
^ self fileOutIn:aDirectoryName withTimeStamp:true |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2595 |
|
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2596 |
" |
13756 | 2597 |
self fileOutIn:'/tmp' |
2598 |
self fileOutIn:'/tmp/doesNotExistBla' |
|
2599 |
self fileOutIn:'/tmp' asFilename |
|
12297
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2600 |
" |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2601 |
|
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2602 |
"Modified: / 19-09-1997 / 00:03:53 / stefan" |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2603 |
"Modified: / 06-10-2006 / 16:16:13 / cg" |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2604 |
! |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2605 |
|
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2606 |
fileOutIn:aDirectoryName withTimeStamp:withTimeStamp |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2607 |
"create a file 'class.st' consisting of all methods in self in |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2608 |
directory aDirectoryName (ignoring any directory setting in |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2609 |
the current project). |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2610 |
This is not logged in that change file (should it be ?)." |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2611 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2612 |
|aStream fileName| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2613 |
|
10053 | 2614 |
fileName := (Smalltalk fileNameForClass:self name),'.st'. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2615 |
[ |
13756 | 2616 |
aStream := (aDirectoryName asFilename construct:fileName) writeStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2617 |
] on:FileStream openErrorSignal do:[:ex| |
13756 | 2618 |
^ FileOutErrorSignal |
2619 |
raiseRequestWith:fileName |
|
2620 |
errorString:(' - cannot create file:', fileName) |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2621 |
]. |
12297
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2622 |
self fileOutOn:aStream withTimeStamp:withTimeStamp. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2623 |
aStream close |
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2624 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2625 |
" |
13756 | 2626 |
self fileOutIn:'/tmp' |
2627 |
self fileOutIn:'/tmp/doesNotExistBla' |
|
2628 |
self fileOutIn:'/tmp' asFilename |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2629 |
" |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2630 |
|
10053 | 2631 |
"Modified: / 19-09-1997 / 00:03:53 / stefan" |
2632 |
"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
|
2633 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2634 |
|
555 | 2635 |
fileOutOn:aStream |
2636 |
"file out my definition and all methods onto aStream" |
|
2637 |
||
2638 |
^ self fileOutOn:aStream withTimeStamp:true |
|
2639 |
||
2640 |
"Created: 15.11.1995 / 12:53:32 / cg" |
|
2046 | 2641 |
"Modified: 3.1.1997 / 17:50:28 / cg" |
555 | 2642 |
! |
2643 |
||
2644 |
fileOutOn:aStream withTimeStamp:stampIt |
|
3339
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2645 |
"file out my definition and all methods onto aStream. |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2646 |
If stampIt is true, a timeStamp comment is prepended." |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2647 |
|
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2648 |
self fileOutOn:aStream withTimeStamp:stampIt withInitialize:true |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2649 |
|
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2650 |
"Modified: / 13.3.1998 / 12:23:02 / cg" |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2651 |
! |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2652 |
|
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2653 |
fileOutOn:aStream withTimeStamp:stampIt withInitialize:initIt |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2654 |
"file out my definition and all methods onto aStream. |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2655 |
If stampIt is true, a timeStamp comment is prepended. |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2656 |
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
|
2657 |
append a corresponding doIt expression for initialization." |
555 | 2658 |
|
8551 | 2659 |
self |
13756 | 2660 |
fileOutOn:aStream |
2661 |
withTimeStamp:stampIt |
|
2662 |
withInitialize:initIt |
|
2663 |
withDefinition:true |
|
2664 |
methodFilter:nil |
|
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2665 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2666 |
"Created: / 15.11.1995 / 12:53:06 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2667 |
"Modified: / 1.4.1997 / 16:01:05 / stefan" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2668 |
"Modified: / 13.3.1998 / 12:23:59 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2669 |
! |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2670 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2671 |
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
|
2672 |
"file out my definition and all methods onto aStream. |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2673 |
If stampIt is true, a timeStamp comment is prepended. |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2674 |
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
|
2675 |
append a corresponding doIt expression for initialization. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2676 |
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
|
2677 |
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
|
2678 |
|
8212 | 2679 |
|encoder any16Bit| |
8164 | 2680 |
|
13508
59531dc7d4e8
changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents:
13507
diff
changeset
|
2681 |
any16Bit := self withAllPrivateClasses contains:[:cls | |
13756 | 2682 |
cls instAndClassMethods contains: |
2683 |
[:m | |
|
2684 |
|src| |
|
2685 |
||
2686 |
src := m source ? ''. |
|
2687 |
(src contains:[:ch | ch codePoint > 16rFF]) |
|
2688 |
]]. |
|
11699 | 2689 |
|
8551 | 2690 |
any16Bit ifTrue:[ |
13756 | 2691 |
encoder := CharacterEncoder encoderForUTF8. |
8075 | 2692 |
]. |
8051
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2693 |
^ self |
13756 | 2694 |
fileOutOn:aStream |
2695 |
withTimeStamp:stampIt |
|
2696 |
withInitialize:initIt |
|
2697 |
withDefinition:withDefinition |
|
2698 |
methodFilter:methodFilter |
|
2699 |
encoder:encoder |
|
13508
59531dc7d4e8
changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents:
13507
diff
changeset
|
2700 |
|
59531dc7d4e8
changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents:
13507
diff
changeset
|
2701 |
"Modified: / 18-07-2011 / 09:17:17 / cg" |
8051
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2702 |
! |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2703 |
|
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2704 |
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
|
2705 |
"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
|
2706 |
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
|
2707 |
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
|
2708 |
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
|
2709 |
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
|
2710 |
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
|
2711 |
|
8230 | 2712 |
self class |
13756 | 2713 |
fileOutOn:outStreamArg |
2714 |
withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition |
|
2715 |
methodFilter:methodFilter encoder:encoderOrNil |
|
8230 | 2716 |
|
555 | 2717 |
|
3339
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2718 |
"Created: / 15.11.1995 / 12:53:06 / cg" |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2719 |
"Modified: / 1.4.1997 / 16:01:05 / stefan" |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2720 |
"Modified: / 13.3.1998 / 12:23:59 / cg" |
555 | 2721 |
! |
2722 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2723 |
fileOutPrimitiveDefinitionsOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2724 |
"append primitive defs (if any) to aStream." |
555 | 2725 |
|
2726 |
|s| |
|
2727 |
||
2728 |
" |
|
2729 |
primitive definitions - if any |
|
2730 |
" |
|
2731 |
(s := self primitiveDefinitionsString) notNil ifTrue:[ |
|
13756 | 2732 |
aStream nextPutChunkSeparator. |
2733 |
self printClassNameOn:aStream. |
|
2734 |
aStream nextPutAll:' primitiveDefinitions'; |
|
2735 |
nextPutChunkSeparator; |
|
2736 |
cr. |
|
2737 |
aStream nextPutAll:s. |
|
2738 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
555 | 2739 |
]. |
2740 |
(s := self primitiveVariablesString) notNil ifTrue:[ |
|
13756 | 2741 |
aStream nextPutChunkSeparator. |
2742 |
self printClassNameOn:aStream. |
|
2743 |
aStream nextPutAll:' primitiveVariables'; |
|
2744 |
nextPutChunkSeparator; |
|
2745 |
cr. |
|
2746 |
aStream nextPutAll:s. |
|
2747 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
555 | 2748 |
]. |
2088
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
2749 |
|
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
2750 |
"Modified: 8.1.1997 / 17:45:40 / cg" |
555 | 2751 |
! |
2752 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2753 |
fileOutPrimitiveSpecsOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2754 |
"append primitive defs (if any) to aStream." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2755 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2756 |
|s| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2757 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2758 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2759 |
primitive definitions - if any |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2760 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2761 |
self fileOutPrimitiveDefinitionsOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2762 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2763 |
primitive functions - if any |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2764 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2765 |
(s := self primitiveFunctionsString) notNil ifTrue:[ |
13756 | 2766 |
aStream nextPutChunkSeparator. |
2767 |
self printClassNameOn:aStream. |
|
2768 |
aStream nextPutAll:' primitiveFunctions'; |
|
2769 |
nextPutChunkSeparator; |
|
2770 |
cr. |
|
2771 |
aStream nextPutAll:s. |
|
2772 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2773 |
]. |
2088
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
2774 |
|
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
2775 |
"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
|
2776 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2777 |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2778 |
!Class methodsFor:'fileOut-binary'! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2779 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2780 |
binaryFileOut |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2781 |
"create a file 'class.cls' (in the current projects fileOut-directory), |
8551 | 2782 |
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
|
2783 |
The methods source is saved by reference |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2784 |
to the classes sourceFile if there is any. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2785 |
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
|
2786 |
browsable." |
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 |
self binaryFileOutWithSourceMode:#reference |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2789 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2790 |
"Modified: 5.1.1997 / 15:40:05 / cg" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2791 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2792 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2793 |
binaryFileOutOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2794 |
"append a binary representation of myself to aStream" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2795 |
|
8551 | 2796 |
self binaryFileOutOn:aStream sourceMode:#reference |
5374
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 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2799 |
binaryFileOutOn:aStream sourceMode:sourceMode |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2800 |
"append a binary representation of myself to aStream in |
8551 | 2801 |
a portable binary format. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2802 |
The argument controls how sources are to be saved: |
13756 | 2803 |
#keep - include the source |
2804 |
#reference - include a reference to the sourceFile |
|
2805 |
#discard - dont save sources. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2806 |
|
8551 | 2807 |
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
|
2808 |
in order to be browsable." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2809 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2810 |
|bos| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2811 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2812 |
bos := BinaryObjectStorage onNew:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2813 |
bos sourceMode:sourceMode. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2814 |
bos nextPutClasses:(Array with:self). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2815 |
bos close. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2816 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2817 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2818 |
binaryFileOutWithSourceMode:sourceMode |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2819 |
"create a file 'class.cls' (in the current projects fileOut-directory), |
8551 | 2820 |
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
|
2821 |
The argument controls how sources are to be saved: |
13756 | 2822 |
#keep - include the source |
2823 |
#reference - include a reference to the sourceFile |
|
2824 |
#discard - dont save sources. |
|
8551 | 2825 |
|
2826 |
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
|
2827 |
in order to be browsable." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2828 |
|
7693 | 2829 |
|fileName dirName| |
2830 |
||
10053 | 2831 |
fileName := (Smalltalk fileNameForClass:self name), '.cls'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2832 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2833 |
Project notNil ifTrue:[ |
13756 | 2834 |
dirName := Project currentProjectDirectory |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2835 |
] ifFalse:[ |
13756 | 2836 |
dirName := '.' |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2837 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2838 |
fileName := dirName asFilename construct:fileName. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2839 |
fileName makeLegalFilename. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2840 |
fileName := fileName name. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2841 |
self binaryFileOutWithSourceMode:sourceMode as:fileName. |
10053 | 2842 |
|
2843 |
"Modified: / 06-10-2006 / 16:16:29 / cg" |
|
5374
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 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2846 |
binaryFileOutWithSourceMode:sourceMode as:fileNameString |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2847 |
"create a file fileNameString, |
8551 | 2848 |
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
|
2849 |
The argument controls how sources are to be saved: |
13756 | 2850 |
#keep - include the source |
2851 |
#reference - include a reference to the sourceFile |
|
2852 |
#discard - dont save sources. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2853 |
|
8551 | 2854 |
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
|
2855 |
in order to be browsable." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2856 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2857 |
|fileName aStream| |
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 |
fileName := fileNameString asFilename. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2860 |
fileName makeLegalFilename. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2861 |
|
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2862 |
[ |
13756 | 2863 |
aStream := fileName newReadWriteStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2864 |
] on:FileStream openErrorSignal do:[:ex| |
13756 | 2865 |
^ FileOutErrorSignal |
2866 |
raiseRequestWith:fileName name |
|
2867 |
errorString:(' - cannot create file:', fileName name) |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2868 |
]. |
8551 | 2869 |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2870 |
aStream binary. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2871 |
self binaryFileOutOn:aStream sourceMode:sourceMode. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2872 |
aStream close. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2873 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2874 |
"Created: / 29.12.1998 / 21:38:38 / cg" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2875 |
! ! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2876 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2877 |
!Class methodsFor:'fileOut-xml'! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2878 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2879 |
fileOutXML |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2880 |
"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
|
2881 |
XML sourceForm. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2882 |
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
|
2883 |
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
|
2884 |
case of errors (for example: disk full)" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2885 |
|
7693 | 2886 |
|dirName nm fileName| |
2887 |
||
2888 |
nm := (Smalltalk fileNameForClass:self name) , '.xml'. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2889 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2890 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2891 |
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
|
2892 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2893 |
Project notNil ifTrue:[ |
13756 | 2894 |
dirName := Project currentProjectDirectory |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2895 |
] ifFalse:[ |
13756 | 2896 |
dirName := Filename currentDirectory |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2897 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2898 |
fileName := (dirName asFilename construct:nm). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2899 |
fileName makeLegalFilename. |
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 |
self fileOutXMLAs:fileName. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2902 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2903 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2904 |
Class fileOutXML |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2905 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2906 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2907 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2908 |
fileOutXMLAllDefinitionsOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2909 |
"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
|
2910 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2911 |
self fileOutXMLDefinitionOn:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2912 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2913 |
"/ here, the full nameSpace prefixes are output, |
8551 | 2914 |
"/ to avoid confusing stc |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2915 |
"/ (which otherwise could not find the correct superclass) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2916 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2917 |
FileOutNameSpaceQuerySignal answer:true do:[ |
13756 | 2918 |
self privateClassesSorted do:[:aClass | |
2919 |
aClass fileOutXMLAllDefinitionsOn:aStream |
|
2920 |
] |
|
5374
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 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2925 |
|
5464 | 2926 |
fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter |
2927 |
|collectionOfCategories| |
|
2928 |
||
2929 |
collectionOfCategories := self class categories asSortedCollection. |
|
2930 |
collectionOfCategories notNil ifTrue:[ |
|
13756 | 2931 |
collectionOfCategories do:[:aCategory | |
2932 |
self class fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2933 |
aStream cr |
|
2934 |
] |
|
5464 | 2935 |
]. |
2936 |
collectionOfCategories := self categories asSortedCollection. |
|
2937 |
collectionOfCategories notNil ifTrue:[ |
|
13756 | 2938 |
collectionOfCategories do:[:aCategory | |
2939 |
self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2940 |
aStream cr |
|
2941 |
] |
|
5464 | 2942 |
]. |
2943 |
||
2944 |
self privateClassesSorted do:[:aClass | |
|
13756 | 2945 |
aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter |
5464 | 2946 |
]. |
2947 |
||
2948 |
! |
|
2949 |
||
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2950 |
fileOutXMLAs:fileNameOrString |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2951 |
"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
|
2952 |
XML sourceForm. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2953 |
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
|
2954 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2955 |
|aStream fileName| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2956 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2957 |
self isLoaded ifFalse:[ |
13756 | 2958 |
^ FileOutErrorSignal |
2959 |
raiseRequestWith:self |
|
2960 |
errorString:' - will not fileOut unloaded class: ', self name |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2961 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2962 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2963 |
fileName := fileNameOrString asFilename. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2964 |
[ |
13756 | 2965 |
aStream := fileName writeStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2966 |
] on:FileStream openErrorSignal do:[:ex| |
13756 | 2967 |
^ FileOutErrorSignal |
2968 |
raiseRequestWith:fileName name |
|
2969 |
errorString:(' - cannot create file: ', fileName name) |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2970 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2971 |
self fileOutXMLOn:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2972 |
aStream close. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2973 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2974 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2975 |
Class fileOutXMLAs:'test.xml' |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2976 |
Class fileOutXMLAs:'/blaDoesNotExist/test.xml' |
5374
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 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2979 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2980 |
fileOutXMLDefinitionOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2981 |
"append an xml expression on aStream, which defines myself." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2982 |
|
6703 | 2983 |
|varNames| |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2984 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2985 |
aStream nextPutLine:'<class>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2986 |
|
5464 | 2987 |
aStream nextPutAll:' <name>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2988 |
aStream nextPutAll:(self nameWithoutPrefix). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2989 |
aStream nextPutLine:'</name>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2990 |
|
5464 | 2991 |
aStream nextPutAll:' <environment>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2992 |
aStream nextPutAll:(self nameSpace name). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2993 |
aStream nextPutLine:'</environment>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2994 |
|
5464 | 2995 |
aStream nextPutAll:' <super>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2996 |
aStream nextPutAll:(self theNonMetaclass superclass name). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2997 |
aStream nextPutLine:'</super>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2998 |
|
5464 | 2999 |
aStream nextPutAll:' <private>'. |
3000 |
aStream nextPutAll:(self isPrivate printString). |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3001 |
aStream nextPutLine:'</private>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3002 |
|
5464 | 3003 |
aStream nextPutAll:' <indexed-type>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3004 |
aStream nextPutAll:'none'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3005 |
aStream nextPutLine:'</indexed-type>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3006 |
|
5464 | 3007 |
aStream nextPutAll:' <inst-vars>'. |
3008 |
varNames := self instVarNames. |
|
3009 |
varNames size > 0 ifTrue:[ |
|
14146 | 3010 |
aStream cr. |
3011 |
varNames do:[:nm | |
|
3012 |
aStream nextPutAll:' <name>'. |
|
3013 |
aStream nextPutAll:nm. |
|
3014 |
aStream nextPutLine:'</name>'. |
|
3015 |
]. |
|
3016 |
aStream nextPutAll:' '. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3017 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3018 |
aStream nextPutLine:'</inst-vars>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3019 |
|
5464 | 3020 |
aStream nextPutAll:' <class-inst-vars>'. |
3021 |
varNames := self class instVarNames. |
|
3022 |
varNames size > 0 ifTrue:[ |
|
14146 | 3023 |
aStream cr. |
3024 |
varNames do:[:nm | |
|
3025 |
aStream nextPutAll:' <name>'. |
|
3026 |
aStream nextPutAll:nm. |
|
3027 |
aStream nextPutLine:'</name>'. |
|
3028 |
]. |
|
3029 |
aStream nextPutAll:' '. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3030 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3031 |
aStream nextPutLine:'</class-inst-vars>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3032 |
|
5464 | 3033 |
aStream nextPutAll:' <imports>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3034 |
aStream nextPutAll:''. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3035 |
aStream nextPutLine:'</imports>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3036 |
|
5464 | 3037 |
aStream nextPutAll:' <category>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3038 |
aStream nextPutAll:self category. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3039 |
aStream nextPutLine:'</category>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3040 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3041 |
aStream nextPutLine:'</class>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3042 |
|
14146 | 3043 |
self classVarNames do:[:nm | |
3044 |
aStream nextPutLine:'<static>'. |
|
3045 |
aStream nextPutAll:' <name>'. |
|
3046 |
aStream nextPutAll:nm. |
|
3047 |
aStream nextPutLine:'</name>'. |
|
3048 |
aStream nextPutAll:' <environment>'. |
|
3049 |
aStream nextPutAll:self name. |
|
3050 |
aStream nextPutLine:'</environment>'. |
|
3051 |
aStream nextPutLine:'</static>'. |
|
5464 | 3052 |
]. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3053 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3054 |
|
8551 | 3055 |
fileOutXMLOn:aStream |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3056 |
"WARNING: untested first version. Not for general use (yet) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3057 |
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
|
3058 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3059 |
self |
13756 | 3060 |
fileOutXMLOn:aStream |
3061 |
withTimeStamp:true |
|
3062 |
withInitialize:true |
|
3063 |
withDefinition:true |
|
3064 |
methodFilter:nil |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3065 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3066 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3067 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3068 |
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
|
3069 |
"WARNING: untested first version. Not for general use (yet) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3070 |
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
|
3071 |
If stampIt is true, a timeStamp comment is prepended. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3072 |
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
|
3073 |
append a corresponding doIt expression for initialization. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3074 |
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
|
3075 |
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
|
3076 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3077 |
|collectionOfCategories copyrightMethod copyrightText comment meta| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3078 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3079 |
self isLoaded ifFalse:[ |
13756 | 3080 |
^ FileOutErrorSignal |
3081 |
raiseRequestWith:self |
|
3082 |
errorString:' - will not fileOut unloaded class: ', self name |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3083 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3084 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3085 |
meta := self class. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3086 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3087 |
aStream nextPutLine:'<?xml version="1.0"?>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3088 |
aStream nextPutLine:'<st-source>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3089 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3090 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3091 |
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
|
3092 |
taking the string from the copyright method. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3093 |
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
|
3094 |
being put on your code ;-). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3095 |
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
|
3096 |
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
|
3097 |
code was edited in the browser and filedOut. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3098 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3099 |
(copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[ |
13756 | 3100 |
" |
3101 |
get the copyright methods source, |
|
3102 |
and insert at beginning. |
|
3103 |
" |
|
3104 |
copyrightText := copyrightMethod source. |
|
3105 |
copyrightText isNil ifTrue:[ |
|
3106 |
" |
|
3107 |
no source available - trigger an error |
|
3108 |
" |
|
3109 |
FileOutErrorSignal |
|
3110 |
raiseRequestWith:' - no source for class: '. |
|
3111 |
^ self |
|
3112 |
]. |
|
3113 |
" |
|
3114 |
strip off the selector-line |
|
3115 |
" |
|
3116 |
copyrightText := copyrightText asCollectionOfLines asStringCollection. |
|
3117 |
copyrightText := copyrightText copyFrom:2 to:(copyrightText size). |
|
3118 |
[copyrightText last isEmpty] whileTrue:[ |
|
3119 |
copyrightText := copyrightText copyWithoutLast:1. |
|
3120 |
]. |
|
3121 |
(copyrightText first = '"') ifTrue:[ |
|
3122 |
(copyrightText last = '"') ifTrue:[ |
|
3123 |
copyrightText := copyrightText copyFrom:2 to:(copyrightText size - 1). |
|
3124 |
] |
|
3125 |
]. |
|
3126 |
copyrightText := copyrightText asString. |
|
3127 |
||
3128 |
aStream nextPutAll:'<copyright>'. |
|
3129 |
self fileOutXMLString:copyrightText on:aStream. |
|
3130 |
aStream nextPutLine:'</copyright>'. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3131 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3132 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3133 |
stampIt ifTrue:[ |
13756 | 3134 |
"/ |
3135 |
"/ first, a timestamp |
|
3136 |
"/ |
|
3137 |
aStream nextPutAll:'<time-stamp>'. |
|
3138 |
self fileOutXMLString:(Smalltalk timeStampString) on:aStream. |
|
3139 |
aStream nextPutLine:'</time-stamp>'. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3140 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3141 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3142 |
withDefinition ifTrue:[ |
13756 | 3143 |
"/ |
3144 |
"/ then the definition |
|
3145 |
"/ |
|
3146 |
self fileOutXMLAllDefinitionsOn:aStream. |
|
3147 |
"/ |
|
3148 |
"/ a comment - if any |
|
3149 |
"/ |
|
3150 |
(comment := self comment) notNil ifTrue:[ |
|
3151 |
aStream nextPutLine:'<comment>'. |
|
3152 |
aStream nextPutAll:'<class-id>'. |
|
3153 |
aStream nextPutAll:(self name). |
|
3154 |
aStream nextPutLine:'</class-id>'. |
|
3155 |
aStream nextPutLine:'</comment>'. |
|
3156 |
]. |
|
3157 |
"/ |
|
3158 |
"/ primitive definitions - if any |
|
3159 |
"/ |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3160 |
"/ self fileOutPrimitiveSpecsOn:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3161 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3162 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3163 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3164 |
"/ 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
|
3165 |
"/ 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
|
3166 |
"/ avoid sourcePosition-shifts when checked out later. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3167 |
"/ (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
|
3168 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3169 |
collectionOfCategories := meta categories asSortedCollection. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3170 |
collectionOfCategories notNil ifTrue:[ |
13756 | 3171 |
collectionOfCategories do:[:aCategory | |
3172 |
meta fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
3173 |
] |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3174 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3175 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3176 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3177 |
"/ methods from all categories in myself |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3178 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3179 |
collectionOfCategories := self categories asSortedCollection. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3180 |
collectionOfCategories notNil ifTrue:[ |
13756 | 3181 |
collectionOfCategories do:[:aCategory | |
3182 |
self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
3183 |
] |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3184 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3185 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3186 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3187 |
"/ any private classes' methods |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3188 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3189 |
self privateClassesSorted do:[:aClass | |
13756 | 3190 |
aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3191 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3192 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3193 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3194 |
initIt ifTrue:[ |
13756 | 3195 |
"/ |
3196 |
"/ optionally an initialize message |
|
3197 |
"/ |
|
3198 |
(meta includesSelector:#initialize) ifTrue:[ |
|
3199 |
aStream nextPutLine:'<initialize>'. |
|
3200 |
aStream nextPutAll:'<class-id>'. |
|
3201 |
aStream nextPutAll:(self name). |
|
3202 |
aStream nextPutLine:'</class-id>'. |
|
3203 |
aStream nextPutLine:'</initialize>'. |
|
3204 |
] |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3205 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3206 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3207 |
aStream nextPutLine:'</st-source>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3208 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3209 |
" |
8551 | 3210 |
Class |
13756 | 3211 |
fileOutXMLOn:'test.xml' asFilename writeStream |
3212 |
withTimeStamp:true |
|
3213 |
withInitialize:true |
|
3214 |
withDefinition:true |
|
3215 |
methodFilter:nil |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3216 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3217 |
! ! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3218 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3219 |
!Class methodsFor:'printOut'! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3220 |
|
2482 | 3221 |
htmlDocumentation |
8356 | 3222 |
<resource: #obsolete> |
7227
5df22f2ffebc
htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents:
7222
diff
changeset
|
3223 |
self obsoleteMethodWarning:'use HTMLDocGenerator htmlDocOf:'. |
5df22f2ffebc
htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents:
7222
diff
changeset
|
3224 |
|
2482 | 3225 |
^ HTMLDocGenerator htmlDocOf:self |
3226 |
||
3227 |
"Created: 22.3.1997 / 14:18:23 / cg" |
|
3228 |
! |
|
3229 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3230 |
printClassVarNamesOn:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3231 |
"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
|
3232 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3233 |
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
|
3234 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3235 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3236 |
printFullHierarchyOn:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3237 |
"print myself and all subclasses on aStream. |
8551 | 3238 |
recursively calls itself to print subclasses. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3239 |
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
|
3240 |
|
1996
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3241 |
|nm| |
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3242 |
|
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3243 |
nm := self name. |
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3244 |
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
|
3245 |
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
|
3246 |
aStream nextPutLine:')'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3247 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3248 |
(self subclasses sort:[:a :b | a name < b name]) do:[:aSubclass | |
13756 | 3249 |
aSubclass printFullHierarchyOn:aStream indent:(indent + 2) |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3250 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3251 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3252 |
"|printStream| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3253 |
printStream := Printer new. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3254 |
Object printFullHierarchyOn:printStream indent:0. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3255 |
printStream close" |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3256 |
|
1996
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3257 |
"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
|
3258 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3259 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3260 |
printOutDefinitionOn:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3261 |
"print out my definition" |
1 | 3262 |
|
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
3263 |
|comment s superclass| |
333 | 3264 |
|
8551 | 3265 |
aPrintStream nextPutAll:'class '; bold; nextPutLine:self name; normal. |
1 | 3266 |
aPrintStream nextPutAll:'superclass '. |
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
3267 |
superclass := self superclass. |
1 | 3268 |
superclass isNil ifTrue:[ |
13756 | 3269 |
s := 'Object' |
1 | 3270 |
] ifFalse:[ |
13756 | 3271 |
s := superclass name |
1 | 3272 |
]. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3273 |
aPrintStream nextPutLine:s. |
1 | 3274 |
|
3275 |
aPrintStream nextPutAll:'instance Variables '. |
|
3276 |
self printInstVarNamesOn:aPrintStream indent:21. |
|
8551 | 3277 |
aPrintStream cr. |
1 | 3278 |
|
3279 |
aPrintStream nextPutAll:'class Variables '. |
|
3280 |
self printClassVarNamesOn:aPrintStream indent:21. |
|
3281 |
aPrintStream cr. |
|
3282 |
||
3283 |
category notNil ifTrue:[ |
|
13756 | 3284 |
aPrintStream nextPutAll:'category '; |
3285 |
nextPutLine:(category printString). |
|
1 | 3286 |
]. |
3287 |
||
193 | 3288 |
(comment := self comment) notNil ifTrue:[ |
13756 | 3289 |
aPrintStream cr; nextPutLine:'comment:'; italic; nextPutLine:comment; normal |
1 | 3290 |
] |
733
983d045c17f5
make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
3291 |
|
983d045c17f5
make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
3292 |
"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
|
3293 |
"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
|
3294 |
"Modified: 1.4.1997 / 16:01:26 / stefan" |
1 | 3295 |
! |
3296 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3297 |
printOutOn:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3298 |
"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
|
3299 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3300 |
|collectionOfCategories| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3301 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3302 |
self printOutDefinitionOn:aPrintStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3303 |
aPrintStream cr. |
3937 | 3304 |
collectionOfCategories := self class categories asSortedCollection. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3305 |
collectionOfCategories notNil ifTrue:[ |
13756 | 3306 |
aPrintStream nextPutLine:'class protocol'. |
3307 |
aPrintStream cr. |
|
3308 |
collectionOfCategories do:[:aCategory | |
|
3309 |
self class printOutCategory:aCategory on:aPrintStream |
|
3310 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3311 |
]. |
3937 | 3312 |
collectionOfCategories := self categories asSortedCollection. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3313 |
collectionOfCategories notNil ifTrue:[ |
13756 | 3314 |
aPrintStream nextPutLine:'instance protocol'. |
3315 |
aPrintStream cr. |
|
3316 |
collectionOfCategories do:[:aCategory | |
|
3317 |
self printOutCategory:aCategory on:aPrintStream |
|
3318 |
] |
|
555 | 3319 |
] |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3320 |
|
3937 | 3321 |
"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
|
3322 |
! |
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3323 |
|
12903 | 3324 |
printOutProtocolOn:aPrintStream |
3325 |
"{ Pragma: +optSpace }" |
|
3326 |
||
3327 |
|collectionOfCategories| |
|
3328 |
||
3329 |
self printOutDefinitionOn:aPrintStream. |
|
3330 |
aPrintStream cr. |
|
3331 |
collectionOfCategories := self class categories asSortedCollection. |
|
3332 |
collectionOfCategories notNil ifTrue:[ |
|
13756 | 3333 |
aPrintStream nextPutLine:'class protocol'. |
3334 |
aPrintStream cr. |
|
3335 |
collectionOfCategories do:[:aCategory | |
|
3336 |
self class printOutCategoryProtocol:aCategory on:aPrintStream |
|
3337 |
] |
|
12903 | 3338 |
]. |
3339 |
collectionOfCategories := self categories asSortedCollection. |
|
3340 |
collectionOfCategories notNil ifTrue:[ |
|
13756 | 3341 |
aPrintStream nextPutLine:'instance protocol'. |
3342 |
aPrintStream cr. |
|
3343 |
collectionOfCategories do:[:aCategory | |
|
3344 |
self printOutCategoryProtocol:aCategory on:aPrintStream |
|
3345 |
] |
|
12903 | 3346 |
] |
3347 |
||
3348 |
"Modified: / 25.11.1998 / 12:40:38 / cg" |
|
3349 |
! |
|
3350 |
||
8551 | 3351 |
printSharedPoolNamesOn:aStream indent:indent |
3352 |
"print the pool names indented and breaking at line end" |
|
3353 |
||
13214 | 3354 |
self printNameArray:(self sharedPoolNames) on:aStream indent:indent |
3355 |
||
3356 |
"Modified: / 18-01-2011 / 17:56:16 / cg" |
|
8551 | 3357 |
! |
3358 |
||
5938
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3359 |
storeOn:aStream |
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3360 |
"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
|
3361 |
|
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3362 |
aStream nextPutAll:self name |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3363 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3364 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3365 |
!Class methodsFor:'private-accessing'! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3366 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3367 |
attributes |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3368 |
"return the extra class attributes or nil" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3369 |
|
12259 | 3370 |
attributes isNil ifTrue:[^ nil]. |
8551 | 3371 |
^ self classAttributes |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3372 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3373 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3374 |
attributes:aClassAttributesObject |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3375 |
"set the extra class attributes" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3376 |
|
8551 | 3377 |
self classAttributes:aClassAttributesObject |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3378 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3379 |
|
7486 | 3380 |
classAttributes |
12259 | 3381 |
"return the extra class attributes or create them if nil. |
12219
dd55372693c1
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
12197
diff
changeset
|
3382 |
Notice that the stc-compiler is too stupid to generate instances of ClassAttributes directly; |
dd55372693c1
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
12197
diff
changeset
|
3383 |
therefore, it generates arrays which are converted here, when we first access the attribute." |
7486 | 3384 |
|
12259 | 3385 |
attributes isNil ifTrue:[ |
13756 | 3386 |
attributes := ClassAttributes new. |
12259 | 3387 |
] ifFalse:[ |
13756 | 3388 |
attributes isArray ifTrue:[ |
3389 |
attributes := ClassAttributes new fromSTCPrimitiveArray:attributes. |
|
3390 |
]. |
|
7486 | 3391 |
]. |
12219
dd55372693c1
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
12197
diff
changeset
|
3392 |
^ attributes |
7486 | 3393 |
! |
3394 |
||
3395 |
classAttributes:aClassAttributesObject |
|
3396 |
"set the extra class attributes" |
|
3397 |
||
3398 |
attributes := aClassAttributesObject |
|
3399 |
! |
|
3400 |
||
12903 | 3401 |
flushSubclasses |
3402 |
subclasses := nil |
|
3403 |
! |
|
3404 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3405 |
getAttribute:aKey |
12259 | 3406 |
"get an attribute (by symbolic key)" |
3407 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3408 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3409 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3410 |
attributes isNil ifTrue:[ ^ nil]. |
13715 | 3411 |
^ self classAttributes valueFor:aKey |
3412 |
||
3413 |
"Modified: / 23-09-2011 / 10:23:45 / cg" |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3414 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3415 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3416 |
getSourceChunkAttribute:aKey |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3417 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3418 |
|
7472 | 3419 |
|pos stream string| |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3420 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3421 |
pos := self getAttribute:aKey. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3422 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3423 |
"the attribute is either a string, or an integer specifying the |
7472 | 3424 |
position within the classes sourcefile ..." |
3425 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3426 |
pos isNumber ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3427 |
"/ classFilename notNil ifTrue:[ |
13756 | 3428 |
stream := self sourceStream. |
3429 |
stream notNil ifTrue:[ |
|
3430 |
stream position0Based:pos. |
|
3431 |
string := stream nextChunk. |
|
3432 |
stream close. |
|
3433 |
^ string |
|
3434 |
]. |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3435 |
"/ ]. |
13756 | 3436 |
^ nil |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3437 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3438 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3439 |
^ pos |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3440 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3441 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3442 |
setAttribute:key to:aValue |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3443 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3444 |
|
7486 | 3445 |
self classAttributes perform:(key , ':') asSymbol with:aValue |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3446 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3447 |
|
12903 | 3448 |
setName:aString |
3449 |
"set the classes name - be careful, it will be still |
|
3450 |
in the Smalltalk dictionary - under another key. |
|
3451 |
This is NOT for general use - see renameTo:" |
|
3452 |
||
3453 |
environment := nil. |
|
3454 |
name := aString |
|
3455 |
||
3456 |
"Created: 1.4.1997 / 15:46:01 / stefan" |
|
3457 |
! |
|
3458 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3459 |
setPrimitiveDefinitions:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3460 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3461 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3462 |
"set the primitiveDefinition string (no change notifications)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3463 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3464 |
^ self setAttribute:#primitiveDefinitions to:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3465 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3466 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3467 |
setPrimitiveFunctions:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3468 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3469 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3470 |
"set the primitiveFunction string (no change notifications)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3471 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3472 |
^ self setAttribute:#primitiveFunctions to:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3473 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3474 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3475 |
setPrimitiveVariables:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3476 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3477 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3478 |
"set the primitiveVariable string (no change notifications)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3479 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3480 |
^ 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
|
3481 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3482 |
|
13221
11f21a9fb78d
added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents:
13214
diff
changeset
|
3483 |
setSharedPoolNames:aStringOrCollection |
8551 | 3484 |
"{ Pragma: +optSpace }" |
3485 |
||
3486 |
"set the sharedPools string (no change notifications)" |
|
3487 |
||
3488 |
^ self setAttribute:#sharedPools to:aStringOrCollection |
|
13221
11f21a9fb78d
added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents:
13214
diff
changeset
|
3489 |
|
11f21a9fb78d
added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents:
13214
diff
changeset
|
3490 |
"Created: / 18-01-2011 / 20:41:09 / cg" |
8551 | 3491 |
! |
3492 |
||
12903 | 3493 |
setSubclasses:aCollection |
3494 |
subclasses := aCollection |
|
3495 |
||
3496 |
"Created: / 28-04-2010 / 08:48:49 / cg" |
|
3497 |
! |
|
3498 |
||
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3499 |
setSuperclass:aClass |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3500 |
"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
|
3501 |
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
|
3502 |
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
|
3503 |
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
|
3504 |
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
|
3505 |
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
|
3506 |
|
12903 | 3507 |
superclass := aClass |
3508 |
||
3509 |
"Modified: / 28-04-2010 / 08:49:07 / cg" |
|
3510 |
! |
|
3511 |
||
3512 |
updateAllCachedSubclasses |
|
13860 | 3513 |
|subclassesPerClass seqNr makeNewSet| |
3514 |
||
3515 |
makeNewSet := [Set new]. |
|
12903 | 3516 |
|
3517 |
subclassesPerClass := Dictionary new. |
|
3518 |
Smalltalk allClassesDo:[:each | |
|
13860 | 3519 |
|cls superclass| |
3520 |
||
3521 |
cls := each theNonMetaclass. |
|
3522 |
(superclass := each superclass) notNil ifTrue:[ |
|
3523 |
(subclassesPerClass at:superclass ifAbsentPut:makeNewSet) add:cls |
|
3524 |
]. |
|
3525 |
subclassesPerClass at:cls ifAbsentPut:makeNewSet. |
|
12689
834adbd43cc1
comment/format in: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents:
12633
diff
changeset
|
3526 |
]. |
13860 | 3527 |
|
3528 |
SubclassCacheSequenceNumber isNil ifTrue:[ |
|
3529 |
SubclassCacheSequenceNumber := 0. |
|
3530 |
]. |
|
3531 |
seqNr := SubclassCacheSequenceNumber. |
|
12903 | 3532 |
subclassesPerClass keysAndValuesDo:[:cls :subclasses | |
13860 | 3533 |
|coll| |
3534 |
||
3535 |
coll := ArrayWithSequenceNumberValidation withAll:subclasses. |
|
3536 |
coll sequenceNumber:seqNr. |
|
3537 |
cls setSubclasses:coll. |
|
12903 | 3538 |
]. |
3539 |
||
3540 |
" |
|
3541 |
Class updateAllCachedSubclasses |
|
13861 | 3542 |
Array subclasses |
12903 | 3543 |
" |
3544 |
||
3545 |
"Created: / 28-04-2010 / 08:47:20 / cg" |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3546 |
! ! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3547 |
|
7258 | 3548 |
!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
|
3549 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3550 |
addChangeRecordForChangeCategory:category to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3551 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3552 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3553 |
"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
|
3554 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3555 |
self printClassNameOn:aStream. |
14146 | 3556 |
aStream nextPutAll:' category:'. |
3557 |
category storeOn:aStream. |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3558 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3559 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3560 |
"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
|
3561 |
"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
|
3562 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3563 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3564 |
addChangeRecordForClass:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3565 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3566 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3567 |
"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
|
3568 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3569 |
aClass isLoaded ifTrue:[ |
13756 | 3570 |
aClass basicFileOutDefinitionOn:aStream withNameSpace:true. |
3571 |
aStream nextPutChunkSeparator. |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3572 |
] |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3573 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3574 |
"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
|
3575 |
"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
|
3576 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3577 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3578 |
addChangeRecordForClassComment:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3579 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3580 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3581 |
"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
|
3582 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3583 |
aClass fileOutCommentOn:aStream. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3584 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3585 |
"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
|
3586 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3587 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3588 |
addChangeRecordForClassInstvars:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3589 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3590 |
|
5225
d74b4c895376
comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents:
5190
diff
changeset
|
3591 |
"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
|
3592 |
|
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8267
diff
changeset
|
3593 |
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
|
3594 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3595 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3596 |
|
7179 | 3597 |
addChangeRecordForClassRemove:oldClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3598 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3599 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3600 |
"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
|
3601 |
|
14146 | 3602 |
aStream |
3603 |
nextPutAll:'Smalltalk removeClass:'; |
|
3604 |
nextPutAll:oldClass name; |
|
3605 |
nextPutChunkSeparator. |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3606 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3607 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3608 |
addChangeRecordForClassRename:oldName to:newName to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3609 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3610 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3611 |
"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
|
3612 |
|
14146 | 3613 |
aStream |
3614 |
nextPutAll:'Smalltalk renameClass:'; |
|
3615 |
nextPutAll:oldName |
|
3616 |
nextPutAll:' to:''' |
|
3617 |
nextPutAll:newName |
|
3618 |
nextPutAll:''''; |
|
3619 |
nextPutChunkSeparator. |
|
1846 | 3620 |
|
3621 |
"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
|
3622 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3623 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3624 |
addChangeRecordForPrimitiveDefinitions:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3625 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3626 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3627 |
"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
|
3628 |
|
8551 | 3629 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveDefinitions:'''; |
13756 | 3630 |
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
|
3631 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3632 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3633 |
"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
|
3634 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3635 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3636 |
addChangeRecordForPrimitiveFunctions:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3637 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3638 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3639 |
"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
|
3640 |
|
8551 | 3641 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveFunctions:'''; |
13756 | 3642 |
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
|
3643 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3644 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3645 |
"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
|
3646 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3647 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3648 |
addChangeRecordForPrimitiveVariables:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3649 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3650 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3651 |
"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
|
3652 |
|
8551 | 3653 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveVariables:'''; |
13756 | 3654 |
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
|
3655 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3656 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3657 |
"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
|
3658 |
! ! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3659 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3660 |
!Class methodsFor:'queries'! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3661 |
|
9815 | 3662 |
canHaveExtensions |
3663 |
"return true, if this class allows extensions from other packages. |
|
3664 |
Private classes, namespaces and projectDefinitions dont allow this" |
|
3665 |
||
3666 |
^ self isPrivate not |
|
3667 |
||
3668 |
" |
|
3669 |
Smalltalk allClasses select:[:each | each canHaveExtensions not] |
|
3670 |
" |
|
3671 |
||
3672 |
"Created: / 30-08-2006 / 15:27:53 / cg" |
|
3673 |
! |
|
3674 |
||
8167 | 3675 |
classResources |
8185 | 3676 |
self isPrivate ifTrue:[ |
13756 | 3677 |
^ self owningClass classResources |
8185 | 3678 |
]. |
9930 | 3679 |
^ ResourcePack for:self cached:true. |
3680 |
||
3681 |
"Modified: / 18-09-2006 / 20:37:16 / cg" |
|
8167 | 3682 |
! |
3683 |
||
10084 | 3684 |
extensions |
3685 |
"return a collection of extension-methods from any package, or empty if there are none." |
|
3686 |
||
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3687 |
|extensions classPackage| |
10084 | 3688 |
|
3689 |
classPackage := self package. |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3690 |
self instAndClassMethodsDo:[:mthd | |
13756 | 3691 |
mthd package ~= classPackage ifTrue:[ |
3692 |
extensions isNil ifTrue:[ |
|
3693 |
extensions := OrderedCollection new. |
|
3694 |
]. |
|
3695 |
extensions add:mthd |
|
3696 |
]. |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3697 |
]. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3698 |
^ extensions ? #() |
10084 | 3699 |
|
3700 |
" |
|
3701 |
CType extensions |
|
3702 |
Rectangle extensions |
|
3703 |
Rectangle hasExtensions |
|
3704 |
" |
|
3705 |
||
3706 |
"Created: / 12-10-2006 / 18:29:51 / cg" |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3707 |
"Modified: / 05-03-2007 / 17:12:04 / cg" |
10084 | 3708 |
! |
3709 |
||
9494 | 3710 |
extensionsFrom:aPackageID |
3711 |
"return the set of extension-methods from the given package." |
|
3712 |
||
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3713 |
|extensions| |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3714 |
|
10084 | 3715 |
aPackageID = self package ifTrue:[^ #() ]. |
13756 | 3716 |
self instAndClassMethodsDo:[:mthd | |
3717 |
mthd package = aPackageID ifTrue:[ |
|
3718 |
extensions isNil ifTrue:[ |
|
3719 |
extensions := OrderedCollection new. |
|
3720 |
]. |
|
3721 |
extensions add:mthd |
|
3722 |
]. |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3723 |
]. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3724 |
^ extensions ? #() |
9494 | 3725 |
|
3726 |
" |
|
10084 | 3727 |
CType extensionsFrom:#'bosch:dapasx' |
13756 | 3728 |
Rectangle extensionsFrom:#'bosch:dapasx/support' |
10084 | 3729 |
Rectangle extensions |
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3730 |
Class extensions |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3731 |
Class extensionsFrom:#'stx:libboss' |
9494 | 3732 |
" |
3733 |
||
3734 |
"Created: / 07-08-2006 / 22:02:15 / fm" |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3735 |
"Modified: / 06-03-2007 / 11:54:53 / cg" |
9494 | 3736 |
! |
3737 |
||
5545 | 3738 |
hasExtensions |
3739 |
"return true, if there are methods in the receiver, which belong to |
|
3740 |
a different package (i.e. package of class ~= package of method). |
|
3741 |
Those are class extensions, which must be treated specially when checking classes |
|
8551 | 3742 |
into the sourceCode repository. (extensions are stored separate)" |
5545 | 3743 |
|
6166 | 3744 |
|clsPkg defaultPkg| |
3745 |
||
12219
dd55372693c1
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
12197
diff
changeset
|
3746 |
defaultPkg := PackageId noProjectID. |
6166 | 3747 |
clsPkg := self package. |
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3748 |
self instAndClassMethodsDo:[:mthd | |
13756 | 3749 |
|mthdPkg| |
3750 |
(((mthdPkg := mthd package) ~= clsPkg) and:[ mthdPkg ~= defaultPkg ]) ifTrue:[^ true ]. |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3751 |
]. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3752 |
^ false |
5545 | 3753 |
|
3754 |
" |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3755 |
Time millisecondsToRun:[ |
13756 | 3756 |
Smalltalk allClasses select:[:each | each hasExtensions] |
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3757 |
]. 190 130 260 |
10084 | 3758 |
|
13756 | 3759 |
Dictionary |
3760 |
withAssociations: |
|
3761 |
(Smalltalk allClasses |
|
3762 |
select:[:each | each hasExtensions] |
|
3763 |
thenCollect:[:each | each -> each extensions]) |
|
5545 | 3764 |
" |
10084 | 3765 |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3766 |
"Modified: / 05-03-2007 / 17:06:20 / cg" |
5545 | 3767 |
! |
3768 |
||
5659 | 3769 |
hasExtensionsFrom:aPackageID |
3770 |
"return true, if there are methods in the receiver, which belong to |
|
3771 |
the package with aPackageID (i.e. package of class ~= package of method). |
|
3772 |
Those are class extensions, which must be treated specially when checking classes |
|
8551 | 3773 |
into the sourceCode repository. (extensions are stored separate)" |
5659 | 3774 |
|
10084 | 3775 |
|clsPkg| |
3776 |
||
3777 |
clsPkg := self package. |
|
14146 | 3778 |
aPackageID = clsPkg ifTrue:[^ false]. |
10084 | 3779 |
|
13756 | 3780 |
self instAndClassMethodsDo:[:mthd | |
14146 | 3781 |
mthd package = aPackageID ifTrue:[ ^ true]. |
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3782 |
]. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3783 |
^ false |
5659 | 3784 |
|
3785 |
" |
|
13756 | 3786 |
Smalltalk allClasses |
14146 | 3787 |
select:[:each | each hasExtensionsFrom:'stx:goodies/refactyBrowser'] |
13756 | 3788 |
Smalltalk allClasses |
14146 | 3789 |
select:[:each | each hasExtensionsFrom:'stx:libboss'] |
5659 | 3790 |
" |
10084 | 3791 |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
3792 |
"Modified: / 06-03-2007 / 11:55:39 / cg" |
5659 | 3793 |
! |
3794 |
||
12415 | 3795 |
hasUnsavedChanges |
3796 |
"return true, if there are changes for this class in the current changeSet" |
|
3797 |
||
3798 |
^ ChangeSet current includesChangeForClassOrMetaclassOrPrivateClassOf:self |
|
3799 |
||
3800 |
" |
|
3801 |
Class hasUnsavedChanges |
|
3802 |
Array hasUnsavedChanges |
|
3803 |
" |
|
3804 |
! |
|
3805 |
||
10042
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
3806 |
isBrowserStartable |
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
3807 |
"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
|
3808 |
which can be started from the browser" |
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
3809 |
|
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
3810 |
^ 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
|
3811 |
|
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
3812 |
"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
|
3813 |
! |
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
3814 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3815 |
isClass |
8551 | 3816 |
"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
|
3817 |
(a real class, not just behavior); |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3818 |
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
|
3819 |
See also Behavior>>isBehavior." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3820 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3821 |
^ true |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3822 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3823 |
" |
8551 | 3824 |
Point isClass |
3825 |
1 isClass |
|
3826 |
Behavior new isBehavior |
|
3827 |
Behavior new isClass |
|
3828 |
Class new isBehavior |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3829 |
Class new isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3830 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3831 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3832 |
|
8933 | 3833 |
isJavaScriptClass |
8936 | 3834 |
^ self class isJavaScriptMetaclass |
8933 | 3835 |
! |
3836 |
||
6723 | 3837 |
isStartableWithMain |
3838 |
"return true, if this is an application class, |
|
3839 |
which can be started via #main" |
|
3840 |
||
3841 |
^ self theMetaclass includesSelector:#main |
|
3842 |
||
3843 |
"Created: / 2.11.2001 / 09:37:01 / cg" |
|
3844 |
"Modified: / 2.11.2001 / 09:48:05 / cg" |
|
3845 |
! |
|
3846 |
||
8756 | 3847 |
isStartableWithStart |
3848 |
"return true, if this is an application class, |
|
3849 |
which can be started via #start" |
|
3850 |
||
3851 |
^ self theMetaclass includesSelector:#start |
|
3852 |
! |
|
3853 |
||
11382 | 3854 |
packageDirectory |
11413 | 3855 |
"return the packageDirectory of this classes package. |
3856 |
That is usually the directory where my source is, and where package specific additional |
|
3857 |
files (bitmaps, resources etc.) are found." |
|
3858 |
||
11382 | 3859 |
^ Smalltalk getPackageDirectoryForPackage:self package. |
3860 |
||
3861 |
" |
|
13756 | 3862 |
self packageDirectory |
3863 |
stx_libbasic3 packageDirectory |
|
3864 |
Array packageDirectory |
|
11382 | 3865 |
" |
3866 |
! |
|
3867 |
||
2568
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3868 |
rootsOfTheWorld |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3869 |
"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
|
3870 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3871 |
|set| |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3872 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3873 |
set := IdentitySet new. |
8551 | 3874 |
Smalltalk allClassesDo:[:aClass | |
13756 | 3875 |
aClass superclass isNil ifTrue:[set add:aClass] |
2568
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3876 |
]. |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3877 |
^ set asOrderedCollection |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3878 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3879 |
" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3880 |
Class rootsOfTheWorld |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3881 |
" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3882 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3883 |
"Modified: 18.4.1997 / 20:55:34 / cg" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3884 |
! |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3885 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3886 |
wasAutoloaded |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3887 |
"return true, if this class came into the system via an |
555 | 3888 |
autoload; false otherwise. |
3889 |
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
|
3890 |
Autoload. The interface here is for your convenience." |
555 | 3891 |
|
3892 |
^ 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
|
3893 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3894 |
"Modified: 21.3.1996 / 16:27:09 / cg" |
555 | 3895 |
! |
3896 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3897 |
whichClassDefinesClassVar:aVariableName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3898 |
"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
|
3899 |
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
|
3900 |
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
|
3901 |
many throw away intermediate objects." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3902 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3903 |
|cls| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3904 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3905 |
cls := self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3906 |
[cls notNil] whileTrue:[ |
13756 | 3907 |
(cls classVarNames includes:aVariableName) ifTrue:[ ^ cls]. |
3908 |
cls := cls superclass |
|
556 | 3909 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3910 |
^ nil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3911 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3912 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3913 |
StandardSystemView whichClassDefinesClassVar:'ErrorSignal' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3914 |
StandardSystemView whichClassDefinesClassVar:'Foo' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3915 |
" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3916 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3917 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3918 |
!Class methodsFor:'renaming'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3919 |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3920 |
makePrivateIn:newOwner |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3921 |
"make a private class of newOwner from the receiver; |
5612 | 3922 |
the receiver must be a public class. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3923 |
Returns the new private class." |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3924 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3925 |
|sel newClass| |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3926 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3927 |
self owningClass notNil ifTrue:[ |
13756 | 3928 |
^ self |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3929 |
]. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3930 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3931 |
sel := self definitionSelectorPrivate. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3932 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3933 |
newClass := self superclass |
13756 | 3934 |
perform:sel |
3935 |
withArguments:(Array |
|
3936 |
with:(self nameWithoutPrefix asSymbol) |
|
3937 |
with:(self instanceVariableString) |
|
3938 |
with:(self classVariableString) |
|
3939 |
with:'' |
|
3940 |
with:newOwner). |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3941 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3942 |
"/ copy over methods ... |
6023 | 3943 |
ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class. |
3944 |
ClassBuilder copyInvalidatedMethodsFrom:self for:newClass. |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3945 |
newClass class recompileInvalidatedMethods. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3946 |
newClass recompileInvalidatedMethods. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3947 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3948 |
newOwner changed:#newClass with:newClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3949 |
Smalltalk changed:#newClass with:newClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3950 |
|
2835 | 3951 |
self removeFromSystem. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3952 |
^ newClass |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3953 |
|
3494
23a6cf28b3a6
fixed makePrivate, if newOwner is in a nameSpace
Claus Gittinger <cg@exept.de>
parents:
3407
diff
changeset
|
3954 |
"Modified: / 29.5.1998 / 19:03:49 / cg" |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3955 |
! |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3956 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3957 |
makePublic |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3958 |
"make a public class from the receiver. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3959 |
The receiver must be a private class. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3960 |
Returns the new public class." |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3961 |
|
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3962 |
^ self makePublicIn:Smalltalk |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3963 |
! |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3964 |
|
9417 | 3965 |
makePublicIn:newNameSpace |
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3966 |
"make a public class from the receiver. |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3967 |
The receiver must be a private class. |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3968 |
Returns the new public class." |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3969 |
|
9417 | 3970 |
|sel owner baseName newName newClass| |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3971 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3972 |
owner := self topOwningClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3973 |
owner isNil ifTrue:[^ self]. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3974 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3975 |
"/ first, create the public class ... |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3976 |
sel := self definitionSelector. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3977 |
|
9417 | 3978 |
Class nameSpaceQuerySignal answer:newNameSpace |
3044 | 3979 |
do:[ |
13756 | 3980 |
baseName := self nameWithoutPrefix. |
9417 | 3981 |
"/ (newNameSpace isNil or:[newNameSpace == Smalltalk]) ifTrue:[ |
3982 |
"/ newName := baseName |
|
3983 |
"/ ] ifFalse:[ |
|
3984 |
"/ newName := newNameSpace name , '::' , baseName |
|
3985 |
"/ ]. |
|
13756 | 3986 |
newName := baseName. |
3987 |
||
3988 |
newClass := self superclass |
|
3989 |
perform:sel |
|
3990 |
withArguments:(Array |
|
3991 |
with:(newName asSymbol) |
|
3992 |
with:(self instanceVariableString) |
|
3993 |
with:(self classVariableString) |
|
3994 |
with:'' |
|
3995 |
with:(owner category)). |
|
3996 |
||
3997 |
"/ copy over methods ... |
|
3998 |
ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class. |
|
3999 |
ClassBuilder copyInvalidatedMethodsFrom:self for:newClass. |
|
4000 |
newClass class recompileInvalidatedMethods. |
|
4001 |
newClass recompileInvalidatedMethods. |
|
3044 | 4002 |
]. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4003 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4004 |
owner changed:#newClass with:newClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4005 |
Smalltalk changed:#newClass with:newClass. |
9417 | 4006 |
(newNameSpace notNil and:[newNameSpace ~~ Smalltalk]) ifTrue:[ |
13756 | 4007 |
newNameSpace changed:#newClass with:newClass. |
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
4008 |
]. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4009 |
|
2835 | 4010 |
self removeFromSystem. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4011 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4012 |
^ newClass |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4013 |
|
9417 | 4014 |
"Created: / 23-06-1997 / 13:28:52 / cg" |
4015 |
"Modified: / 04-07-2006 / 16:27:12 / cg" |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4016 |
! |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4017 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4018 |
renameTo:newName |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4019 |
"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
|
4020 |
|
5863 | 4021 |
<resource:#obsolete> |
4022 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4023 |
|oldSym newSym| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4024 |
|
2835 | 4025 |
"/ the code below is obsolete - it does not deal with |
4026 |
"/ classVariables, private classes and does not |
|
5863 | 4027 |
"/ recompile other classes in order to care for namespace |
2835 | 4028 |
"/ changes. |
3702 | 4029 |
"/ Please use Smalltalk>>renameClass:to:, |
4030 |
"/ which deals with all of that. |
|
4031 |
self obsoleteMethodWarning:'use Smalltalk>>renameClass:to:'. |
|
2835 | 4032 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4033 |
oldSym := name asSymbol. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4034 |
newSym := newName asSymbol. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4035 |
self setName:newSym. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4036 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4037 |
Smalltalk at:oldSym put:nil. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4038 |
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
|
4039 |
Smalltalk at:newSym put:self. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4040 |
|
3702 | 4041 |
"Created: / 1.4.1997 / 15:27:53 / stefan" |
4042 |
"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
|
4043 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4044 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4045 |
!Class methodsFor:'signature checking'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4046 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4047 |
classinstSizeFromSignature:aSignature |
8551 | 4048 |
"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
|
4049 |
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
|
4050 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4051 |
^ (aSignature bitShift:-7) bitAnd:7 |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4052 |
|
12840 | 4053 |
" |
4054 |
Class classinstSizeFromSignature:16r100. 2 |
|
4055 |
Class classinstSizeFromSignature:16r180. 3 |
|
4056 |
" |
|
4057 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4058 |
"Created: 1.4.1997 / 15:23:01 / stefan" |
556 | 4059 |
! |
4060 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4061 |
instNameKeyFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4062 |
"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
|
4063 |
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
|
4064 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4065 |
^ (aSignature bitShift:-14) bitAnd:16rFFFF |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4066 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4067 |
" |
8551 | 4068 |
Point instNameKeyFromSignature:Point signature. |
4069 |
Association instNameKeyFromSignature:Association signature. |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4070 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4071 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4072 |
"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
|
4073 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4074 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4075 |
instSizeFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4076 |
"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
|
4077 |
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
|
4078 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4079 |
^ aSignature bitAnd:16r7F |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4080 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4081 |
" |
8551 | 4082 |
Class instSizeFromSignature:Point signature. |
4083 |
Class instSizeFromSignature:Association signature. |
|
4084 |
Class instSizeFromSignature:Dictionary signature. |
|
12840 | 4085 |
Class instSizeFromSignature:16r100. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4086 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4087 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4088 |
"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
|
4089 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4090 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4091 |
instTypeFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4092 |
"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
|
4093 |
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
|
4094 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4095 |
^ (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
|
4096 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4097 |
" |
8551 | 4098 |
Class instTypeFromSignature:Object signature. |
4099 |
Class instTypeFromSignature:Array signature. |
|
4100 |
Class instTypeFromSignature:String signature. |
|
4101 |
Class instTypeFromSignature:OrderedCollection signature. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4102 |
" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4103 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4104 |
"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
|
4105 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4106 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4107 |
signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4108 |
"return a signature number - this number is useful for a quick |
8551 | 4109 |
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
|
4110 |
and the dynamic class loader. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4111 |
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
|
4112 |
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
|
4113 |
(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
|
4114 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4115 |
|value "{ Class: SmallInteger }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4116 |
nameKey "{ Class: SmallInteger }" | |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4117 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4118 |
signature notNil ifTrue:[^ signature]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4119 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4120 |
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
|
4121 |
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
|
4122 |
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
|
4123 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4124 |
nameKey := 0. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4125 |
self allInstVarNames do:[:name | |
13756 | 4126 |
nameKey := nameKey bitShift:1. |
4127 |
(nameKey bitAnd:16r10000) ~~ 0 ifTrue:[ |
|
4128 |
nameKey := nameKey bitXor:1. |
|
4129 |
nameKey := nameKey bitAnd:16rFFFF. |
|
4130 |
]. |
|
4131 |
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
|
4132 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4133 |
value := value + (nameKey bitShift:14). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4134 |
signature := value. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4135 |
^ value |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4136 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4137 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4138 |
Array signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4139 |
ByteArray signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4140 |
View signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4141 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4142 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4143 |
"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
|
4144 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4145 |
|
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
|
4146 |
!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
|
4147 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4148 |
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
|
4149 |
"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
|
4150 |
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
|
4151 |
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
|
4152 |
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
|
4153 |
|
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4154 |
|owner info c| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4155 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4156 |
(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
|
4157 |
|
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4158 |
revision notNil ifTrue:[ |
13756 | 4159 |
c := revision first. |
4160 |
c == $$ ifTrue:[ |
|
4161 |
info := Class revisionInfoFromString:revision. |
|
4162 |
info isNil ifTrue:[^ '0']. |
|
4163 |
^ (info revision) ? '0'. |
|
4164 |
]. |
|
4165 |
c isDigit ifFalse:[ |
|
4166 |
^ '0' |
|
4167 |
]. |
|
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4168 |
]. |
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4169 |
|
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 |
^ 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
|
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 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4173 |
Object binaryRevision |
953
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4174 |
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
|
4175 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4176 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4177 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4178 |
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
|
4179 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4180 |
|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
|
4181 |
|
8551 | 4182 |
classes := Smalltalk allClasses |
13756 | 4183 |
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
|
4184 |
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
|
4185 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4186 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4187 |
"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
|
4188 |
"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
|
4189 |
"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
|
4190 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4191 |
|
13474 | 4192 |
binaryRevisionString |
4193 |
"return the revision-ID from which the class was stc-compiled; |
|
4194 |
nil if its an autoloaded or filedIn class. |
|
4195 |
If a classes binary is up-to-date w.r.t. the source repository, |
|
4196 |
the returned string is the same as the one returned by #revision." |
|
4197 |
||
4198 |
^ revision |
|
4199 |
||
4200 |
" |
|
4201 |
Object binaryRevisionString |
|
4202 |
Object class binaryRevisionString |
|
4203 |
" |
|
4204 |
||
4205 |
" |
|
4206 |
to find all classes which are not up-to-date: |
|
4207 |
||
4208 |
|classes| |
|
4209 |
||
4210 |
classes := Smalltalk allClasses |
|
13756 | 4211 |
select:[:cls | cls binaryRevision notNil and:[cls binaryRevision ~= cls revision]]. |
13474 | 4212 |
SystemBrowser browseClasses:classes title:'classes which are not up-to-date' |
4213 |
" |
|
4214 |
||
4215 |
"Modified: / 01-04-1997 / 23:33:01 / stefan" |
|
4216 |
"Modified: / 22-10-2008 / 20:37:05 / cg" |
|
4217 |
"Created: / 01-07-2011 / 10:55:03 / cg" |
|
4218 |
! |
|
4219 |
||
5183 | 4220 |
currentSourceStream |
4221 |
"return an open stream on the current source of the receiver" |
|
4222 |
||
4223 |
|theWriteStream theCurrentSource| |
|
4224 |
||
8222
f2c454a9a038
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
8212
diff
changeset
|
4225 |
theWriteStream := String writeStream. |
5183 | 4226 |
Method flushSourceStreamCache. |
4227 |
self fileOutOn:theWriteStream withTimeStamp:false. |
|
4228 |
theCurrentSource := theWriteStream contents asString. |
|
4229 |
theWriteStream close. |
|
4230 |
^ theCurrentSource |
|
4231 |
||
4232 |
"Modified: 15.10.1996 / 18:59:40 / cg" |
|
4233 |
"Modified: 1.4.1997 / 14:33:12 / stefan" |
|
4234 |
! |
|
4235 |
||
12103 | 4236 |
findVersionMethod |
4237 |
"{ Pragma: +optSpace }" |
|
4238 |
||
4239 |
"return my revision method. Either this is the sourceCodeManager-specific versionMethod, |
|
4240 |
or the fallBack (for backward compatibility)" |
|
4241 |
||
13342 | 4242 |
|owner| |
12103 | 4243 |
|
4244 |
(owner := self owningClass) notNil ifTrue:[^ owner findVersionMethod]. |
|
13342 | 4245 |
^ self findVersionMethodOfManager:self sourceCodeManager |
4246 |
||
4247 |
" |
|
4248 |
Smalltalk allClassesDo:[:cls | |
|
13756 | 4249 |
Transcript show:cls name; show:' -> '; showCR:cls findVersionMethod |
13342 | 4250 |
]. |
4251 |
||
13756 | 4252 |
Number findVersionMethod |
4253 |
FileDirectory findVersionMethod |
|
4254 |
Metaclass findVersionMethod |
|
4255 |
Class findVersionMethod |
|
13342 | 4256 |
" |
4257 |
||
4258 |
"Modified: / 19-04-2011 / 13:30:42 / cg" |
|
4259 |
! |
|
4260 |
||
4261 |
findVersionMethodOfManager:aSourceCodemanagerOrNil |
|
4262 |
"{ Pragma: +optSpace }" |
|
4263 |
||
4264 |
"return my revision method. Either this is the sourceCodeManager-specific versionMethod, |
|
4265 |
or the fallBack (for backward compatibility)" |
|
4266 |
||
13755 | 4267 |
|owner cls meta allVersionMethodNames nameOfVersionMethodForManager nameOfOldVersionMethod |
4268 |
tryVersionFromVersionMethod| |
|
13342 | 4269 |
|
4270 |
(owner := self owningClass) notNil ifTrue:[^ owner findVersionMethodOfManager:aSourceCodemanagerOrNil]. |
|
12103 | 4271 |
|
13756 | 4272 |
tryVersionFromVersionMethod := |
14146 | 4273 |
[:versionMethodsName | |
4274 |
|aVersionMethod val| |
|
4275 |
||
4276 |
aVersionMethod := meta compiledMethodAt:versionMethodsName. |
|
4277 |
(aVersionMethod notNil and:[aVersionMethod isExecutable]) ifTrue:[ |
|
4278 |
"/ |
|
4279 |
"/ if it's a method returning the version string, |
|
4280 |
"/ that's the returned value |
|
4281 |
"/ |
|
4282 |
val := cls perform:versionMethodsName. |
|
4283 |
val isString ifTrue:[^ aVersionMethod]. |
|
4284 |
]. |
|
4285 |
]. |
|
13755 | 4286 |
|
12103 | 4287 |
meta := self theMetaclass. |
4288 |
cls := self theNonMetaclass. |
|
4289 |
||
13755 | 4290 |
allVersionMethodNames := meta methodDictionary keys select:[:sel | sel startsWith:AbstractSourceCodeManager prefixOfVersionMethodSelector]. |
4291 |
||
13342 | 4292 |
aSourceCodemanagerOrNil notNil ifTrue:[ |
14146 | 4293 |
nameOfVersionMethodForManager := aSourceCodemanagerOrNil nameOfVersionMethodInClasses. |
4294 |
(allVersionMethodNames includes:nameOfVersionMethodForManager) ifTrue:[ |
|
4295 |
tryVersionFromVersionMethod value:nameOfVersionMethodForManager |
|
4296 |
]. |
|
4297 |
||
4298 |
"/ only trust the oldVersion method, iff there is no other scv-version |
|
4299 |
"/ (i.e. do not misuse an svn-checked-in #version as a version_cvs) |
|
4300 |
(allVersionMethodNames copyWithout:nameOfVersionMethodForManager) notEmpty ifTrue:[ |
|
4301 |
^ nil |
|
4302 |
]. |
|
13756 | 4303 |
]. |
13755 | 4304 |
|
4305 |
nameOfOldVersionMethod := self nameOfOldVersionMethod. |
|
4306 |
tryVersionFromVersionMethod value:nameOfOldVersionMethod. |
|
4307 |
||
12103 | 4308 |
^ nil. |
4309 |
||
4310 |
" |
|
4311 |
Smalltalk allClassesDo:[:cls | |
|
14146 | 4312 |
Transcript show:cls name; show:' -> '; showCR:cls findVersionMethod |
12103 | 4313 |
]. |
4314 |
||
13756 | 4315 |
Number findVersionMethod |
4316 |
FileDirectory findVersionMethod |
|
4317 |
Metaclass findVersionMethod |
|
4318 |
Class findVersionMethod |
|
12103 | 4319 |
" |
13342 | 4320 |
|
4321 |
"Created: / 19-04-2011 / 13:30:05 / cg" |
|
12103 | 4322 |
! |
4323 |
||
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4324 |
localSourceStreamFor:sourceFile |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4325 |
"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
|
4326 |
|
5073 | 4327 |
|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
|
4328 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4329 |
"/ |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4330 |
"/ old: look in 'source/<filename>' |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4331 |
"/ 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
|
4332 |
"/ classes in her currentDirectory. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4333 |
"/ |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4334 |
fileName := Smalltalk getSourceFileName:sourceFile. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4335 |
fileName notNil ifTrue:[ |
13756 | 4336 |
^ fileName asFilename readStreamOrNil. |
3165
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
4337 |
]. |
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
4338 |
|
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
4339 |
(package := self package) notNil ifTrue:[ |
13756 | 4340 |
"/ newest scheme ... |
4341 |
packageDir := Smalltalk findPackageDirectoryForPackage:package. |
|
4342 |
packageDir notNil ifTrue:[ |
|
4343 |
"/ present there ? |
|
4344 |
packageDir := packageDir asFilename. |
|
4345 |
(fn := packageDir construct:sourceFile) exists ifTrue:[ |
|
4346 |
^ fn readStreamOrNil. |
|
4347 |
]. |
|
4348 |
||
4349 |
"/ a source subdirectory ? |
|
4350 |
fn := (packageDir construct:'source') construct:sourceFile. |
|
4351 |
fn exists ifTrue:[ |
|
4352 |
^ fn readStreamOrNil. |
|
4353 |
]. |
|
4354 |
||
4355 |
"/ a zip-file ? |
|
4356 |
fn := (packageDir construct:'source.zip'). |
|
4357 |
fn exists ifTrue:[ |
|
4358 |
zar := ZipArchive oldFileNamed:fn. |
|
4359 |
zar notNil ifTrue:[ |
|
4360 |
entry := zar extract:sourceFile. |
|
4361 |
entry notNil ifTrue:[ |
|
4362 |
^ entry asString readStream |
|
4363 |
] |
|
4364 |
] |
|
4365 |
] |
|
4366 |
]. |
|
4367 |
||
4368 |
"/ will vanish ... |
|
4369 |
(package includes:$:) ifTrue:[ |
|
4370 |
package := package asString copyReplaceAll:$: with:$/ |
|
4371 |
] ifFalse:[ |
|
4372 |
package := 'stx/' , package |
|
4373 |
]. |
|
4374 |
fileName := Smalltalk getSourceFileName:(package , '/' , sourceFile). |
|
4375 |
fileName notNil ifTrue:[ |
|
4376 |
^ fileName asFilename readStreamOrNil. |
|
4377 |
]. |
|
4378 |
(package startsWith:'stx/') ifTrue:[ |
|
4379 |
fileName := Smalltalk getSourceFileName:((package copyFrom:5) , '/' , sourceFile). |
|
4380 |
fileName notNil ifTrue:[ |
|
4381 |
^ fileName asFilename readStreamOrNil. |
|
4382 |
] |
|
4383 |
] |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4384 |
]. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4385 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4386 |
"/ |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4387 |
"/ new: look in 'source/<module>/<package>/<filename> |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4388 |
"/ 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
|
4389 |
"/ obsolete. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4390 |
info := self packageSourceCodeInfo. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4391 |
info notNil ifTrue:[ |
13756 | 4392 |
module := info at:#module ifAbsent:nil. |
4393 |
module notNil ifTrue:[ |
|
4394 |
dir := info at:#directory ifAbsent:nil. |
|
4395 |
dir notNil ifTrue:[ |
|
4396 |
fn := (module asFilename construct:dir) construct:sourceFile. |
|
4397 |
fileName := Smalltalk getSourceFileName:(fn name). |
|
4398 |
fileName notNil ifTrue:[ |
|
4399 |
^ fileName asFilename readStreamOrNil. |
|
4400 |
]. |
|
4401 |
||
4402 |
"/ brand new: look for source/<module>/package.zip |
|
4403 |
"/ containing an entry for <filename> |
|
4404 |
||
4405 |
fn := (module asFilename construct:dir) withSuffix:'zip'. |
|
4406 |
fileName := Smalltalk getSourceFileName:(fn name). |
|
4407 |
fileName notNil ifTrue:[ |
|
4408 |
zar := ZipArchive oldFileNamed:fileName. |
|
4409 |
zar notNil ifTrue:[ |
|
4410 |
entry := zar extract:sourceFile. |
|
4411 |
entry notNil ifTrue:[ |
|
4412 |
^ entry asString readStream |
|
4413 |
] |
|
4414 |
] |
|
4415 |
]. |
|
4416 |
||
4417 |
"/ and also in source/source.zip ... |
|
4418 |
||
4419 |
fileName := Smalltalk getSourceFileName:'source.zip'. |
|
4420 |
fileName notNil ifTrue:[ |
|
4421 |
zar := ZipArchive oldFileNamed:fileName. |
|
4422 |
zar notNil ifTrue:[ |
|
4423 |
entry := zar extract:sourceFile. |
|
4424 |
entry notNil ifTrue:[ |
|
4425 |
^ entry asString readStream |
|
4426 |
] |
|
4427 |
] |
|
4428 |
]. |
|
4429 |
] |
|
4430 |
] |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4431 |
]. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4432 |
^ nil |
3165
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
4433 |
|
3657 | 4434 |
"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
|
4435 |
! |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4436 |
|
13461
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4437 |
nameOfOldVersionMethod |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4438 |
"this is now more or less obsolete, as multiple sourceCodeManagers might use |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4439 |
different version_XXX methods. Currently, we keep this for backward compatibility. |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4440 |
As classes are checked in, using the new source code manager, these methods will |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4441 |
be removed and replaced by version_XXX methods (one per manager)." |
13342 | 4442 |
|
7174
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4443 |
^ #version |
13342 | 4444 |
|
4445 |
"Modified: / 19-04-2011 / 13:42:18 / cg" |
|
7174
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4446 |
! |
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4447 |
|
13461
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4448 |
nameOfVersionMethod |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4449 |
"this is now more or less obsolete, as multiple sourceCodeManagers might use |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4450 |
different version_XXX methods. Keep this for backward compatibility. |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4451 |
As classes are checked in using the new source code manager, these methods will |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4452 |
be removed and replaced by version_XXX methods (one per manager)." |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4453 |
|
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4454 |
self obsoleteMethodWarning. |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4455 |
^ self nameOfOldVersionMethod |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4456 |
|
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4457 |
"Modified: / 19-04-2011 / 13:42:18 / cg" |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4458 |
! |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4459 |
|
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 |
packageSourceCodeInfo |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4461 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4462 |
|
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
|
4463 |
"return the sourceCodeInfo, which defines the module and the subdirectory |
8551 | 4464 |
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
|
4465 |
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
|
4466 |
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
|
4467 |
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
|
4468 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4469 |
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
|
4470 |
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
|
4471 |
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
|
4472 |
(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
|
4473 |
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
|
4474 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4475 |
By convention, this info is encoded in the classes package |
8551 | 4476 |
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
|
4477 |
The info consists of 1 to 3 subcomponents, separated by colons. |
8551 | 4478 |
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
|
4479 |
the second defines the subdirectory within that module, the third |
8551 | 4480 |
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
|
4481 |
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
|
4482 |
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
|
4483 |
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
|
4484 |
(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
|
4485 |
|
8551 | 4486 |
For example: |
14146 | 4487 |
'....(libbasic)' -> module: stx directory: libbasic library: libbasic |
4488 |
'....(stx:libbasic)' -> module: stx directory: libbasic library: libbasic |
|
4489 |
'....(stx:foo:libbfoo)' -> module: stx directory: foo library: libfoo |
|
4490 |
'....(aeg:libIECInterface)' -> module: aeg directory: libIECInterface library:libIECInterface |
|
4491 |
'....(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
|
4492 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4493 |
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
|
4494 |
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
|
4495 |
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
|
4496 |
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
|
4497 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4498 |
Caveat: |
14146 | 4499 |
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
|
4500 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4501 |
|
8551 | 4502 |
|owner sourceInfo packageString idx1 idx2 |
4116 | 4503 |
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
|
4504 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4505 |
(owner := self owningClass) notNil ifTrue:[^ owner packageSourceCodeInfo]. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4506 |
|
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
|
4507 |
package isNil ifTrue:[^ nil]. |
12219
dd55372693c1
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
12197
diff
changeset
|
4508 |
package == (PackageId 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
|
4509 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4510 |
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
|
4511 |
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
|
4512 |
idx1 ~~ 0 ifTrue:[ |
14146 | 4513 |
idx2 := packageString indexOf:$) startingAt:idx1+1. |
4514 |
idx2 ~~ 0 ifTrue:[ |
|
4515 |
sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1 |
|
4516 |
] |
|
2453
603af5a4e0fc
handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents:
2444
diff
changeset
|
4517 |
] ifFalse:[ |
14146 | 4518 |
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
|
4519 |
]. |
2453
603af5a4e0fc
handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents:
2444
diff
changeset
|
4520 |
|
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
|
4521 |
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
|
4522 |
components := sourceInfo asCollectionOfSubstringsSeparatedBy:$:. |
14146 | 4523 |
components notEmpty ifTrue:[ |
2958
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
4524 |
"/ moduleString := 'stx'. |
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
4525 |
"/ directoryString := libraryString := ''. |
14146 | 4526 |
^ nil |
2454 | 4527 |
]. |
4116 | 4528 |
|
4529 |
component1 := components at:1. |
|
2454 | 4530 |
components size == 1 ifTrue:[ |
14146 | 4531 |
"/ a single name given - the module becomes 'stx' or |
4532 |
"/ the very first directory component (if such a module exists). |
|
4533 |
"/ If the component includes slashes, its the directory |
|
4534 |
"/ otherwise the library. |
|
4535 |
"/ |
|
4536 |
dirComponents := Filename components:component1. |
|
4537 |
(dirComponents size > 1 |
|
4538 |
and:[(mgr := self sourceCodeManager) notNil |
|
4539 |
and:[mgr checkForExistingModule:dirComponents first]]) ifTrue:[ |
|
4540 |
moduleString := dirComponents first. |
|
4541 |
directoryString := libraryString := (Filename fromComponents:(dirComponents copyFrom:2)) asString. |
|
4542 |
] ifFalse:[ |
|
4543 |
"/ non-existing; assume directory under the stx package. |
|
4544 |
moduleString := 'stx'. |
|
4545 |
(component1 startsWith:'stx/') ifTrue:[ |
|
4546 |
component1 := component1 copyFrom:5 |
|
4547 |
]. |
|
4548 |
directoryString := libraryString := component1. |
|
4549 |
]. |
|
4550 |
||
4551 |
(libraryString includes:$/) ifTrue:[ |
|
4552 |
libraryString := libraryString asFilename baseName |
|
4553 |
] |
|
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
|
4554 |
] ifFalse:[ |
14146 | 4555 |
moduleString := component1. |
4556 |
component2 := components at:2. |
|
4557 |
directoryString := component2. |
|
4558 |
components size == 2 ifTrue:[ |
|
4559 |
"/ two components - assume its the module and the directory; |
|
4560 |
"/ the library is assumed to be named after the directory |
|
4561 |
"/ except, if slashes are in the name; then the libraryname |
|
4562 |
"/ is the last component. |
|
4563 |
"/ |
|
4564 |
libraryString := component2. |
|
4565 |
(libraryString includes:$/) ifTrue:[ |
|
4566 |
libraryString := libraryString asFilename baseName |
|
4567 |
] |
|
4568 |
] ifFalse:[ |
|
4569 |
"/ all components given |
|
4570 |
libraryString := components at:3. |
|
4571 |
] |
|
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
|
4572 |
]. |
2454 | 4573 |
|
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
|
4574 |
libraryString isEmpty ifTrue:[ |
14146 | 4575 |
directoryString notEmpty ifTrue:[ |
4576 |
libraryString := directoryString asFilename baseName |
|
4577 |
]. |
|
4578 |
libraryString isEmpty ifTrue:[ |
|
4579 |
"/ lets extract the library from the liblist file ... |
|
4580 |
libraryString := Smalltalk libraryFileNameOfClass:self. |
|
4581 |
libraryString isNil ifTrue:[^ nil]. |
|
4582 |
] |
|
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
|
4583 |
]. |
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 |
|
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 |
moduleString isEmpty ifTrue:[ |
14146 | 4586 |
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
|
4587 |
]. |
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 |
directoryString isEmpty ifTrue:[ |
14146 | 4589 |
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
|
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 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4592 |
^ IdentityDictionary |
14146 | 4593 |
with:(#module->moduleString) |
4594 |
with:(#directory->directoryString) |
|
4595 |
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
|
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 |
" |
8551 | 4598 |
Object packageSourceCodeInfo |
4599 |
View packageSourceCodeInfo |
|
4600 |
Model packageSourceCodeInfo |
|
4601 |
BinaryObjectStorage packageSourceCodeInfo |
|
4602 |
MemoryMonitor packageSourceCodeInfo |
|
4603 |
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
|
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 |
|
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 |
"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
|
4607 |
"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
|
4608 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4609 |
|
8770 | 4610 |
projectDirectory |
13756 | 4611 |
"return my projects directory - thats where the sources, binaries, classLib, |
8770 | 4612 |
resources etc. are typically found." |
4613 |
||
4614 |
^ Smalltalk projectDirectoryForClass:self |
|
4615 |
||
4616 |
" |
|
4617 |
Object projectDirectory |
|
4618 |
View projectDirectory |
|
4619 |
ApplicationModel projectDirectory |
|
4620 |
" |
|
4621 |
! |
|
4622 |
||
7866 | 4623 |
resourceDirectory |
4624 |
"return the directory where my resource file is supposed to live. |
|
4625 |
Here, take the package and assume that a directory named 'resources' exists |
|
4626 |
in my package directory. |
|
4627 |
Return nil, if no such directory exists." |
|
4628 |
||
10102 | 4629 |
^ Smalltalk resourceDirectoryForPackage:(self package) |
7866 | 4630 |
|
4631 |
" |
|
8551 | 4632 |
Object resourceDirectory |
4633 |
View resourceDirectory |
|
4634 |
ApplicationModel resourceDirectory |
|
7866 | 4635 |
" |
10102 | 4636 |
|
4637 |
"Modified: / 19-10-2006 / 23:08:37 / cg" |
|
7866 | 4638 |
! |
4639 |
||
3248
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4640 |
resourcePackName |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4641 |
"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
|
4642 |
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
|
4643 |
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
|
4644 |
The default here is the classes name - this can be redefined in classes |
10102 | 4645 |
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
|
4646 |
|
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4647 |
^ self name |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4648 |
|
10102 | 4649 |
"Created: / 29-01-1998 / 22:20:12 / cg" |
4650 |
"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
|
4651 |
! |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4652 |
|
8267 | 4653 |
resourcePackage |
4654 |
"return the package from where my resources are loaded. |
|
4655 |
By default, that is the classes package." |
|
4656 |
||
4657 |
^ self package |
|
4658 |
! |
|
4659 |
||
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
|
4660 |
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
|
4661 |
"return the revision-ID of the class which corresponds to the |
13474 | 4662 |
scm-version-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
|
4663 |
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
|
4664 |
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
|
4665 |
the old revision, while logically, the class has the new (checked-in) revision. |
8551 | 4666 |
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
|
4667 |
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
|
4668 |
|
13622 | 4669 |
^ self revisionOfManager:self sourceCodeManager |
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
|
4670 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4671 |
" |
8551 | 4672 |
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
|
4673 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4674 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4675 |
"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
|
4676 |
"Modified: / 26-03-1997 / 00:14:00 / stefan" |
13622 | 4677 |
"Modified: / 04-09-2011 / 11:03: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
|
4678 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4679 |
|
2582 | 4680 |
revisionDateString |
4681 |
"return the revision-Date of the class as a string. |
|
4682 |
This is extracted from the version string." |
|
4683 |
||
4684 |
|info| |
|
4685 |
||
4686 |
info := self revisionInfo. |
|
4687 |
info notNil ifTrue:[ |
|
13756 | 4688 |
^ (info date) ? '??/??/??' |
2582 | 4689 |
]. |
4690 |
^ '??/??/??' |
|
4691 |
||
4692 |
" |
|
8551 | 4693 |
Object revisionDateString |
2582 | 4694 |
" |
4695 |
||
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4696 |
"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
|
4697 |
"Modified: / 22-10-2008 / 20:38:25 / cg" |
2582 | 4698 |
! |
4699 |
||
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
|
4700 |
revisionInfo |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4701 |
"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
|
4702 |
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
|
4703 |
The revisionInfo contains all or a subset of: |
13756 | 4704 |
binaryRevision - the revision upon which the binary of this class is based |
4705 |
revision - the revision upon which the class is based logically |
|
4706 |
(different, if a changed class was checked in, but not yet recompiled) |
|
4707 |
user - the user who checked in the logical revision |
|
4708 |
date - the date when the logical revision was checked in |
|
4709 |
time - the time when the logical revision was checked in |
|
4710 |
fileName - the classes source file name |
|
4711 |
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
|
4712 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4713 |
|
13342 | 4714 |
^ self revisionInfoOfManager:self sourceCodeManager |
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
|
4715 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4716 |
" |
8551 | 4717 |
Object revisionString |
4718 |
Object revisionInfo |
|
4719 |
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
|
4720 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4721 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4722 |
"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
|
4723 |
"Modified: / 26-03-1997 / 00:13:17 / stefan" |
13342 | 4724 |
"Modified: / 19-04-2011 / 13:41:24 / cg" |
4725 |
! |
|
4726 |
||
4727 |
revisionInfoOfManager:aSourceCodemanagerOrNil |
|
4728 |
"return an object filled with revision info. |
|
4729 |
This extracts the relevant info from the revisionString. |
|
4730 |
The revisionInfo contains all or a subset of: |
|
13756 | 4731 |
binaryRevision - the revision upon which the binary of this class is based |
4732 |
revision - the revision upon which the class is based logically |
|
4733 |
(different, if a changed class was checked in, but not yet recompiled) |
|
4734 |
user - the user who checked in the logical revision |
|
4735 |
date - the date when the logical revision was checked in |
|
4736 |
time - the time when the logical revision was checked in |
|
4737 |
fileName - the classes source file name |
|
4738 |
repositoryPath - the classes source container |
|
13342 | 4739 |
" |
4740 |
||
4741 |
|vsnString info| |
|
4742 |
||
4743 |
aSourceCodemanagerOrNil notNil ifTrue:[ |
|
13756 | 4744 |
vsnString := self revisionStringOfManager:aSourceCodemanagerOrNil. |
13342 | 4745 |
]. |
4746 |
vsnString isNil ifTrue:[ |
|
13756 | 4747 |
vsnString := self revisionStringOfManager:nil. |
13342 | 4748 |
]. |
4749 |
vsnString isNil ifTrue:[^ nil]. |
|
4750 |
||
4751 |
aSourceCodemanagerOrNil notNil ifTrue:[ |
|
13756 | 4752 |
info := aSourceCodemanagerOrNil revisionInfoFromString:vsnString inClass:self |
13342 | 4753 |
] ifFalse:[ |
13756 | 4754 |
info := Class revisionInfoFromString:vsnString. |
13342 | 4755 |
]. |
4756 |
info notNil ifTrue:[ |
|
13756 | 4757 |
info binaryRevision:self binaryRevision. |
13342 | 4758 |
]. |
4759 |
^ info |
|
4760 |
||
4761 |
" |
|
4762 |
Object revisionString |
|
4763 |
Object revisionInfo |
|
4764 |
Image revisionInfo |
|
4765 |
" |
|
4766 |
||
4767 |
"Modified: / 26-03-1997 / 00:13:17 / stefan" |
|
4768 |
"Created: / 19-04-2011 / 13:41:13 / 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
|
4769 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4770 |
|
13622 | 4771 |
revisionOfManager:aSourceCodemanagerOrNil |
4772 |
"return the revision-ID of the class which corresponds to the |
|
4773 |
scm-version-id of the source to which this class is equivalent. |
|
4774 |
Initially, this is the same as #binaryRevision; however, once changes have |
|
4775 |
been checked into a source repository, the binary continues to remain based upon |
|
4776 |
the old revision, while logically, the class has the new (checked-in) revision. |
|
4777 |
To check if a source corresponds to a compiled binary, compare this |
|
4778 |
ID with the one returned by #binaryRevision." |
|
4779 |
||
4780 |
|info| |
|
4781 |
||
4782 |
info := self revisionInfoOfManager:aSourceCodemanagerOrNil. |
|
4783 |
info notNil ifTrue:[ |
|
13756 | 4784 |
^ info revision |
13622 | 4785 |
]. |
4786 |
^ nil "/ ^ self binaryRevision |
|
4787 |
||
4788 |
" |
|
4789 |
Object revision |
|
4790 |
" |
|
4791 |
||
4792 |
"Modified: / 26-03-1997 / 00:14:00 / stefan" |
|
4793 |
"Modified (comment): / 01-07-2011 / 10:57:16 / cg" |
|
4794 |
"Created: / 04-09-2011 / 11:03:34 / cg" |
|
4795 |
! |
|
4796 |
||
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
|
4797 |
revisionString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4798 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4799 |
|
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
|
4800 |
"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
|
4801 |
classes #version method. Either this is a method returning that string, |
12014 | 4802 |
or it's 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
|
4803 |
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
|
4804 |
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
|
4805 |
|
13342 | 4806 |
^ self revisionStringOfManager:nil |
4807 |
||
4808 |
" |
|
4809 |
Smalltalk allClassesDo:[:cls | |
|
13756 | 4810 |
Transcript show:cls name; show:' -> '; showCR:cls revisionString |
13342 | 4811 |
]. |
4812 |
||
4813 |
Number revisionString |
|
4814 |
FileDirectory revisionString |
|
4815 |
Metaclass revisionString |
|
4816 |
" |
|
4817 |
||
4818 |
"Created: / 29-10-1995 / 19:28:03 / cg" |
|
4819 |
"Modified: / 01-04-1997 / 23:37:25 / stefan" |
|
4820 |
"Modified: / 07-02-2001 / 18:03:39 / ps" |
|
4821 |
"Modified: / 19-04-2011 / 13:38:07 / cg" |
|
4822 |
! |
|
4823 |
||
4824 |
revisionStringOfManager:aSourceCodeManagerOrNil |
|
4825 |
"{ Pragma: +optSpace }" |
|
4826 |
||
4827 |
"return my revision string; that one is extracted from the |
|
4828 |
classes #version method. Either this is a method returning that string, |
|
4829 |
or it's a comment-only method and the comment defines the version. |
|
4830 |
If the receiver is unloaded, or the source is not accessable, |
|
4831 |
or no such method exists, then nil is returned." |
|
4832 |
||
12103 | 4833 |
|owner versionMethod| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4834 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4835 |
(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
|
4836 |
|
13342 | 4837 |
versionMethod := self findVersionMethodOfManager:aSourceCodeManagerOrNil. |
12103 | 4838 |
versionMethod notNil ifTrue:[ |
13756 | 4839 |
^ versionMethod valueWithReceiver:(self theNonMetaclass) arguments:#() |
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
|
4840 |
]. |
12014 | 4841 |
^ 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
|
4842 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4843 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4844 |
Smalltalk allClassesDo:[:cls | |
13756 | 4845 |
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
|
4846 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4847 |
|
8551 | 4848 |
Number revisionString |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4849 |
FileDirectory revisionString |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4850 |
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
|
4851 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4852 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4853 |
"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
|
4854 |
"Modified: / 07-02-2001 / 18:03:39 / ps" |
13342 | 4855 |
"Created: / 19-04-2011 / 13:37:42 / 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
|
4856 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4857 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4858 |
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
|
4859 |
"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
|
4860 |
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
|
4861 |
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
|
4862 |
(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
|
4863 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4864 |
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
|
4865 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4866 |
"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
|
4867 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4868 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4869 |
setPackageFromRevision |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4870 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4871 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4872 |
"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
|
4873 |
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
|
4874 |
(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
|
4875 |
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
|
4876 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4877 |
|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
|
4878 |
|
1756 | 4879 |
self owningClass notNil ifTrue:[^ self]. |
4880 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4881 |
mgr := self sourceCodeManager. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4882 |
mgr notNil ifTrue:[ |
13756 | 4883 |
info := mgr sourceInfoOfClass:self. |
4884 |
||
4885 |
info notNil ifTrue:[ |
|
4886 |
mod := info at:#module ifAbsent:nil. "/ stx, aeg, <your-organization> |
|
4887 |
dir := info at:#directory ifAbsent:nil. "/ libbasic, libtool ... |
|
4888 |
lib := info at:#library ifAbsent:dir. |
|
4889 |
||
4890 |
p := ''. |
|
4891 |
mod notNil ifTrue:[ |
|
4012
e87e53bc45a6
when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents:
3997
diff
changeset
|
4892 |
"/ mod ~= 'stx' ifTrue:[ |
13756 | 4893 |
p := p , mod |
4012
e87e53bc45a6
when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents:
3997
diff
changeset
|
4894 |
"/ ] |
13756 | 4895 |
]. |
4896 |
dir notNil ifTrue:[ |
|
4897 |
p notEmpty ifTrue:[p := p , ':']. |
|
4898 |
p := p , dir. |
|
4899 |
] ifFalse:[ |
|
4900 |
lib notNil ifTrue:[ |
|
4901 |
p notEmpty ifTrue:[p := p , ':']. |
|
4902 |
p := p , lib. |
|
4903 |
]. |
|
4904 |
]. |
|
4905 |
(p notEmpty and:[p ~= package]) ifTrue:[ |
|
2072
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4906 |
"/ package notNil ifTrue:[ |
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4907 |
"/ (name , ': changing packageID from ''' , package , ''' to ''' , p , '''') infoPrintCR. |
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4908 |
"/ ]. |
13756 | 4909 |
package := p. |
4910 |
||
4911 |
self methodDictionary do:[:aMethod | |
|
4912 |
aMethod package isNil ifTrue:[ |
|
4913 |
aMethod setPackage:p |
|
4914 |
] |
|
4915 |
] |
|
4916 |
]. |
|
4917 |
]. |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4918 |
]. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4919 |
^ self |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4920 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4921 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4922 |
MemoryMonitor autoload. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4923 |
MemoryMonitor setPackageFromRevision |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4924 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4925 |
|
9839 | 4926 |
"Modified: / 12-06-1996 / 11:49:31 / stefan" |
4927 |
"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
|
4928 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4929 |
|
8230 | 4930 |
sourceFileSuffix |
4931 |
^ self class sourceFileSuffix |
|
4932 |
! |
|
4933 |
||
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
|
4934 |
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
|
4935 |
"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
|
4936 |
|
11429 | 4937 |
|owner source stream| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4938 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4939 |
(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
|
4940 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4941 |
classFilename notNil ifTrue:[ |
13756 | 4942 |
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
|
4943 |
] ifFalse:[ |
13756 | 4944 |
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
|
4945 |
]. |
8149 | 4946 |
stream := self sourceStreamFor:source. |
4947 |
stream notNil ifTrue:[ |
|
13756 | 4948 |
"/ see if its utf8 encoded... |
4949 |
stream := EncodedStream decodedStreamFor:stream. |
|
8149 | 4950 |
]. |
4951 |
^ stream. |
|
953
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4952 |
! |
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4953 |
|
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4954 |
sourceStreamFor:source |
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4955 |
"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
|
4956 |
|
12509
0a69e1d87ba3
comment/format in: #validateSourceStream:
Claus Gittinger <cg@exept.de>
parents:
12507
diff
changeset
|
4957 |
|owner sourceStream sourceCodeManager validated guessedFileName sep mod dir| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4958 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4959 |
(owner := self owningClass) notNil ifTrue:[^ owner sourceStreamFor:source]. |
1909 | 4960 |
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
|
4961 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4962 |
"/ |
8551 | 4963 |
"/ if there is no SourceCodeManager, |
892
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4964 |
"/ or TryLocalSourceFirst is true, |
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4965 |
"/ 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
|
4966 |
"/ |
12509
0a69e1d87ba3
comment/format in: #validateSourceStream:
Claus Gittinger <cg@exept.de>
parents:
12507
diff
changeset
|
4967 |
((sourceCodeManager := self sourceCodeManager) isNil |
892
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4968 |
or:[TryLocalSourceFirst == true]) ifTrue:[ |
14146 | 4969 |
sourceStream := 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
|
4970 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4971 |
|
12014 | 4972 |
sourceStream isNil ifTrue:[ |
14146 | 4973 |
"/ mhmh - still no source file. |
4974 |
"/ If there is a SourceCodeManager, ask it to aquire the |
|
4975 |
"/ the source for my class, and return an open stream on it. |
|
4976 |
"/ if that one does not know about the source, look in |
|
4977 |
"/ standard places |
|
4978 |
||
4979 |
sourceCodeManager notNil ifTrue:[ |
|
4980 |
classFilename ~= source ifTrue:[ |
|
4981 |
sep := self package indexOfAny:'/\:'. |
|
4982 |
sep ~~ 0 ifTrue:[ |
|
4983 |
mod := package copyTo:sep - 1. |
|
4984 |
dir := package copyFrom:sep + 1. |
|
12517 | 4985 |
self breakPoint:#fm. |
14146 | 4986 |
sourceStream := sourceCodeManager streamForClass:nil fileName:source revision:(self binaryRevision) directory:dir module:mod cache:true. |
4987 |
]. |
|
4988 |
]. |
|
4989 |
sourceStream isNil ifTrue:[ |
|
4990 |
classFilename isNil ifTrue:[ |
|
4991 |
guessedFileName := (Smalltalk fileNameForClass:self) , '.st'. |
|
4992 |
]. |
|
4993 |
source asFilename baseName = (classFilename ? guessedFileName) asFilename baseName ifTrue:[ |
|
4994 |
sourceStream := sourceCodeManager getSourceStreamFor:self. |
|
4995 |
] |
|
4996 |
]. |
|
4997 |
sourceStream notNil ifTrue:[ |
|
4998 |
(self validateSourceStream:sourceStream) ifFalse:[ |
|
4999 |
('Class [info]: repositories source for "%1" is invalid.' bindWith:self theNonMetaclass name) errorPrintCR. |
|
5000 |
sourceStream close. |
|
5001 |
sourceStream := nil |
|
5002 |
] ifTrue:[ |
|
5003 |
validated := true. |
|
5004 |
]. |
|
5005 |
]. |
|
5006 |
] |
|
5116
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5007 |
]. |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5008 |
|
12014 | 5009 |
sourceStream isNil ifTrue:[ |
14146 | 5010 |
"/ |
5011 |
"/ hard case - there is no source file for this class |
|
5012 |
"/ (in the source-dir-path). |
|
5013 |
"/ |
|
5014 |
||
5015 |
"/ |
|
5016 |
"/ look if my binary is from a dynamically loaded module, |
|
5017 |
"/ and, if so, look in the modules directory for the |
|
5018 |
"/ source file. |
|
5019 |
"/ |
|
5020 |
ObjectFileLoader notNil ifTrue:[ |
|
5021 |
ObjectFileLoader loadedObjectHandlesDo:[:h | |
|
5022 |
|f classes| |
|
5023 |
||
5024 |
sourceStream isNil ifTrue:[ |
|
5025 |
(classes := h classes) notEmptyOrNil ifTrue:[ |
|
5026 |
(classes includes:self) ifTrue:[ |
|
5027 |
f := h pathName. |
|
5028 |
f := f asFilename directory. |
|
5029 |
f := f construct:source. |
|
5030 |
f exists ifTrue:[ |
|
5031 |
sourceStream := f readStreamOrNil. |
|
5032 |
]. |
|
5033 |
]. |
|
5034 |
]. |
|
5035 |
] |
|
5036 |
]. |
|
5037 |
]. |
|
5116
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5038 |
]. |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5039 |
|
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5040 |
"/ |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5041 |
"/ try along sourcePath |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5042 |
"/ |
12014 | 5043 |
sourceStream isNil ifTrue:[ |
14146 | 5044 |
sourceStream := self localSourceStreamFor:source. |
5116
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5045 |
]. |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5046 |
|
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5047 |
"/ |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5048 |
"/ final chance: try current directory |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5049 |
"/ |
12014 | 5050 |
sourceStream isNil ifTrue:[ |
14146 | 5051 |
sourceStream := 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
|
5052 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5053 |
|
12014 | 5054 |
(sourceStream notNil and:[validated not]) ifTrue:[ |
14146 | 5055 |
(self validateSourceStream:sourceStream) ifFalse:[ |
5056 |
('Class [warning]: source for "%1" is invalid or stripped. Take care.' bindWith:self theNonMetaclass name) errorPrintCR. |
|
5057 |
sourceStream close. |
|
5058 |
sourceStream := nil |
|
5059 |
]. |
|
1909 | 5060 |
]. |
12014 | 5061 |
"/ (sourceStream notNil and:[sourceStream isFileStream]) ifTrue:[ |
9610 | 5062 |
"/ guessedFileName notNil ifTrue:[ |
5063 |
"/ self setClassFilename:(aStream pathName asFilename baseName). |
|
5064 |
"/ ] |
|
12014 | 5065 |
"/ ]. |
5066 |
^ 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
|
5067 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5068 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5069 |
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
|
5070 |
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
|
5071 |
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
|
5072 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5073 |
|
3391 | 5074 |
"Created: / 10.11.1995 / 21:05:13 / cg" |
5075 |
"Modified: / 22.4.1998 / 19:20:50 / ca" |
|
6150
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
5076 |
"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
|
5077 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5078 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5079 |
updateVersionMethodFor:newRevisionString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
5080 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
5081 |
|
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
|
5082 |
"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
|
5083 |
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
|
5084 |
|
12044 | 5085 |
"/ for backward compatibility - however, please change callers... |
5086 |
^ self sourceCodeManager updateVersionMethodOf:self for:newRevisionString |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5087 |
! |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5088 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5089 |
validateSourceStream:aStream |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5090 |
"check if aStream really contains my source. |
12509
0a69e1d87ba3
comment/format in: #validateSourceStream:
Claus Gittinger <cg@exept.de>
parents:
12507
diff
changeset
|
5091 |
This is done by checking the version method's return value |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
5092 |
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
|
5093 |
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
|
5094 |
|
1766 | 5095 |
|cls meta cannotCheckReason versionMethod info |
12103 | 5096 |
versionFromCode versionFromSource oldPos pos src rev| |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5097 |
|
13755 | 5098 |
ValidateSourceOnlyOnce == true ifTrue:[ |
13756 | 5099 |
ValidatedClasses notNil ifTrue:[ |
5100 |
(ValidatedClasses includes:self) ifTrue:[ |
|
5101 |
Transcript showCR:'trust validated'. |
|
5102 |
^ true |
|
5103 |
]. |
|
5104 |
] ifFalse:[ |
|
5105 |
ValidatedClasses := WeakIdentitySet new. |
|
5106 |
]. |
|
13755 | 5107 |
]. |
5108 |
||
8551 | 5109 |
meta := self theMetaclass. |
6150
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
5110 |
cls := self theNonMetaclass. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5111 |
|
1766 | 5112 |
cannotCheckReason := nil. |
12103 | 5113 |
|
5114 |
versionMethod := self findVersionMethod. |
|
5115 |
versionMethod isNil ifTrue:[ |
|
13756 | 5116 |
cannotCheckReason := 'no valid version method'. |
2544
c3a2791de289
care for unloaded methods, when validating the source revision
Claus Gittinger <cg@exept.de>
parents:
2516
diff
changeset
|
5117 |
] ifFalse:[ |
13756 | 5118 |
"/ |
5119 |
"/ if its a method returning the string, |
|
5120 |
"/ thats the returned value |
|
5121 |
"/ |
|
5122 |
versionFromCode := versionMethod valueWithReceiver:cls arguments:#(). |
|
5123 |
versionFromCode isString ifFalse:[ |
|
5124 |
cannotCheckReason := 'version method does not return a string' |
|
5125 |
]. |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5126 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5127 |
|
1942 | 5128 |
versionMethod notNil ifTrue:[ |
13756 | 5129 |
pos := versionMethod sourcePosition. |
5130 |
pos isInteger ifFalse:[ |
|
5131 |
"/ mhmh - either no version method, |
|
5132 |
"/ or updated due to a checkin. |
|
5133 |
"/ in any case, this should be a good source. |
|
5134 |
||
5135 |
^ true. |
|
5136 |
"/ cannotCheckReason := 'no source position for version-method' |
|
5137 |
] |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5138 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5139 |
|
1766 | 5140 |
cannotCheckReason notNil ifTrue:[ |
13756 | 5141 |
('Class [warning]: ' , cannotCheckReason , ' in ' , self name) infoPrintCR. |
5142 |
'Class [info]: cannot validate source; trusting source' infoPrintCR. |
|
5143 |
^ true |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5144 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5145 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5146 |
oldPos := aStream position. |
3371
1d8aa07c4b7f
care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents:
3365
diff
changeset
|
5147 |
Stream positionErrorSignal handle:[:ex | |
13756 | 5148 |
'Class [info]: position error when accessing source' infoPrintCR. |
5149 |
^ false |
|
3371
1d8aa07c4b7f
care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents:
3365
diff
changeset
|
5150 |
] do:[ |
13756 | 5151 |
aStream position1Based:pos. |
3371
1d8aa07c4b7f
care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents:
3365
diff
changeset
|
5152 |
]. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5153 |
src := aStream nextChunk. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5154 |
aStream position:oldPos. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5155 |
|
9063
953b305e35d6
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
8952
diff
changeset
|
5156 |
(src isEmptyOrNil) ifTrue:[ |
13756 | 5157 |
'Class [info]: empty source for version-method' infoPrintCR. |
5158 |
^ false |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5159 |
]. |
13755 | 5160 |
(src startsWith:'version') ifFalse:[ |
13756 | 5161 |
'Class [info]: corrupted source (source does not correspond to binary)' infoPrintCR. |
5162 |
^ false |
|
13755 | 5163 |
]. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5164 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5165 |
versionFromSource := Class revisionStringFromSource:src. |
13755 | 5166 |
versionFromSource = versionFromCode ifTrue:[ |
13756 | 5167 |
ValidatedClasses notNil ifTrue:[ ValidatedClasses add:self ]. |
5168 |
^ true |
|
13755 | 5169 |
]. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5170 |
|
4784 | 5171 |
versionFromSource isNil ifTrue:[ |
13756 | 5172 |
'Class [info]: version-from source is nil' infoPrintCR. |
5173 |
^ false |
|
4784 | 5174 |
]. |
1786 | 5175 |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5176 |
"/ mhmh - check my binary version ... |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5177 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5178 |
info := Class revisionInfoFromString:versionFromSource. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5179 |
info notNil ifTrue:[ |
13756 | 5180 |
rev := info at:#revision. |
5181 |
rev = self binaryRevision ifTrue:[ |
|
5182 |
ValidatedClasses notNil ifTrue:[ ValidatedClasses add:self ]. |
|
5183 |
^ true |
|
5184 |
]. |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5185 |
]. |
4784 | 5186 |
'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
|
5187 |
^ false |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5188 |
|
13755 | 5189 |
"Modified: / 29-09-2011 / 14:29:55 / cg" |
12015 | 5190 |
! |
5191 |
||
5192 |
versionMethodTemplateForSourceCodeManager:aSourceCodeManager |
|
5193 |
||
5194 |
^self class versionMethodTemplateForSourceCodeManager:aSourceCodeManager |
|
5195 |
||
5196 |
"Created: / 16-08-2009 / 12:57:53 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
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
|
5197 |
! ! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5198 |
|
13860 | 5199 |
!Class::ArrayWithSequenceNumberValidation methodsFor:'accessing'! |
5200 |
||
5201 |
sequenceNumber |
|
5202 |
^ sequenceNumber |
|
5203 |
! |
|
5204 |
||
5205 |
sequenceNumber:something |
|
5206 |
sequenceNumber := something. |
|
5207 |
! ! |
|
5208 |
||
5209 |
!Class::ArrayWithSequenceNumberValidation methodsFor:'checking'! |
|
5210 |
||
5211 |
checkIfValidFor:aSequenceNumber |
|
5212 |
^ aSequenceNumber ~= sequenceNumber |
|
5213 |
||
5214 |
"Created: / 06-12-2011 / 16:01:16 / cg" |
|
5215 |
! ! |
|
5216 |
||
12020 | 5217 |
!Class::ClassAttributes class methodsFor:'documentation'! |
5218 |
||
5219 |
documentation |
|
5220 |
" |
|
5221 |
Instances hold additional attributes of a class. |
|
5222 |
Currently, these are primitive definitions and sharedPools information. |
|
5223 |
As these are seldom needed, they are only present as object in some classes |
|
5224 |
thus saving us from mostly empty additional slots in the class object itself for most classes |
|
5225 |
" |
|
5226 |
! ! |
|
5227 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5228 |
!Class::ClassAttributes methodsFor:'accessing'! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5229 |
|
13716 | 5230 |
fGuid |
5231 |
^ fGuid |
|
5232 |
||
5233 |
"Created: / 23-09-2011 / 10:28:25 / cg" |
|
5234 |
! |
|
5235 |
||
5236 |
fGuid:something |
|
5237 |
fGuid := something. |
|
5238 |
||
5239 |
"Created: / 23-09-2011 / 10:28:28 / cg" |
|
5240 |
! |
|
5241 |
||
12259 | 5242 |
localSelectors |
5243 |
^ localSelectors |
|
5244 |
! |
|
5245 |
||
5246 |
localSelectors:something |
|
5247 |
localSelectors := something. |
|
5248 |
! |
|
5249 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5250 |
primitiveDefinitions |
7463 | 5251 |
^ primitiveDefinitions |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5252 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5253 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5254 |
primitiveDefinitions:something |
7463 | 5255 |
primitiveDefinitions := something. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5256 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5257 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5258 |
primitiveFunctions |
7463 | 5259 |
^ primitiveFunctions |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5260 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5261 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5262 |
primitiveFunctions:something |
7463 | 5263 |
primitiveFunctions := something. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5264 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5265 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5266 |
primitiveVariables |
7463 | 5267 |
^ primitiveVariables |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5268 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5269 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5270 |
primitiveVariables:something |
7463 | 5271 |
primitiveVariables := something. |
8551 | 5272 |
! |
5273 |
||
5274 |
sharedPools |
|
5275 |
^ sharedPools |
|
5276 |
! |
|
5277 |
||
5278 |
sharedPools:something |
|
5279 |
sharedPools := something. |
|
12259 | 5280 |
! |
5281 |
||
5282 |
traitComposition |
|
5283 |
^ traitComposition |
|
5284 |
! |
|
5285 |
||
5286 |
traitComposition:something |
|
5287 |
traitComposition := something. |
|
13715 | 5288 |
! |
5289 |
||
13716 | 5290 |
vGuid |
5291 |
^ vGuid |
|
5292 |
||
5293 |
"Created: / 23-09-2011 / 10:28:41 / cg" |
|
5294 |
! |
|
5295 |
||
5296 |
vGuid:something |
|
5297 |
vGuid := something. |
|
5298 |
||
5299 |
"Created: / 23-09-2011 / 10:28:34 / cg" |
|
5300 |
! |
|
5301 |
||
13715 | 5302 |
valueFor:aKey |
5303 |
^ self perform:aKey asSymbol |
|
5304 |
||
5305 |
"Created: / 23-09-2011 / 10:23:26 / cg" |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5306 |
! ! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5307 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5308 |
!Class::ClassAttributes methodsFor:'conversion'! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5309 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5310 |
fromSTCPrimitiveArray:anArray |
8551 | 5311 |
"for now, the stc compiler generates a 3- or 4-element primitive spec array |
5312 |
(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
|
5313 |
This method is invoked to convert." |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5314 |
|
7463 | 5315 |
primitiveDefinitions := anArray at:1. |
5316 |
primitiveVariables := anArray at:2. |
|
5317 |
primitiveFunctions := anArray at:3. |
|
8551 | 5318 |
anArray size > 3 ifTrue:[ |
13756 | 5319 |
sharedPools := anArray at:4. |
8551 | 5320 |
]. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5321 |
! ! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5322 |
|
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5323 |
!Class::SimulatedClassPool class methodsFor:'documentation'! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5324 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5325 |
documentation |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5326 |
" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5327 |
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
|
5328 |
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
|
5329 |
with the className as prefix (colon-separated). |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5330 |
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
|
5331 |
in a similar fashion to globals. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5332 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5333 |
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
|
5334 |
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
|
5335 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5336 |
This is an additional goody class; therefore: |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5337 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5338 |
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
|
5339 |
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
|
5340 |
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
|
5341 |
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
|
5342 |
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
|
5343 |
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
|
5344 |
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
|
5345 |
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
|
5346 |
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
|
5347 |
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
|
5348 |
SUCH DAMAGE. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5349 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5350 |
[author:] |
13756 | 5351 |
Claus Gittinger |
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5352 |
" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5353 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5354 |
! ! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5355 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5356 |
!Class::SimulatedClassPool methodsFor:'accessing'! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5357 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5358 |
associationAt:aName |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5359 |
"simulate an association" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5360 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5361 |
^ SimulatedVariableBinding key:aName value:(class classVarAt:aName) |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5362 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5363 |
"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
|
5364 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5365 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5366 |
associationAt:aName ifAbsent:exceptionBlock |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5367 |
"simulate an association" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5368 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5369 |
|internalName cls| |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5370 |
|
13756 | 5371 |
cls := class theNonMetaclass. |
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5372 |
internalName := (cls name , ':' , aName) asSymbol. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5373 |
^ SimulatedVariableBinding key:internalName value:(cls classVarAt:aName) |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5374 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5375 |
"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
|
5376 |
"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
|
5377 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5378 |
|
13680 | 5379 |
associations |
5380 |
|assocs| |
|
5381 |
||
5382 |
assocs := OrderedCollection new. |
|
5383 |
self associationsDo:[:eachAssoc | |
|
13756 | 5384 |
assocs add:eachAssoc |
13680 | 5385 |
]. |
5386 |
^ assocs |
|
5387 |
||
5388 |
"Created: / 12-09-2011 / 10:15:11 / cg" |
|
5389 |
! |
|
5390 |
||
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5391 |
associationsDo:aBlock |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5392 |
"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
|
5393 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5394 |
class classVarNames do:[:eachName | |
13756 | 5395 |
aBlock value:(self associationAt:eachName) |
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5396 |
]. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5397 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5398 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5399 |
at:aKey |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5400 |
^ class classVarAt:aKey |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5401 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5402 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5403 |
at:aKey ifAbsent:exceptionBlock |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5404 |
^ class classVarAt:aKey ifAbsent:exceptionBlock |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5405 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5406 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5407 |
at:aKey put:something |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5408 |
^ class classVarAt:aKey put:something |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5409 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5410 |
|
13680 | 5411 |
bindingOf:aKey |
5412 |
^ self associationAt:aKey |
|
5413 |
||
5414 |
"Created: / 12-09-2011 / 09:41:18 / cg" |
|
5415 |
! |
|
5416 |
||
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5417 |
keys |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5418 |
^ class classVarNames collect:[:nm | nm asSymbol] |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5419 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5420 |
" |
13756 | 5421 |
Button classPool keys |
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5422 |
Button classPool at:#ReturnForm |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5423 |
" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5424 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5425 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5426 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5427 |
keysAndValuesDo:aBlock |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5428 |
"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
|
5429 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5430 |
class classVarNames do:[:eachName | |
13756 | 5431 |
aBlock value:eachName value:(class classVarAt:eachName) |
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5432 |
]. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5433 |
! ! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5434 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5435 |
!Class::SimulatedClassPool methodsFor:'accessing-private'! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5436 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5437 |
setClass:aClass |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5438 |
class := aClass |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5439 |
! ! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5440 |
|
12020 | 5441 |
!Class::SimulatedClassPool::SimulatedVariableBinding class methodsFor:'documentation'! |
5442 |
||
5443 |
documentation |
|
5444 |
" |
|
5445 |
Instances are returned from the simulated classPool for VW compatibility. |
|
5446 |
" |
|
5447 |
! ! |
|
5448 |
||
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5449 |
!Class::SimulatedClassPool::SimulatedVariableBinding methodsFor:'queries'! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5450 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5451 |
isVariableBinding |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5452 |
^ true |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5453 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5454 |
"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
|
5455 |
! ! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5456 |
|
1739 | 5457 |
!Class class methodsFor:'documentation'! |
662 | 5458 |
|
13508
59531dc7d4e8
changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents:
13507
diff
changeset
|
5459 |
version |
14146 | 5460 |
^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.603 2012-05-26 20:02:59 stefan Exp $' |
13508
59531dc7d4e8
changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents:
13507
diff
changeset
|
5461 |
! |
59531dc7d4e8
changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents:
13507
diff
changeset
|
5462 |
|
12044 | 5463 |
version_CVS |
14146 | 5464 |
^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.603 2012-05-26 20:02:59 stefan Exp $' |
13418 | 5465 |
! |
5466 |
||
5467 |
version_SVN |
|
13461
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
5468 |
^ '§ Id: Class.st 10643 2011-06-08 21:53:07Z vranyj1 §' |
708
ba92b2a8477d
include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents:
707
diff
changeset
|
5469 |
! ! |