author | Merge Script |
Thu, 19 May 2016 07:07:52 +0200 | |
branch | jv |
changeset 19882 | 8a3f4071dfec |
parent 19862 | 6c010853ea32 |
parent 19876 | 8d800ba2b60c |
child 19892 | d1aecb538df5 |
permissions | -rw-r--r-- |
19876 | 1 |
"{ Encoding: utf8 }" |
2 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4 |
COPYRIGHT (c) 1989 by Claus Gittinger |
13756 | 5 |
All Rights Reserved |
1 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
5340
cdc42cba8f01
add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents:
5296
diff
changeset
|
14 |
"{ Package: 'stx:libbasic' }" |
cdc42cba8f01
add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents:
5296
diff
changeset
|
15 |
|
17403 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
719
c557a530f971
dont appending a chunk-separator to the initial copyright
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
18 |
ClassDescription subclass:#Class |
13093 | 19 |
instanceVariableNames:'name category classvars comment subclasses classFilename package |
20 |
revision environment signature attributes' |
|
21 |
classVariableNames:'DefaultCategoryForSTV DefaultCategoryForVAGE |
|
13860 | 22 |
DefaultCategoryForDolphin ValidateSourceOnlyOnce ValidatedClasses |
16036 | 23 |
SubclassCacheSequenceNumber |
24 |
DefaultCategoryForUncategorizedClasses |
|
25 |
DefaultCategoryForUndeclaredClasses' |
|
13093 | 26 |
poolDictionaries:'' |
27 |
category:'Kernel-Classes' |
|
1 | 28 |
! |
29 |
||
13860 | 30 |
Array variableSubclass:#ArrayWithSequenceNumberValidation |
31 |
instanceVariableNames:'sequenceNumber' |
|
32 |
classVariableNames:'' |
|
33 |
poolDictionaries:'' |
|
34 |
privateIn:Class |
|
35 |
! |
|
36 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
37 |
Object subclass:#ClassAttributes |
13093 | 38 |
instanceVariableNames:'primitiveDefinitions primitiveVariables primitiveFunctions |
14579
177a885c9a92
added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents:
14572
diff
changeset
|
39 |
sharedPools traitComposition localSelectors vGuid fGuid |
177a885c9a92
added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents:
14572
diff
changeset
|
40 |
projectDirectory' |
13093 | 41 |
classVariableNames:'' |
42 |
poolDictionaries:'' |
|
43 |
privateIn:Class |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
44 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
45 |
|
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
46 |
Object subclass:#SimulatedClassPool |
13093 | 47 |
instanceVariableNames:'class' |
48 |
classVariableNames:'' |
|
49 |
poolDictionaries:'' |
|
50 |
privateIn:Class |
|
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 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
53 |
Association subclass:#SimulatedVariableBinding |
13093 | 54 |
instanceVariableNames:'' |
55 |
classVariableNames:'' |
|
56 |
poolDictionaries:'' |
|
57 |
privateIn:Class::SimulatedClassPool |
|
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
58 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
59 |
|
1739 | 60 |
!Class class methodsFor:'documentation'! |
68 | 61 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
62 |
copyright |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
63 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
64 |
COPYRIGHT (c) 1989 by Claus Gittinger |
13756 | 65 |
All Rights Reserved |
527
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 |
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
|
68 |
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
|
69 |
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
|
70 |
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
|
71 |
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
|
72 |
hereby transferred. |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
73 |
" |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
74 |
! |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
75 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
76 |
documentation |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
77 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
78 |
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
|
79 |
been defined in Behavior and ClassDescription; this adds naming, categories etc. |
68 | 80 |
|
1287 | 81 |
[Instance variables:] |
82 |
||
13756 | 83 |
name <Symbol> the classes name |
84 |
||
85 |
category <Symbol> the classes category |
|
86 |
||
87 |
classvars <String> the names of the class variables; |
|
88 |
| <Collection of words> initially, stc generates a string; this is converted on the fly |
|
89 |
to an array of names. In the future, stc may be changed. |
|
90 |
||
91 |
comment <String> the classes comment; either a string, |
|
92 |
a number specifying the offset in classFilename, or nil |
|
93 |
||
94 |
subclasses <Collection> cached collection of subclasses |
|
95 |
(not used for execution, but for the IDE to speed up certain operations) |
|
96 |
||
97 |
classFilename <String> the file (or nil) where the classes' sources are found |
|
98 |
||
99 |
package <Symbol> the package, in which the class was defined (inserted by compilers) |
|
100 |
||
101 |
revision <String> revision string - inserted by stc |
|
102 |
||
103 |
environment <Symbol | nil> cached environment (i.e. Smalltalk or a namespace) |
|
104 |
||
105 |
signature <SmallInteger> the classes signature (used to detect obsolete or changed classes with binaryStorage) |
|
106 |
This is filled in lazy - i.e. upon the first signature query. |
|
107 |
||
108 |
attributes <Array | nil> describes primitiveIncludes, primitiveFunctions etc. |
|
109 |
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
|
110 |
|
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
111 |
|
68 | 112 |
WARNING: layout known by compiler and runtime system |
1287 | 113 |
|
114 |
[author:] |
|
13756 | 115 |
Claus Gittinger |
1669 | 116 |
|
117 |
[see also:] |
|
13756 | 118 |
Behavior ClassDescription Metaclass |
68 | 119 |
" |
12014 | 120 |
! |
121 |
||
122 |
versionManagement |
|
123 |
" |
|
124 |
old scheme (up to 5.4.x): |
|
13756 | 125 |
the #version method is supposed to return a CVS (or RCS) version string. |
126 |
this string contains (among other info) the revision number of the CVS container |
|
127 |
from which the class was compiled. |
|
128 |
To access the source code of a class, this file is reconstructed (either cached or |
|
129 |
checked out), and the source-chunk is fetched from that file at the position which |
|
130 |
is stored in the method object. |
|
12014 | 131 |
|
132 |
new scheme (starting with 5.5.0): |
|
13756 | 133 |
a classes sourcecode might be present in multiple source code management systems; |
134 |
for example, a site might decide to use CVS, where another might wonna use SVN |
|
135 |
(or other in the future). |
|
136 |
Therefore, a single version method is no longer sufficient; each sourceCodeManager |
|
137 |
will store its version info in its own format in a separate version method. |
|
138 |
The sourceCodeManager can be asked via #nameOfVersionMethodInClasses for the selector |
|
139 |
of this version. |
|
140 |
Currently these are #version_CVS and #version_SVN. More might be added in the future. |
|
141 |
||
142 |
Two additional identifiers are added to support a unique id, which can be used to |
|
143 |
compare classes and methods coming from different source containers: |
|
144 |
version_VID and version_FID |
|
145 |
Both are UUID's. The VID is updated with every change, whereas the FID is assigned only once. |
|
146 |
The FID can be interpreted as a functional-ID, and the VID as an identity id. |
|
12014 | 147 |
" |
662 | 148 |
! ! |
68 | 149 |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
150 |
!Class class methodsFor:'accessing-flags'! |
362 | 151 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
152 |
tryLocalSourceFirst |
11952 | 153 |
"if true, local source files are tried first, before a sourceCodemanager is |
154 |
consulted. This may speed up the source access, but adds some insecurity, because |
|
155 |
the sourceCodemanager is always getting the source for the classes correct version. |
|
156 |
In contrast, the local file might be different from (edited in an external tool) in |
|
157 |
the meantime. You have been warned - better leave it false (the sourceCodemanager will |
|
158 |
fill its cache and eventually be just as fast...)" |
|
159 |
||
15947 | 160 |
"JV: When smalltalk is not yet initialized, do use local sources |
161 |
because before that, SCM support may not be loaded and configured |
|
162 |
properly, leading to funny errors." |
|
163 |
^ Smalltalk isInitialized not or:[TryLocalSourceFirst == true]. |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
164 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
165 |
"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
|
166 |
! |
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 |
tryLocalSourceFirst:aBoolean |
11952 | 169 |
"if true, local source files are tried first, before a sourceCodemanager is |
170 |
consulted. This may speed up the source access, but adds some insecurity, because |
|
171 |
the sourceCodemanager is always getting the source for the classes correct version. |
|
172 |
In contrast, the local file might be different from (edited in an external tool) in |
|
173 |
the meantime. You have been warned - better leave it false (the sourceCodemanager will |
|
174 |
fill its cache and eventually be just as fast...)" |
|
175 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
176 |
TryLocalSourceFirst := aBoolean |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
177 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
178 |
"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
|
179 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
180 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
181 |
updateChanges:aBoolean |
858 | 182 |
"turn on/off changes management. Return the prior value of the flag. |
8551 | 183 |
This value is used as a default fallback - a querySignal handler may still |
858 | 184 |
decide to return something else." |
362 | 185 |
|
186 |
|prev| |
|
187 |
||
555 | 188 |
prev := UpdatingChanges. |
189 |
UpdatingChanges := aBoolean. |
|
362 | 190 |
^ prev |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
191 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
192 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
193 |
updatingChanges |
858 | 194 |
"return true if changes are recorded. |
195 |
The value returned here is the default fallback - a querySignal handler may still |
|
196 |
decide to return something else." |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
197 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
198 |
^ UpdatingChanges |
1 | 199 |
! ! |
200 |
||
10474
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
201 |
!Class class methodsFor:'creating new classes'! |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
202 |
|
13756 | 203 |
name:newName |
16036 | 204 |
"this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages" |
205 |
||
206 |
^ self |
|
207 |
name:newName |
|
208 |
subclassOf:Object |
|
209 |
instanceVariableNames:'' |
|
210 |
category:(self defaultCategoryForUncategorizedClasses) |
|
211 |
! |
|
212 |
||
16049 | 213 |
name:newName instanceVariableNames:stringOfInstVarNames |
214 |
"this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages" |
|
215 |
||
216 |
^ self |
|
217 |
name:newName |
|
218 |
subclassOf:Object |
|
219 |
instanceVariableNames:stringOfInstVarNames |
|
220 |
category:(self defaultCategoryForUncategorizedClasses) |
|
221 |
! |
|
222 |
||
16036 | 223 |
name:newName subclassOf:aClass |
224 |
"this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages" |
|
10474
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
225 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
226 |
^ self |
16036 | 227 |
name:newName |
228 |
subclassOf:aClass |
|
229 |
instanceVariableNames:'' |
|
230 |
category:(self defaultCategoryForUncategorizedClasses) |
|
231 |
! |
|
232 |
||
233 |
name:newName subclassOf:aClass instanceVariableNames:stringOfInstVarNames |
|
234 |
"this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages" |
|
235 |
||
236 |
^ self |
|
237 |
name:newName |
|
238 |
subclassOf:aClass |
|
239 |
instanceVariableNames:stringOfInstVarNames |
|
240 |
category:(self defaultCategoryForUncategorizedClasses) |
|
241 |
! |
|
242 |
||
243 |
name:newName subclassOf:aClass instanceVariableNames:stringOfInstVarNames category:categoryString |
|
244 |
"this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages" |
|
245 |
||
246 |
^ self |
|
247 |
name:newName |
|
248 |
subclassOf:aClass |
|
249 |
instanceVariableNames:stringOfInstVarNames |
|
250 |
classVariableNames:nil |
|
251 |
poolDictionaries:nil |
|
252 |
category:categoryString |
|
13756 | 253 |
! |
254 |
||
255 |
name:newName |
|
16036 | 256 |
subclassOf:aClass |
257 |
instanceVariableNames:stringOfInstVarNames |
|
258 |
classVariableNames:stringOfClassVarNames |
|
259 |
category:categoryString |
|
260 |
||
261 |
"this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages" |
|
10474
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 |
16036 | 264 |
name:newName |
265 |
subclassOf:aClass |
|
266 |
instanceVariableNames:stringOfInstVarNames |
|
267 |
classVariableNames:stringOfClassVarNames |
|
268 |
poolDictionaries:nil |
|
269 |
category:categoryString |
|
13756 | 270 |
! |
271 |
||
272 |
name:newName |
|
16036 | 273 |
subclassOf:aClass |
274 |
instanceVariableNames:stringOfInstVarNames |
|
275 |
classVariableNames:stringOfClassVarNames |
|
276 |
classInstanceVariableNames:stringOfClassInstVarNames |
|
277 |
poolDictionaries:stringOfPoolNames |
|
278 |
category:categoryString |
|
279 |
||
280 |
"this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages" |
|
10474
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
281 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
282 |
^ self class |
16036 | 283 |
name:newName |
284 |
inEnvironment:Smalltalk |
|
285 |
subclassOf:aClass |
|
286 |
instanceVariableNames:stringOfInstVarNames |
|
287 |
variable:false |
|
288 |
words:false |
|
289 |
pointers:false |
|
290 |
classVariableNames:stringOfClassVarNames |
|
291 |
poolDictionaries:stringOfPoolNames |
|
292 |
category:categoryString |
|
293 |
comment:nil |
|
294 |
changed:false |
|
295 |
classInstanceVariableNames:stringOfClassInstVarNames |
|
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 |
"Modified: 16.6.1997 / 11:53:58 / cg" |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
298 |
! |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
299 |
|
13756 | 300 |
name:newName |
16036 | 301 |
subclassOf:aClass |
302 |
instanceVariableNames:stringOfInstVarNames |
|
303 |
classVariableNames:stringOfClassVarNames |
|
304 |
poolDictionaries:stringOfPoolNames |
|
305 |
category:categoryString |
|
306 |
||
307 |
"this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages" |
|
10474
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
308 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
309 |
^ self class |
16036 | 310 |
name:newName |
311 |
inEnvironment:Smalltalk |
|
312 |
subclassOf:aClass |
|
313 |
instanceVariableNames:stringOfInstVarNames |
|
314 |
variable:false |
|
315 |
words:false |
|
316 |
pointers:false |
|
317 |
classVariableNames:stringOfClassVarNames |
|
318 |
poolDictionaries:stringOfPoolNames |
|
319 |
category:categoryString |
|
320 |
comment:nil |
|
321 |
changed:false |
|
322 |
classInstanceVariableNames:nil |
|
10474
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
323 |
|
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
324 |
"Modified: 16.6.1997 / 11:53:58 / cg" |
13418 | 325 |
! |
326 |
||
327 |
undeclared: name |
|
16036 | 328 |
"Creates an 'undeclared' class, a placeholder for |
329 |
superclass when loading/filing-in a class whose |
|
330 |
superclass does not exist yet." |
|
331 |
||
13418 | 332 |
Transcript showCR:'Smalltalk [info]: Declaring undeclared class: ', name. |
16036 | 333 |
^ Object |
334 |
subclass: name asSymbol |
|
335 |
instanceVariableNames:'' |
|
336 |
classVariableNames:'' |
|
337 |
poolDictionaries:'' |
|
338 |
category:(self defaultCategoryForUndeclaredClasses) |
|
13418 | 339 |
|
340 |
"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
|
341 |
! ! |
7b4dd84fb0bf
new class definition protocol started
Claus Gittinger <cg@exept.de>
parents:
10438
diff
changeset
|
342 |
|
1739 | 343 |
!Class class methodsFor:'helpers'! |
620 | 344 |
|
12004 | 345 |
nameWithoutPrefix:name |
346 |
"helper for fileOut and others - return a name's printString, |
|
347 |
without any owningClass or nameSpace prefix" |
|
348 |
||
349 |
|idx| |
|
350 |
||
14235
810d699d6963
changed: #nameWithoutPrefix:
Claus Gittinger <cg@exept.de>
parents:
14228
diff
changeset
|
351 |
name isNil ifTrue:[^ nil]. |
810d699d6963
changed: #nameWithoutPrefix:
Claus Gittinger <cg@exept.de>
parents:
14228
diff
changeset
|
352 |
|
12004 | 353 |
idx := name lastIndexOf:$:. |
354 |
[idx > 1 and:[ (name at:(idx-1)) ~~ $: ]] whileTrue:[ |
|
14837 | 355 |
idx := name lastIndexOf:$: startingAt:idx-2. |
12004 | 356 |
]. |
357 |
idx == 0 ifTrue:[ |
|
14837 | 358 |
^ name |
12004 | 359 |
]. |
360 |
||
361 |
^ name copyFrom:idx+1. |
|
362 |
||
363 |
"a public class: |
|
364 |
Class nameWithoutPrefix:'Array' |
|
365 |
Class nameWithoutPrefix:'Tools::Array' |
|
366 |
" |
|
14235
810d699d6963
changed: #nameWithoutPrefix:
Claus Gittinger <cg@exept.de>
parents:
14228
diff
changeset
|
367 |
|
810d699d6963
changed: #nameWithoutPrefix:
Claus Gittinger <cg@exept.de>
parents:
14228
diff
changeset
|
368 |
"Modified: / 13-06-2012 / 14:41:21 / cg" |
12004 | 369 |
! |
370 |
||
620 | 371 |
revisionInfoFromString:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
372 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
373 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
374 |
"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
|
375 |
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
|
376 |
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
|
377 |
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
|
378 |
its sourceCode manager." |
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
379 |
|
7754 | 380 |
|mgr| |
620 | 381 |
|
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
382 |
"/ |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
383 |
"/ mhmh - ask the default manager. |
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
384 |
"/ 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
|
385 |
"/ |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
386 |
mgr := SourceCodeManager ? CVSSourceCodeManager. |
7754 | 387 |
"/ |
7755 | 388 |
"/ care for standAlone apps which have no CVS (libbasic3) included |
7754 | 389 |
"/ |
390 |
mgr isNil ifTrue:[ |
|
14837 | 391 |
AbstractSourceCodeManager notNil ifTrue:[ |
392 |
^ CVSVersionInfo fromRCSString:aString |
|
393 |
]. |
|
394 |
^ nil |
|
7754 | 395 |
]. |
396 |
^ mgr revisionInfoFromString:aString. |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
397 |
|
13759
60d609b1d5fb
changed: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
13756
diff
changeset
|
398 |
"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
|
399 |
! |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
400 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
401 |
revisionStringFromSource:aMethodSourceString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
402 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
403 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
404 |
"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
|
405 |
Caveat: Assumes CVS." |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
406 |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
407 |
|lines line| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
408 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
409 |
lines := aMethodSourceString asCollectionOfLines. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
410 |
lines do:[:l | |
15947 | 411 |
|i| |
412 |
||
413 |
i := l indexOfSubCollection:'$Header: '. |
|
414 |
"JV @ 2009-12-13: Also search for '$Id: ' (because of SVN-only classes)" |
|
415 |
i == 0 ifTrue:[ |
|
416 |
i := l indexOfSubCollection:'$Id: ']. |
|
417 |
"JV @ 2013-07-18: Also search for '$Changeset: ' (because of Mercurial-only classes)" |
|
418 |
i == 0 ifTrue:[ |
|
419 |
i := l indexOfSubCollection:'$Changeset: ']. |
|
420 |
||
421 |
i ~~ 0 ifTrue:[ |
|
422 |
line := l copyFrom:i. |
|
423 |
i := line lastIndexOf:$$. |
|
424 |
i > 1 ifTrue:[ |
|
425 |
line := line copyTo:i. |
|
426 |
]. |
|
427 |
^ line |
|
428 |
] |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
429 |
]. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
430 |
^ nil |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
431 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
432 |
"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
|
433 |
"Modified: / 22-10-2008 / 20:29:50 / cg" |
15947 | 434 |
"Modified: / 19-07-2013 / 23:32:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
620 | 435 |
! ! |
436 |
||
3618
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
437 |
!Class class methodsFor:'misc'! |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
438 |
|
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
439 |
template:aCategoryString |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
440 |
"return a class-definition template" |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
441 |
|
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
442 |
^ 'NameOfSuperclass subclass:#NameOfClass |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
443 |
instanceVariableNames:''instVarName1 instVarName2'' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
444 |
classVariableNames:''classVarName1 classVarName2'' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
445 |
poolDictionaries:'''' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
446 |
category:''' , aCategoryString , '''' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
447 |
|
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
448 |
"Created: / 19.6.1998 / 02:09:06 / cg" |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
449 |
! ! |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
450 |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
451 |
!Class class methodsFor:'private'! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
452 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
453 |
flushSubclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
454 |
"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
|
455 |
by #subclassInfo. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
456 |
This is private protocol" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
457 |
|
13860 | 458 |
SubclassCacheSequenceNumber := (SubclassCacheSequenceNumber ? 0) + 1. |
459 |
||
460 |
"/ self allSubInstancesDo:[:cls | |
|
461 |
"/ cls flushSubclasses |
|
462 |
"/ ]. |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
463 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
464 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
465 |
Class flushSubclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
466 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
467 |
|
13861 | 468 |
"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
|
469 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
470 |
|
12507
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
471 |
flushSubclassInfoFor:aClass |
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
472 |
"throw away (forget) the cached subclass information for aClass, as created |
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
473 |
by #subclassInfo. |
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
474 |
This is private protocol" |
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
475 |
|
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
476 |
aClass notNil ifTrue:[ |
14837 | 477 |
aClass flushSubclasses |
12507
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
478 |
]. |
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
479 |
|
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
480 |
" |
12694 | 481 |
Class flushSubclassInfoFor:View |
12507
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
482 |
" |
41ac4792b598
added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents:
12415
diff
changeset
|
483 |
|
13861 | 484 |
"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
|
485 |
! ! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
486 |
|
1739 | 487 |
!Class class methodsFor:'queries'! |
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
488 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
489 |
isBuiltInClass |
1266 | 490 |
"return true if this class is known by the run-time-system. |
491 |
Here, true is returned for myself, false for subclasses." |
|
492 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
493 |
^ self == Class class or:[self == Class] |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
494 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
495 |
"Created: 15.4.1996 / 17:17:13 / cg" |
1266 | 496 |
"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
|
497 |
! ! |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
498 |
|
19119 | 499 |
|
18210
d1768187cb74
fileout: file out class in UTF8 only if necessary
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18209
diff
changeset
|
500 |
|
18724
7507744b281c
Added #theMetaClass for Squeak/Pharo compatibiliry
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18693
diff
changeset
|
501 |
|
7261 | 502 |
!Class methodsFor:'Compatibility-Dolphin'! |
6823 | 503 |
|
504 |
defaultCategoryForDolphinClasses |
|
16036 | 505 |
"used only when filing in Dolphin classes (which do not provide a category in their inst creation message)" |
506 |
||
6823 | 507 |
^ DefaultCategoryForDolphin ? 'Dolphin classes'. |
508 |
! |
|
509 |
||
13715 | 510 |
guid |
13716 | 511 |
^ self getAttribute:#fGuid |
13715 | 512 |
|
513 |
"Created: / 23-09-2011 / 10:24:44 / cg" |
|
514 |
! |
|
515 |
||
516 |
guid:aUUID |
|
13716 | 517 |
^ self setAttribute:#fGuid to:aUUID |
13715 | 518 |
|
519 |
"Created: / 23-09-2011 / 10:25:04 / cg" |
|
520 |
! |
|
521 |
||
11162 | 522 |
stb_version |
523 |
^ 0 |
|
524 |
! |
|
525 |
||
6823 | 526 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames |
527 |
"{ Pragma: +optSpace }" |
|
528 |
||
529 |
"this method allows fileIn of Dolphin classes " |
|
530 |
||
8551 | 531 |
^ self subclass:t |
13756 | 532 |
instanceVariableNames:f |
533 |
classVariableNames:d |
|
534 |
poolDictionaries:s |
|
535 |
category:(self defaultCategoryForDolphinClasses) |
|
536 |
classInstanceVariableNames:classInstanceVariableNames |
|
6823 | 537 |
|
538 |
"Modified: / 15.6.1998 / 21:31:34 / cg" |
|
539 |
"Modified: / 18.3.1999 / 18:16:11 / stefan" |
|
540 |
! |
|
541 |
||
542 |
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames |
|
543 |
"{ Pragma: +optSpace }" |
|
544 |
||
545 |
"this method allows fileIn of Dolphin classes " |
|
546 |
||
8551 | 547 |
^ self variableSubclass:t |
13756 | 548 |
instanceVariableNames:f |
549 |
classVariableNames:d |
|
550 |
poolDictionaries:s |
|
551 |
category:(self defaultCategoryForDolphinClasses) |
|
552 |
classInstanceVariableNames:classInstanceVariableNames |
|
6823 | 553 |
|
554 |
"Modified: / 15.6.1998 / 21:31:34 / cg" |
|
555 |
"Modified: / 18.3.1999 / 18:16:11 / stefan" |
|
556 |
! ! |
|
557 |
||
7261 | 558 |
!Class methodsFor:'Compatibility-ST/V and V''Age'! |
6225 | 559 |
|
560 |
defaultCategoryForSTVorVAGEClasses |
|
16036 | 561 |
"used only when filing in ST/V and V'Age classes (which do not provide a category in their inst creation message)" |
562 |
||
6225 | 563 |
|cat app| |
564 |
||
565 |
DefaultApplicationQuerySignal isHandled ifTrue:[ |
|
16036 | 566 |
"/ while loading a package, this is answered... |
567 |
"/ put the new class into a category named after the app |
|
568 |
app := DefaultApplicationQuerySignal query. |
|
569 |
app notNil ifTrue:[ |
|
570 |
cat := "'Applications-' ," app nameWithoutPrefix. |
|
571 |
] ifFalse:[ |
|
572 |
cat := DefaultCategoryForVAGE ? 'V''Age classes'. |
|
573 |
]. |
|
6225 | 574 |
] ifFalse:[ |
16036 | 575 |
cat := DefaultCategoryForSTV ? 'ST/V classes'. |
6225 | 576 |
]. |
577 |
||
578 |
^ cat |
|
14000
1b4fbb92d572
changed: #defaultCategoryForSTVorVAGEClasses
Claus Gittinger <cg@exept.de>
parents:
13999
diff
changeset
|
579 |
|
1b4fbb92d572
changed: #defaultCategoryForSTVorVAGEClasses
Claus Gittinger <cg@exept.de>
parents:
13999
diff
changeset
|
580 |
"Modified: / 07-02-2012 / 17:40:35 / cg" |
6225 | 581 |
! |
582 |
||
9178
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
583 |
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
|
584 |
"{ Pragma: +optSpace }" |
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
585 |
|
14679 | 586 |
"this method allows fileIn of ST/V and V'Age classes" |
9178
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
587 |
|
13756 | 588 |
^ self |
14837 | 589 |
subclass:nm |
590 |
instanceVariableNames:iV |
|
591 |
classVariableNames:cV |
|
592 |
poolDictionaries:p |
|
593 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
594 |
classInstanceVariableNames:cIV |
|
9178
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
595 |
! |
f6ec6e771009
V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents:
9063
diff
changeset
|
596 |
|
6225 | 597 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s |
598 |
"{ Pragma: +optSpace }" |
|
599 |
||
8551 | 600 |
"this method allows fileIn of ST/V and V'Age classes |
6225 | 601 |
(which seem to have no category)" |
602 |
||
13756 | 603 |
^ self |
604 |
subclass:t |
|
605 |
instanceVariableNames:f |
|
606 |
classVariableNames:d |
|
607 |
poolDictionaries:s |
|
608 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 609 |
|
610 |
"Modified: / 15.6.1998 / 21:31:34 / cg" |
|
611 |
"Modified: / 18.3.1999 / 18:16:11 / stefan" |
|
612 |
! |
|
613 |
||
614 |
variableByteSubclass:t classVariableNames:d poolDictionaries:s |
|
615 |
"{ Pragma: +optSpace }" |
|
616 |
||
8551 | 617 |
"this method allows fileIn of ST/V and V'Age variable byte classes |
6225 | 618 |
(which seem to have no category and no instvars)" |
619 |
||
8551 | 620 |
^ self variableByteSubclass:t |
13756 | 621 |
instanceVariableNames:'' |
622 |
classVariableNames:d |
|
623 |
poolDictionaries:s |
|
624 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 625 |
|
626 |
"Modified: / 15.6.1998 / 21:31:38 / cg" |
|
627 |
"Modified: / 18.3.1999 / 18:16:21 / stefan" |
|
628 |
! |
|
629 |
||
630 |
variableLongSubclass:t classVariableNames:d poolDictionaries:s |
|
631 |
"{ Pragma: +optSpace }" |
|
632 |
||
8551 | 633 |
"this method allows fileIn of ST/V and V'Age variable long (32bit integers) classes |
6225 | 634 |
(which seem to have no category and no instvars)" |
635 |
||
8551 | 636 |
^ self variableLongSubclass:t |
13756 | 637 |
instanceVariableNames:'' |
638 |
classVariableNames:d |
|
639 |
poolDictionaries:s |
|
640 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 641 |
! |
642 |
||
643 |
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s |
|
644 |
"{ Pragma: +optSpace }" |
|
645 |
||
8551 | 646 |
"this method allows fileIn of ST/V and V'Age variable pointer classes |
6225 | 647 |
(which seem to have no category)" |
648 |
||
8551 | 649 |
^ self variableSubclass:t |
13756 | 650 |
instanceVariableNames:f |
651 |
classVariableNames:d |
|
652 |
poolDictionaries:s |
|
653 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 654 |
|
655 |
"Modified: / 15.6.1998 / 21:31:41 / cg" |
|
656 |
"Modified: / 18.3.1999 / 18:16:33 / stefan" |
|
657 |
! |
|
658 |
||
659 |
variableWordSubclass:t classVariableNames:d poolDictionaries:s |
|
660 |
"{ Pragma: +optSpace }" |
|
661 |
||
8551 | 662 |
"this method allows fileIn of ST/V and V'Age variable word (16bit integers) classes |
6225 | 663 |
(which seem to have no category and no instvars)" |
664 |
||
8551 | 665 |
^ self variableWordSubclass:t |
13756 | 666 |
instanceVariableNames:'' |
667 |
classVariableNames:d |
|
668 |
poolDictionaries:s |
|
669 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 670 |
! ! |
671 |
||
7261 | 672 |
!Class methodsFor:'Compatibility-ST80'! |
5190 | 673 |
|
14929 | 674 |
classPool |
675 |
"return something which allows access to my classVariables via |
|
676 |
#at: and #at:put: messages." |
|
677 |
||
678 |
^ SimulatedClassPool new setClass:self |
|
679 |
||
680 |
" |
|
681 |
Button classPool |
|
682 |
" |
|
683 |
||
684 |
"Modified: 17.10.1997 / 12:12:14 / cg" |
|
685 |
! |
|
686 |
||
5190 | 687 |
fileOutSourceOn:aStream |
688 |
self fileOutOn:aStream withTimeStamp:false |
|
689 |
||
690 |
"Created: 20.6.1997 / 17:18:14 / cg" |
|
691 |
"Modified: 20.6.1997 / 17:18:26 / cg" |
|
692 |
! |
|
693 |
||
6723 | 694 |
rename:newName |
695 |
"same as renameTo: - for ST80 compatibility" |
|
696 |
||
697 |
^ Smalltalk renameClass:self to:newName. |
|
698 |
"/ ^ self renameTo:newName |
|
699 |
||
700 |
"Created: / 18.6.1998 / 22:08:45 / cg" |
|
701 |
! ! |
|
702 |
||
17255 | 703 |
!Class methodsFor:'Compatibility-Squeak'! |
704 |
||
19641 | 705 |
commentStamp:stampString prior:priorVersion |
706 |
^ SqueakCommentReader new |
|
707 |
class:self stamp:stampString priorVersion:priorVersion |
|
708 |
! |
|
709 |
||
18693
22ba9e374cbf
Add Class>>classVarNamed: for Squeak/Pharo compatibility.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18646
diff
changeset
|
710 |
classVarNamed: aSymbol |
22ba9e374cbf
Add Class>>classVarNamed: for Squeak/Pharo compatibility.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18646
diff
changeset
|
711 |
"Returns the value of class variable named `aSymbol`. |
22ba9e374cbf
Add Class>>classVarNamed: for Squeak/Pharo compatibility.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18646
diff
changeset
|
712 |
|
22ba9e374cbf
Add Class>>classVarNamed: for Squeak/Pharo compatibility.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18646
diff
changeset
|
713 |
Warning: This method is here for Squeak/Pharo compatibility. |
22ba9e374cbf
Add Class>>classVarNamed: for Squeak/Pharo compatibility.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18646
diff
changeset
|
714 |
Do not use it in Smalltalk/X code" |
22ba9e374cbf
Add Class>>classVarNamed: for Squeak/Pharo compatibility.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18646
diff
changeset
|
715 |
|
22ba9e374cbf
Add Class>>classVarNamed: for Squeak/Pharo compatibility.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18646
diff
changeset
|
716 |
^ self classVarAt: aSymbol |
22ba9e374cbf
Add Class>>classVarNamed: for Squeak/Pharo compatibility.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18646
diff
changeset
|
717 |
|
22ba9e374cbf
Add Class>>classVarNamed: for Squeak/Pharo compatibility.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18646
diff
changeset
|
718 |
"Created: / 17-08-2015 / 13:07:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
22ba9e374cbf
Add Class>>classVarNamed: for Squeak/Pharo compatibility.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18646
diff
changeset
|
719 |
|
22ba9e374cbf
Add Class>>classVarNamed: for Squeak/Pharo compatibility.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18646
diff
changeset
|
720 |
! |
22ba9e374cbf
Add Class>>classVarNamed: for Squeak/Pharo compatibility.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18646
diff
changeset
|
721 |
|
18646
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
722 |
classVarNamed: aSymbol put: anObject |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
723 |
"Set the value of class variable named `aSymbol` to `anObject`. |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
724 |
|
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
725 |
Warning: This method is here for Squeak/Pharo compatibility. |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
726 |
Do not use it in Smalltalk/X code" |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
727 |
|
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
728 |
self classVarAt: aSymbol put: anObject |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
729 |
|
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
730 |
"Created: / 25-07-2015 / 07:25:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
731 |
"Modified (format): / 27-07-2015 / 09:59:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
732 |
! |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
733 |
|
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
734 |
classVariableNamed: aSymbol |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
735 |
"Returns the value of class variable named `aSymbol`. |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
736 |
|
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
737 |
Warning: This method is here for Squeak/Pharo compatibility. |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
738 |
Do not use it in Smalltalk/X code" |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
739 |
|
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
740 |
^ self classVarAt: aSymbol |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
741 |
|
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
742 |
"Created: / 27-07-2015 / 09:44:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
743 |
! |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
744 |
|
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
745 |
classVariables |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
746 |
"Return an array of class variable names. |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
747 |
|
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
748 |
Warning: This method is here for Squeak/Pharo compatibility. |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
749 |
Do not use it in Smalltalk/X code" |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
750 |
|
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
751 |
^ self classVarNames |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
752 |
|
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
753 |
"Created: / 27-07-2015 / 09:36:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
754 |
! |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
755 |
|
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
756 |
instanceVariables |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
757 |
"Return an array of instance variable names. |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
758 |
|
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
759 |
Warning: This method is here for Squeak/Pharo compatibility. |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
760 |
Do not use it in Smalltalk/X code" |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
761 |
|
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
762 |
^ self instVarNames |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
763 |
|
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
764 |
"Created: / 27-07-2015 / 09:35:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
18724
7507744b281c
Added #theMetaClass for Squeak/Pharo compatibiliry
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18693
diff
changeset
|
765 |
! |
7507744b281c
Added #theMetaClass for Squeak/Pharo compatibiliry
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18693
diff
changeset
|
766 |
|
17255 | 767 |
poolDictionaryNames |
768 |
^ self sharedPoolNames |
|
19658 | 769 |
! |
770 |
||
18724
7507744b281c
Added #theMetaClass for Squeak/Pharo compatibiliry
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18693
diff
changeset
|
771 |
theMetaClass |
7507744b281c
Added #theMetaClass for Squeak/Pharo compatibiliry
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18693
diff
changeset
|
772 |
^ self theMetaclass |
7507744b281c
Added #theMetaClass for Squeak/Pharo compatibiliry
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18693
diff
changeset
|
773 |
|
7507744b281c
Added #theMetaClass for Squeak/Pharo compatibiliry
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18693
diff
changeset
|
774 |
"Created: / 28-08-2015 / 09:36:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17255 | 775 |
! ! |
17252 | 776 |
|
1 | 777 |
!Class methodsFor:'accessing'! |
778 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
779 |
addClassVarName:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
780 |
"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
|
781 |
Also writes a change record and notifies dependents." |
555 | 782 |
|
13209 | 783 |
self addClassVarNames:(Array with:aString). |
784 |
||
785 |
"Created: / 29-10-1995 / 19:40:51 / cg" |
|
786 |
"Modified: / 23-01-1998 / 15:46:23 / stefan" |
|
787 |
"Modified: / 15-01-2011 / 14:17:41 / cg" |
|
788 |
! |
|
789 |
||
790 |
addClassVarNames:aCollectionOfStrings |
|
791 |
"add a number of class variables if not already there and initialize them with nil. |
|
792 |
Also writes a change record and notifies dependents." |
|
793 |
||
794 |
|newVariables| |
|
795 |
||
796 |
newVariables := aCollectionOfStrings reject:[:each | self classVarNames includes:each]. |
|
797 |
newVariables isEmpty ifTrue:[^ self]. |
|
798 |
||
799 |
newVariables := newVariables collect:[:each | each asSymbol]. |
|
800 |
self classVariableString:(self classVariableString , ' ' , (newVariables asStringWith:' ')). |
|
801 |
Class withoutUpdatingChangesDo:[ |
|
13756 | 802 |
self withAllSubclasses do:[:cls| |
803 |
cls recompileMethodsAccessingAnyClassvarOrGlobal:newVariables |
|
804 |
]. |
|
13209 | 805 |
]. |
806 |
self addChangeRecordForClass:self andNotifyChangeOf:#classVariables. |
|
807 |
||
808 |
"Modified: / 23-01-1998 / 15:46:23 / stefan" |
|
809 |
"Created: / 15-01-2011 / 14:17:21 / cg" |
|
555 | 810 |
! |
811 |
||
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
812 |
allPrivateClasses |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
813 |
"{ Pragma: +optSpace }" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
814 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
815 |
"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
|
816 |
The classes are in any order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
817 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
818 |
^ self privateClassesOrAll:true |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
819 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
820 |
! |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
821 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
822 |
category |
8551 | 823 |
"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
|
824 |
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
|
825 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
826 |
|owner| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
827 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
828 |
(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
|
829 |
^ category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
830 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
831 |
" |
8551 | 832 |
Point category |
833 |
Dictionary category |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
834 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
835 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
836 |
"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
|
837 |
"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
|
838 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
839 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
840 |
category:aStringOrSymbol |
18206 | 841 |
"set the category of the class to be the argument, aStringOrSymbol. |
842 |
Sends out change notifications, so browers can update" |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
843 |
|
7579
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
844 |
|ns| |
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
845 |
|
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
846 |
self setCategory:aStringOrSymbol. |
10195
2484228d4c95
the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents:
10184
diff
changeset
|
847 |
self addChangeRecordForClass:self. |
7579
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
848 |
ns := self nameSpace. |
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
849 |
ns changed:#organization. |
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
850 |
ns ~~ Smalltalk ifTrue:[ |
18206 | 851 |
Smalltalk changed:#organization. |
7579
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
852 |
] |
10195
2484228d4c95
the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents:
10184
diff
changeset
|
853 |
|
2484228d4c95
the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents:
10184
diff
changeset
|
854 |
"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
|
855 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
856 |
|
10078 | 857 |
classBaseFilename |
858 |
"return the baseName of the file from which the class was compiled. |
|
859 |
In contrast to classFilename, this will always be a plain basename." |
|
860 |
||
861 |
^ self classFilename asFilename baseName |
|
862 |
||
863 |
" |
|
864 |
Math::ClosedInterval classFilename |
|
865 |
" |
|
866 |
||
867 |
"Created: / 12-10-2006 / 15:49:32 / cg" |
|
868 |
! |
|
869 |
||
12018
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
870 |
classFilename |
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
871 |
"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
|
872 |
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
|
873 |
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
|
874 |
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
|
875 |
|
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
876 |
|owner info fn| |
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
877 |
|
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
878 |
(owner := self owningClass) notNil ifTrue:[^ owner classFilename]. |
12020 | 879 |
|
12303 | 880 |
"/ This was added as an extension of libsvn - should be no longer needed |
881 |
"/ compatQuery := Smalltalk classNamed: 'SVN::CompatModeQuery'. |
|
13756 | 882 |
"/ (compatQuery notNil |
883 |
"/ and:[compatQuery isLoaded |
|
12303 | 884 |
"/ and:[(compatQuery query ? true) not]]) |
885 |
"/ ifTrue:[^SVN::Repository containerNameForClass: self]. |
|
12020 | 886 |
|
12018
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
887 |
classFilename notNil ifTrue:[ ^ classFilename ]. |
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
888 |
|
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
889 |
(info := self revisionInfo) notNil ifTrue:[ |
13756 | 890 |
fn := info fileName. |
891 |
fn notNil ifTrue:[ |
|
892 |
^ fn |
|
893 |
]. |
|
12018
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
894 |
]. |
12303 | 895 |
^ (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
|
896 |
|
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
897 |
" |
13756 | 898 |
SVN::Repository classFilename |
899 |
Array classFilename |
|
12018
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
900 |
" |
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
901 |
|
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
902 |
"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
|
903 |
! |
a24a9968fdf4
oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents:
12015
diff
changeset
|
904 |
|
15095 | 905 |
classNamed:aClassNameStringOrSymbol |
906 |
"return a private class if present; nil otherwise. |
|
907 |
Added for protocol compatibilty with NameSpace and Smalltalk" |
|
908 |
||
909 |
"{ Pragma: +optSpace }" |
|
910 |
^ self privateClassesAt:aClassNameStringOrSymbol |
|
911 |
! |
|
912 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
913 |
classVarAt:aSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
914 |
"return the value of a class variable. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
915 |
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
|
916 |
this may change." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
917 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
918 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
919 |
this hides the (current) implementation of classVariables |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
920 |
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
|
921 |
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
|
922 |
no classPools yet. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
923 |
" |
6731 | 924 |
^ Smalltalk at:(self globalKeyForClassVar:aSymbol) |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
925 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
926 |
|
5707
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
927 |
classVarAt:aSymbol ifAbsent:exceptionBlock |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
928 |
"return the value of a class variable. |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
929 |
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
|
930 |
this may change." |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
931 |
|
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
932 |
" |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
933 |
this hides the (current) implementation of classVariables |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
934 |
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
|
935 |
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
|
936 |
no classPools yet. |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
937 |
" |
6731 | 938 |
^ Smalltalk at:(self globalKeyForClassVar:aSymbol) ifAbsent:exceptionBlock |
5707
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
939 |
! |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
940 |
|
13106
f2f4b6db778c
comment/format in: #classVarAt:put:
Claus Gittinger <cg@exept.de>
parents:
13093
diff
changeset
|
941 |
classVarAt:aSymbolOrString put:something |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
942 |
"store something in a classvariable. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
943 |
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
|
944 |
classVar exists - this may change." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
945 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
946 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
947 |
this hides the (current) implementation of classVariables |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
948 |
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
|
949 |
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
|
950 |
no classPools yet. |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
951 |
" |
13106
f2f4b6db778c
comment/format in: #classVarAt:put:
Claus Gittinger <cg@exept.de>
parents:
13093
diff
changeset
|
952 |
Smalltalk at:(self globalKeyForClassVar:aSymbolOrString) put:something. |
f2f4b6db778c
comment/format in: #classVarAt:put:
Claus Gittinger <cg@exept.de>
parents:
13093
diff
changeset
|
953 |
|
f2f4b6db778c
comment/format in: #classVarAt:put:
Claus Gittinger <cg@exept.de>
parents:
13093
diff
changeset
|
954 |
"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
|
955 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
956 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
957 |
classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
958 |
"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
|
959 |
Only names of class variables defined in this class are included |
16043 | 960 |
in the returned collection - use allClassVarNames, to get all known names. |
961 |
Traditionally, this was called classVarNames, but newer versions of squeak |
|
962 |
seem to have changed to use classVariableNames. |
|
963 |
So you probably should use the alias" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
964 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
965 |
classvars isNil ifTrue:[ |
15032
5fbddc5403d3
Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents:
14929
diff
changeset
|
966 |
^ #() |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
967 |
]. |
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
968 |
classvars isString ifTrue:[ |
17255 | 969 |
classvars := classvars asCollectionOfWords collect:[:varName| varName asSymbol] as:Array. |
15032
5fbddc5403d3
Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents:
14929
diff
changeset
|
970 |
^ classvars |
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
971 |
]. |
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
972 |
|
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
973 |
^ classvars |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
974 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
975 |
" |
8551 | 976 |
Object classVarNames |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
977 |
Float classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
978 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
979 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
980 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
981 |
classVariableString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
982 |
"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
|
983 |
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
|
984 |
returned string." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
985 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
986 |
classvars isNil ifTrue:[^ '']. |
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
987 |
classvars isString ifTrue:[ |
13756 | 988 |
^ classvars |
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
989 |
]. |
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
990 |
|
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
991 |
^ classvars asStringWith:(Character space) |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
992 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
993 |
" |
8551 | 994 |
Object classVariableString |
995 |
Float classVariableString |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
996 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
997 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
998 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
999 |
classVariableString:aString |
8551 | 1000 |
"set the classes classvarnames string; |
1001 |
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
|
1002 |
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
|
1003 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1004 |
|prevVarNames varNames any| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1005 |
|
7517 | 1006 |
(aString ~= self classVariableString) ifTrue:[ |
13756 | 1007 |
prevVarNames := self classVarNames asOrderedCollection. |
1008 |
classvars := aString. |
|
1009 |
varNames := self classVarNames. |
|
1010 |
||
1011 |
"new ones get initialized to nil; |
|
1012 |
- old ones are nilled and removed from Smalltalk" |
|
1013 |
any := false. |
|
1014 |
||
1015 |
varNames do:[:aName | |
|
1016 |
(prevVarNames includes:aName) ifFalse:[ |
|
1017 |
"a new one" |
|
1018 |
self classVarAt:aName put:nil. |
|
1019 |
any := true. |
|
1020 |
] ifTrue:[ |
|
1021 |
prevVarNames remove:aName |
|
1022 |
] |
|
1023 |
]. |
|
1024 |
"left overs are gone" |
|
1025 |
prevVarNames do:[:aName | |
|
1026 |
any := true. |
|
1027 |
self classVarAt:aName put:nil. |
|
1028 |
Smalltalk removeKey:(self globalKeyForClassVar:aName). |
|
1029 |
]. |
|
1030 |
any ifTrue:[ |
|
1031 |
Smalltalk changed:#classVariables with:self |
|
1032 |
]. |
|
453 | 1033 |
] |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
1034 |
|
10184 | 1035 |
"Modified: / 02-04-1997 / 00:16:05 / stefan" |
1036 |
"Modified: / 18-11-2006 / 17:13:14 / cg" |
|
453 | 1037 |
! |
1038 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1039 |
comment |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1040 |
"return the comment (aString) of the class" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1041 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1042 |
|stream string| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1043 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1044 |
"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
|
1045 |
position within the classes sourcefile ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1046 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1047 |
comment isNumber ifTrue:[ |
15610 | 1048 |
classFilename notNil ifTrue:[ |
1049 |
stream := self sourceStream. |
|
1050 |
stream notNil ifTrue:[ |
|
1051 |
stream position:comment-1. |
|
1052 |
string := String readFrom:stream onError:''. |
|
1053 |
stream close. |
|
1054 |
^ string |
|
1055 |
]. |
|
1056 |
^ nil |
|
1057 |
] |
|
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 |
^ comment |
555 | 1060 |
|
1061 |
" |
|
8551 | 1062 |
Object comment |
7054
685d359f9847
code rewritten to be independent of stream zero-base
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
1063 |
RunArray comment |
555 | 1064 |
" |
1065 |
! |
|
1066 |
||
7128 | 1067 |
comment:aStringOrNil |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1068 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1069 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1070 |
"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
|
1071 |
create a change record and notify dependents." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1072 |
|
865
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
1073 |
|oldComment newComment| |
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
1074 |
|
7128 | 1075 |
newComment := aStringOrNil. |
1076 |
(aStringOrNil notNil and:[aStringOrNil withoutSeparators isEmpty]) ifTrue:[ |
|
13756 | 1077 |
newComment := nil |
865
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
1078 |
]. |
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
1079 |
comment ~= newComment ifTrue:[ |
13756 | 1080 |
oldComment := self comment. |
1081 |
comment := newComment. |
|
1082 |
self addChangeRecordForClassComment:self. |
|
1083 |
self changed:#comment with:oldComment. |
|
1084 |
Smalltalk changed:#classComment with:self. |
|
555 | 1085 |
] |
1086 |
! |
|
1087 |
||
14704 | 1088 |
containingNameSpace |
1089 |
"return the namespace I am really contained in; |
|
1090 |
For private or anonymous classes, nil is returned - |
|
1091 |
for public classes, Smalltalk is returned." |
|
1092 |
||
18208 | 1093 |
"/ (self nameSpace at:self nameWithoutNamespacePrefix ifAbsent:nil) |
14708 | 1094 |
"/ or |
19166 | 1095 |
(name isSymbol and:[(Smalltalk at:name) == self]) ifFalse:[ |
18208 | 1096 |
^ nil |
14704 | 1097 |
]. |
18208 | 1098 |
^ self nameSpace |
14704 | 1099 |
! |
1100 |
||
2444 | 1101 |
environment |
1102 |
"return the namespace I am contained in; ST-80 compatible name" |
|
1103 |
||
1104 |
^ self nameSpace |
|
1105 |
! |
|
1106 |
||
11866 | 1107 |
generateClassFilename |
1108 |
"generate the expected filename for this class - without suffix. |
|
1109 |
This may be different from the actual classFilename" |
|
1110 |
||
16763 | 1111 |
|nm| |
1112 |
||
1113 |
nm := self theNonMetaclass name. |
|
1114 |
^ nm copyReplaceAll:$: with:$_ ifNone:nm |
|
11866 | 1115 |
|
1116 |
" |
|
1117 |
Complex generateClassFilename |
|
1118 |
HTML::AbstractElement generateClassFilename |
|
1119 |
" |
|
1120 |
||
1121 |
"Modified: / 06-10-2006 / 16:16:01 / cg" |
|
1122 |
! |
|
1123 |
||
9497 | 1124 |
getClassFilename |
10050 | 1125 |
"return the name of the file from which the class was compiled. |
1126 |
If the class was loaded via an explicit load (i.e. from the fileBrowser), |
|
1127 |
this will be an absolute path. Oherwise, it will be a basename only." |
|
9497 | 1128 |
|
1129 |
|owner| |
|
1130 |
||
10050 | 1131 |
(owner := self owningClass) notNil ifTrue:[^ owner getClassFilename]. |
9497 | 1132 |
^ classFilename |
10050 | 1133 |
|
1134 |
"Modified: / 06-10-2006 / 13:32:01 / cg" |
|
9497 | 1135 |
! |
1136 |
||
9693
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
1137 |
getPackage |
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
1138 |
"get the package or nil." |
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
1139 |
|
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
1140 |
^ package |
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
1141 |
! |
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
1142 |
|
6731 | 1143 |
globalKeyForClassVar:aStringOrSymbol |
1144 |
"this helps to encapsulate the (current) implementation of classVariables |
|
1145 |
from the outside world. Currently, classvars are stored in |
|
1146 |
the Smalltalk dictionary with a funny name, since there are |
|
1147 |
no classPools yet. |
|
1148 |
" |
|
10184 | 1149 |
^ (self theNonMetaclass name , ':' , aStringOrSymbol) asSymbol |
1150 |
||
1151 |
"Modified: / 18-11-2006 / 17:13:39 / cg" |
|
6731 | 1152 |
! |
1153 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
1154 |
name |
8551 | 1155 |
"return the name of the class. |
6657 | 1156 |
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
|
1157 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
1158 |
^ name |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
1159 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
1160 |
"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
|
1161 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
1162 |
|
1919 | 1163 |
nameSpace |
2070
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
1164 |
"return the namespace I am contained in; |
18208 | 1165 |
For public classes, Smalltalk is returned. |
1166 |
For private classes, the owning class is returned. |
|
1167 |
For anonymous classes, nil should be returned - but for now, this also returns Smalltalk; |
|
14704 | 1168 |
but will change in the future to return nil then. |
18208 | 1169 |
This is left in for a while (because many users of this method expect a non-nil return value). |
14704 | 1170 |
In the meantime, use containingNameSpace, which provides the correct answer" |
2070
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
1171 |
|
18208 | 1172 |
|idx nsName e restName| |
7321 | 1173 |
|
1174 |
"/ cached in environment |
|
1175 |
environment isNil ifTrue:[ |
|
16020 | 1176 |
e := Smalltalk. "/ default |
1177 |
||
1178 |
name notNil ifTrue:[ |
|
1179 |
"/ due to the implementation, extract this from my name |
|
1180 |
"/ (physically, all classes are found in Smalltalk) |
|
1181 |
||
1182 |
idx := name lastIndexOf:$:. |
|
1183 |
idx ~~ 0 ifTrue:[ |
|
1184 |
(name at:idx-1) == $: ifTrue:[ |
|
1185 |
nsName := name copyTo:(idx - 2). |
|
18208 | 1186 |
e := Smalltalk at:nsName asSymbol ifAbsent:[^ Smalltalk "take care when asking an anon class"]. |
1187 |
]. |
|
16020 | 1188 |
]. |
1189 |
]. |
|
1190 |
environment := e. |
|
1919 | 1191 |
]. |
18208 | 1192 |
|
1193 |
(environment notNil and:[name notNil]) ifTrue:[ |
|
1194 |
[ |
|
1195 |
|tryE| |
|
1196 |
||
1197 |
"/ sub namespace ? |
|
1198 |
restName := name copyFrom:environment name size + 3. |
|
1199 |
idx := restName indexOf:$:. |
|
1200 |
(idx ~~ 0 and:[(restName at:idx+1) == $:]) ifTrue:[ |
|
1201 |
nsName := environment name , '::', (restName copyTo:idx-1). |
|
1202 |
tryE := Smalltalk at:nsName asSymbol. |
|
1203 |
tryE isNameSpace ifTrue:[ |
|
17651 | 1204 |
"/ Transcript showCR:nsName. |
1205 |
"/ Transcript showCR:restName. |
|
18208 | 1206 |
environment := tryE. |
17651 | 1207 |
]. |
1208 |
]. |
|
18208 | 1209 |
tryE == environment |
1210 |
] whileTrue. |
|
17651 | 1211 |
]. |
18208 | 1212 |
|
2493
ba34c6aac597
cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents:
2491
diff
changeset
|
1213 |
^ environment |
ba34c6aac597
cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents:
2491
diff
changeset
|
1214 |
|
17651 | 1215 |
" |
18208 | 1216 |
Expecco::KeyFile::Extension setEnvironment:nil. |
1217 |
Expecco::KeyFile::Extension nameSpace |
|
1218 |
Expecco::KeyFile::Extension containingNameSpace |
|
17651 | 1219 |
" |
1220 |
||
3661 | 1221 |
"Modified: / 20.7.1998 / 14:21:36 / cg" |
1919 | 1222 |
! |
1223 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1224 |
package |
14572 | 1225 |
"return the package-symbol of the class." |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1226 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1227 |
|owner| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1228 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1229 |
(owner := self owningClass) notNil ifTrue:[^ owner package]. |
12219
dd55372693c1
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
12197
diff
changeset
|
1230 |
package isNil ifTrue:[^ PackageId noProjectID]. |
9693
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
1231 |
^ package |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1232 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1233 |
" |
8551 | 1234 |
Object package |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1235 |
" |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1236 |
|
3951 | 1237 |
"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
|
1238 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1239 |
|
9494 | 1240 |
package:aSymbol |
18206 | 1241 |
"set the package-symbol of the class. |
1242 |
Sends out change notifications, so browers can update" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1243 |
|
9724 | 1244 |
|newPackage oldPackage| |
1245 |
||
12219
dd55372693c1
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
12197
diff
changeset
|
1246 |
aSymbol == PackageId noProjectID ifTrue:[ |
16273 | 1247 |
newPackage := nil |
9693
679da2cd8003
allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents:
9653
diff
changeset
|
1248 |
] ifFalse:[ |
16273 | 1249 |
newPackage := aSymbol |
9724 | 1250 |
]. |
1251 |
package ~= newPackage ifTrue:[ |
|
16273 | 1252 |
oldPackage := package. |
1253 |
(Smalltalk |
|
1254 |
changeRequest:#packageOfClass |
|
1255 |
with:(Array with:self with:oldPackage with:newPackage)) ifFalse:[ |
|
1256 |
^ self |
|
1257 |
]. |
|
1258 |
package := newPackage. |
|
1259 |
||
1260 |
self changed:#package. |
|
1261 |
Smalltalk changed:#projectOrganization with:(Array with:self with:oldPackage). |
|
9724 | 1262 |
]. |
9494 | 1263 |
|
1264 |
"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
|
1265 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1266 |
|
13188 | 1267 |
poolDictionaries |
1268 |
"this returns the concatenated pool name string" |
|
1269 |
||
13214 | 1270 |
^ self sharedPoolNames asStringWith:' ' |
1271 |
||
1272 |
"Modified: / 18-01-2011 / 17:56:12 / cg" |
|
13188 | 1273 |
! |
1274 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1275 |
primitiveDefinitions:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1276 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1277 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1278 |
"set the primitiveDefinition string" |
555 | 1279 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1280 |
(self isPrivate) ifTrue:[ |
13756 | 1281 |
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
|
1282 |
]. |
5800
a4386f928cf0
setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents:
5770
diff
changeset
|
1283 |
self setPrimitiveDefinitions:aString. |
555 | 1284 |
self addChangeRecordForPrimitiveDefinitions:self. |
1285 |
||
1286 |
"Created: 29.10.1995 / 19:41:39 / cg" |
|
1287 |
! |
|
1288 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1289 |
primitiveDefinitionsString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1290 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1291 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1292 |
"return the primitiveDefinition string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1293 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1294 |
|owner| |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1295 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1296 |
(owner := self owningClass) notNil ifTrue:[ |
13756 | 1297 |
^ owner primitiveDefinitionsString |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1298 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1299 |
^ self getSourceChunkAttribute:#primitiveDefinitions |
555 | 1300 |
|
1301 |
" |
|
8551 | 1302 |
Object primitiveDefinitionsString |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1303 |
String primitiveDefinitionsString |
555 | 1304 |
" |
1305 |
! |
|
1306 |
||
5875 | 1307 |
primitiveDefinitionsStringOrDefault |
1308 |
"return the primitiveDefinition string or a default" |
|
1309 |
||
1310 |
^ self primitiveDefinitionsString ? '%{ |
|
1311 |
||
1312 |
/* |
|
1313 |
* includes, defines, structure definitions |
|
1314 |
* and typedefs come here. |
|
1315 |
*/ |
|
1316 |
||
1317 |
%}' |
|
1318 |
||
1319 |
" |
|
1320 |
Object primitiveDefinitionsStringOrDefault |
|
1321 |
String primitiveDefinitionsStringOrDefault |
|
1322 |
ExternalStream primitiveDefinitionsStringOrDefault |
|
1323 |
" |
|
1324 |
! |
|
1325 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1326 |
primitiveFunctions:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1327 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1328 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1329 |
"set the primitiveFunction string" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1330 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1331 |
(self isPrivate) ifTrue:[ |
13756 | 1332 |
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
|
1333 |
]. |
5800
a4386f928cf0
setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents:
5770
diff
changeset
|
1334 |
self setPrimitiveFunctions:aString. |
555 | 1335 |
self addChangeRecordForPrimitiveFunctions:self. |
1336 |
||
1337 |
"Created: 29.10.1995 / 19:41:48 / cg" |
|
1338 |
! |
|
1339 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1340 |
primitiveFunctionsString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1341 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1342 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1343 |
"return the primitiveFunctions string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1344 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1345 |
|owner| |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1346 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1347 |
(owner := self owningClass) notNil ifTrue:[ |
13756 | 1348 |
^ owner primitiveFunctionsString |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1349 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1350 |
^ self getSourceChunkAttribute:#primitiveFunctions |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1351 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1352 |
|
5875 | 1353 |
primitiveFunctionsStringOrDefault |
1354 |
"return the primitiveFunction string or a default" |
|
1355 |
||
1356 |
^ self primitiveFunctionsString ? '%{ |
|
1357 |
||
8551 | 1358 |
/* |
5875 | 1359 |
* any local C (helper) functions |
1360 |
* come here (please, define as static) |
|
1361 |
*/ |
|
1362 |
||
1363 |
%}' |
|
1364 |
||
1365 |
" |
|
1366 |
Object primitiveFunctionsStringOrDefault |
|
1367 |
String primitiveFunctionsStringOrDefault |
|
1368 |
ExternalStream primitiveFunctionsStringOrDefault |
|
1369 |
" |
|
1370 |
! |
|
1371 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1372 |
primitiveVariables:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1373 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1374 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1375 |
"set the primitiveVariable string" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1376 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1377 |
(self isPrivate) ifTrue:[ |
13756 | 1378 |
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
|
1379 |
]. |
5800
a4386f928cf0
setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents:
5770
diff
changeset
|
1380 |
self setPrimitiveVariables:aString. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1381 |
self addChangeRecordForPrimitiveVariables:self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1382 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1383 |
"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
|
1384 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1385 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1386 |
primitiveVariablesString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1387 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1388 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1389 |
"return the primitiveVariables string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1390 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1391 |
|owner| |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1392 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1393 |
(owner := self owningClass) notNil ifTrue:[ |
13756 | 1394 |
^ owner primitiveVariablesString |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1395 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
1396 |
^ self getSourceChunkAttribute:#primitiveVariables |
555 | 1397 |
! |
1398 |
||
5875 | 1399 |
primitiveVariablesStringOrDefault |
1400 |
"return the primitiveVariable string or a default" |
|
1401 |
||
1402 |
^ self primitiveVariablesString ? '%{ |
|
1403 |
||
8551 | 1404 |
/* |
5875 | 1405 |
* any local C variables |
1406 |
* come here (please, define as static) |
|
1407 |
*/ |
|
1408 |
||
1409 |
%}' |
|
1410 |
||
1411 |
" |
|
1412 |
Object primitiveVariablesStringOrDefault |
|
1413 |
String primitiveVariablesStringOrDefault |
|
1414 |
ExternalStream primitiveVariablesStringOrDefault |
|
1415 |
" |
|
1416 |
! |
|
1417 |
||
11137 | 1418 |
privateClassNamed:aClassNameStringOrSymbol |
1419 |
^ self privateClassesAt:aClassNameStringOrSymbol |
|
1420 |
! |
|
1421 |
||
1739 | 1422 |
privateClasses |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1423 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1424 |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1425 |
"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
|
1426 |
The classes are in any order." |
1739 | 1427 |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1428 |
^ self privateClassesOrAll:false |
1739 | 1429 |
|
1430 |
" |
|
1431 |
Object privateClasses |
|
8551 | 1432 |
ObjectMemory privateClasses |
1433 |
UILayoutTool privateClasses |
|
1739 | 1434 |
" |
1435 |
||
3495
31ae10035c74
skip obsolete leftover private classes when enumerating.
Claus Gittinger <cg@exept.de>
parents:
3494
diff
changeset
|
1436 |
"Modified: / 29.5.1998 / 23:23:18 / cg" |
1739 | 1437 |
! |
1438 |
||
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1439 |
privateClassesAt:aClassNameStringOrSymbol |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1440 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1441 |
|
1707 | 1442 |
"return a private class if present; nil otherwise" |
1443 |
||
8726 | 1444 |
|myName nmSym| |
1445 |
||
1446 |
myName := self name. |
|
1447 |
myName isNil ifTrue:[ |
|
13756 | 1448 |
"/ no name - there cannot be a corresponding private class |
1449 |
^ nil |
|
8726 | 1450 |
]. |
1451 |
nmSym := (myName , '::' , aClassNameStringOrSymbol) asSymbolIfInterned. |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
1452 |
nmSym isNil ifTrue:[ |
13756 | 1453 |
"/ no such symbol - there cannot be a corresponding private class |
1454 |
^ nil |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
1455 |
]. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
1456 |
|
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1457 |
^ Smalltalk at:nmSym. |
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1458 |
|
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1459 |
"Modified: 26.6.1997 / 11:44:04 / cg" |
1707 | 1460 |
! |
1461 |
||
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1462 |
privateClassesAt:aClassNameStringOrSymbol put:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1463 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1464 |
|
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1465 |
"add a private class" |
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1466 |
|
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1467 |
self classVarAt:(':' , aClassNameStringOrSymbol) put:aClass |
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1468 |
|
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1469 |
"Modified: 26.6.1997 / 11:44:12 / cg" |
1707 | 1470 |
! |
1471 |
||
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1472 |
privateClassesOrAll:allOfThem |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1473 |
"{ Pragma: +optSpace }" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1474 |
|
4495
4804e3e33d76
tuned #privateClasses access
Claus Gittinger <cg@exept.de>
parents:
4400
diff
changeset
|
1475 |
"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
|
1476 |
or direct plus indirect private classes (if allOfThem). |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1477 |
An empty collection if there are none. |
13507
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1478 |
The classes are in no particular order." |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1479 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1480 |
|classes myName myNamePrefix myNamePrefixLen| |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1481 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1482 |
myName := self name. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1483 |
myNamePrefix := myName , '::'. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1484 |
myNamePrefixLen := myNamePrefix size. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1485 |
|
4575 | 1486 |
Smalltalk keysDo:[:nm | |
13756 | 1487 |
|cls| |
1488 |
||
1489 |
(nm startsWith:myNamePrefix) ifTrue:[ |
|
1490 |
(allOfThem |
|
1491 |
or:[(nm indexOf:$: startingAt:myNamePrefixLen + 1) == 0]) ifTrue:[ |
|
1492 |
cls := Smalltalk at:nm. |
|
1493 |
||
1494 |
(cls isBehavior and:[cls isMeta not]) ifTrue:[ |
|
1495 |
classes isNil ifTrue:[ |
|
1496 |
classes := Set new:10. |
|
1497 |
]. |
|
1498 |
classes add:cls. |
|
1499 |
] |
|
1500 |
] |
|
1501 |
] |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1502 |
]. |
4575 | 1503 |
|
4578 | 1504 |
^ classes ? #() |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1505 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1506 |
" |
8551 | 1507 |
UILayoutTool privateClassesOrAll:true |
1508 |
UILayoutTool privateClassesOrAll:false |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1509 |
" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1510 |
|
13507
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1511 |
"Modified: / 29-05-1998 / 23:23:18 / cg" |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
1512 |
"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
|
1513 |
! |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1514 |
|
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1515 |
privateClassesSorted |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1516 |
"{ Pragma: +optSpace }" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1517 |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1518 |
"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
|
1519 |
The classes are sorted by inheritance." |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1520 |
|
7894 | 1521 |
|classes pivateClassesOf| |
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1522 |
|
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1523 |
classes := self privateClasses. |
14146 | 1524 |
classes notEmpty ifTrue:[ |
14837 | 1525 |
classes := classes asOrderedCollection. |
1526 |
classes sort:[:a :b | a name < b name]. |
|
1527 |
||
1528 |
pivateClassesOf := IdentityDictionary new. |
|
1529 |
classes do:[:each | pivateClassesOf at:each put:(each allPrivateClasses)]. |
|
1530 |
||
1531 |
classes topologicalSort:[:a :b | |
|
1532 |
"/ a must come before b iff: |
|
1533 |
"/ b is a subclass of a |
|
1534 |
"/ b has a private class which is a subclass of a |
|
1535 |
||
1536 |
|mustComeBefore pivateClassesOfB| |
|
1537 |
mustComeBefore := b isSubclassOf:a. |
|
1538 |
pivateClassesOfB := pivateClassesOf at:b. |
|
1539 |
pivateClassesOfB do:[:eachClassInB | |
|
1540 |
mustComeBefore := mustComeBefore or:[eachClassInB isSubclassOf:a] |
|
1541 |
]. |
|
1542 |
mustComeBefore |
|
1543 |
]. |
|
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1544 |
]. |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1545 |
^ classes. |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1546 |
|
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1547 |
" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1548 |
Object privateClassesSorted |
14146 | 1549 |
Class privateClassesSorted |
1550 |
Class privateClasses |
|
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1551 |
" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1552 |
|
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1553 |
"Created: 22.3.1997 / 16:10:42 / cg" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1554 |
"Modified: 22.3.1997 / 16:11:20 / cg" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1555 |
! |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1556 |
|
9959 | 1557 |
projectDefinition |
12197
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1558 |
<resource: #obsolete> |
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1559 |
"return the project definition of the classes package" |
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1560 |
|
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1561 |
self obsoleteMethodWarning. |
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1562 |
^ self projectDefinitionClass |
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1563 |
|
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1564 |
" |
13756 | 1565 |
Object projectDefinition productVersion |
1566 |
DAPASX::DapasUI projectDefinition productVersion |
|
12197
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1567 |
" |
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1568 |
|
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1569 |
"Created: / 19-09-2006 / 22:02:06 / cg" |
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1570 |
! |
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1571 |
|
c48ecb09d4a0
projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents:
12103
diff
changeset
|
1572 |
projectDefinitionClass |
18559 | 1573 |
"return the project definition of the classes' package. |
1574 |
Eg. for Array, this would return the stx_libbasic project definition class." |
|
9959 | 1575 |
|
1576 |
^ ProjectDefinition definitionClassForPackage: self package |
|
1577 |
||
1578 |
" |
|
13756 | 1579 |
Object projectDefinitionClass productVersion |
1580 |
DAPASX::DapasUI projectDefinitionClass productVersion |
|
9959 | 1581 |
" |
1582 |
||
1583 |
"Created: / 19-09-2006 / 22:02:06 / cg" |
|
1584 |
! |
|
1585 |
||
13214 | 1586 |
realSharedPoolNames |
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1587 |
"this returns the namespace aware pool names" |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1588 |
|
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1589 |
|poolNames ns| |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1590 |
|
13214 | 1591 |
poolNames := self sharedPoolNames. |
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1592 |
(ns := self topNameSpace) notNil ifTrue:[ |
17403 | 1593 |
^ poolNames |
1594 |
collect:[:nm | |
|
1595 |
|p| |
|
1596 |
(p := ns at:nm asSymbol) notNil ifTrue:[ |
|
1597 |
p name |
|
1598 |
] ifFalse:[ |
|
1599 |
nm |
|
1600 |
]]. |
|
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1601 |
]. |
13756 | 1602 |
^ poolNames |
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1603 |
|
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1604 |
" |
17403 | 1605 |
HGCommand sharedPoolNames |
1606 |
HGCommand realSharedPoolsNames |
|
1607 |
HGCommand sharedPoolNames |
|
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1608 |
Croquet::OpenGL sharedPools |
17403 | 1609 |
Croquet::OpenGL sharedPools |
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1610 |
" |
13214 | 1611 |
|
1612 |
"Created: / 18-01-2011 / 18:02:25 / cg" |
|
1613 |
! |
|
1614 |
||
1615 |
realSharedPools |
|
1616 |
"this returns the namespace aware pools" |
|
1617 |
||
1618 |
|ns| |
|
1619 |
||
1620 |
ns := self topNameSpace. |
|
1621 |
^ self sharedPoolNames collect:[:nm | ns at:nm] |
|
1622 |
||
1623 |
" |
|
1624 |
Croquet::OpenGL sharedPools |
|
1625 |
Croquet::OpenGL realSharedPools |
|
1626 |
||
1627 |
Win32OperatingSystem realSharedPools |
|
1628 |
Win32OperatingSystem realSharedPoolNames |
|
1629 |
" |
|
1630 |
||
1631 |
"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
|
1632 |
! |
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1633 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1634 |
removeClassVarName:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1635 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1636 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1637 |
"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
|
1638 |
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
|
1639 |
|
6731 | 1640 |
|names newNames| |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1641 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1642 |
names := self classVarNames. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1643 |
(names includes:aString) ifTrue:[ |
13756 | 1644 |
newNames := ''. |
1645 |
names do:[:nm | nm ~= aString ifTrue:[newNames := newNames , nm , ' ']]. |
|
1646 |
self classVariableString:newNames withoutSpaces. |
|
1647 |
Class withoutUpdatingChangesDo:[ |
|
1648 |
self withAllSubclasses do:[:cls| |
|
1649 |
cls recompileMethodsAccessingAnyClassvarOrGlobal: |
|
1650 |
(Array with:aString asSymbol) |
|
1651 |
]. |
|
1652 |
]. |
|
1653 |
self addChangeRecordForClass:self andNotifyChangeOf:#classVariables. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1654 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1655 |
|
3220
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
1656 |
"Created: / 29.10.1995 / 19:42:08 / cg" |
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
1657 |
"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
|
1658 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1659 |
|
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1660 |
setCategory:aStringOrSymbol |
18206 | 1661 |
"set the category of the class to be the argument, aStringOrSymbol. |
1662 |
Does NOT send out change notifications (so browers will NOT update)" |
|
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1663 |
|
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1664 |
aStringOrSymbol isNil ifTrue:[ |
18206 | 1665 |
category := aStringOrSymbol |
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1666 |
] ifFalse:[ |
18206 | 1667 |
category := aStringOrSymbol asSymbol |
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1668 |
] |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1669 |
|
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1670 |
"Created: 1.4.1997 / 15:24:04 / stefan" |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1671 |
! |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1672 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1673 |
setClassFilename:aFilename |
8551 | 1674 |
"set the classes filename. |
13756 | 1675 |
This is a dangerous (low level) operation, |
19109 | 1676 |
since the comment and primitiveSpecs may no longer be accessible, |
10050 | 1677 |
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
|
1678 |
|
18936 | 1679 |
|baseName| |
1680 |
||
1681 |
"/ cg: somewhere, the filename is set from a temporary (checkout) files name. |
|
1682 |
"/ we MUST catch and FIX this. |
|
1683 |
aFilename notNil ifTrue:[ |
|
1684 |
baseName := aFilename asFilename baseName. |
|
1685 |
(baseName startsWith:'st') ifTrue:[ |
|
1686 |
(baseName at:3) isDigit ifTrue:[ |
|
1687 |
self halt:'this should not be reached' |
|
1688 |
]. |
|
1689 |
]. |
|
10141
669ade985ad7
temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents:
10102
diff
changeset
|
1690 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1691 |
classFilename := aFilename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1692 |
|
10050 | 1693 |
"Modified: / 08-09-1995 / 14:16:48 / claus" |
10142 | 1694 |
"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
|
1695 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1696 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1697 |
setClassVariableString:aString |
8551 | 1698 |
"set the classes classvarnames string. |
1699 |
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
|
1700 |
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
|
1701 |
NO change record is written." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1702 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1703 |
classvars := aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1704 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1705 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1706 |
setComment:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1707 |
"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
|
1708 |
do NOT create a change record" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1709 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1710 |
comment := aString |
1 | 1711 |
! |
1712 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1713 |
setComment:com category:categoryStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1714 |
"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
|
1715 |
do NOT create a change record" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1716 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1717 |
|cat| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1718 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1719 |
comment := com. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1720 |
categoryStringOrSymbol isNil ifTrue:[ |
13756 | 1721 |
cat := '' |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1722 |
] ifFalse:[ |
13756 | 1723 |
cat := categoryStringOrSymbol |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1724 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1725 |
category := cat asSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1726 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1727 |
|
5248 | 1728 |
setEnvironment:aNamespace |
1729 |
"set the namespace I am contained in; ST-80 compatible name" |
|
1730 |
||
1731 |
environment := aNamespace |
|
1732 |
! |
|
1733 |
||
9494 | 1734 |
setPackage:aSymbol |
18206 | 1735 |
"set the package of the class. |
1736 |
Does NOT send out change notifications (so browers will NOT update)" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1737 |
|
9494 | 1738 |
package := aSymbol |
1739 |
||
1740 |
"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
|
1741 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1742 |
|
13214 | 1743 |
sharedPoolNames |
1744 |
"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
|
1745 |
|
8561
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1746 |
|pools| |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1747 |
|
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1748 |
pools := self getAttribute:#sharedPools. |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1749 |
pools isNil ifTrue:[ |
15032
5fbddc5403d3
Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents:
14929
diff
changeset
|
1750 |
^ #(). |
8561
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1751 |
]. |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1752 |
pools isString ifTrue:[ |
15095 | 1753 |
pools := (pools asCollectionOfWords collect:[:varName| varName asSymbol]) as:Array. |
15032
5fbddc5403d3
Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents:
14929
diff
changeset
|
1754 |
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
|
1755 |
]. |
6b9062af68c2
#sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents:
8552
diff
changeset
|
1756 |
^ pools |
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1757 |
|
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1758 |
" |
15095 | 1759 |
OSI::ASN1_Coder sharedPoolNames |
1760 |
Croquet::OpenGL sharedPoolNames |
|
1761 |
OpenGLRenderingContext sharedPoolNames |
|
1762 |
Character sharedPoolNames |
|
1763 |
Win32OperatingSystem sharedPoolNames |
|
10843
0ae979759230
pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents:
10474
diff
changeset
|
1764 |
" |
13188 | 1765 |
|
13214 | 1766 |
"Created: / 18-01-2011 / 17:55:42 / cg" |
1767 |
! |
|
1768 |
||
1769 |
sharedPoolNames:aStringOrCollection |
|
8551 | 1770 |
"{ Pragma: +optSpace }" |
1771 |
||
18206 | 1772 |
"set the sharedPools string (no change notifications) |
1773 |
Does NOT send out change notifications (so browers will NOT update)" |
|
8551 | 1774 |
|
13221
11f21a9fb78d
added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents:
13214
diff
changeset
|
1775 |
self setSharedPoolNames:aStringOrCollection. |
8551 | 1776 |
self addChangeRecordForClass:self. |
10050 | 1777 |
|
13214 | 1778 |
"Created: / 18-01-2011 / 17:55:48 / cg" |
13221
11f21a9fb78d
added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents:
13214
diff
changeset
|
1779 |
"Modified: / 18-01-2011 / 20:41:17 / cg" |
13214 | 1780 |
! |
1781 |
||
1782 |
sharedPools |
|
14929 | 1783 |
"this returns a collection of the real pools (i.e. the PoolDictionaries), |
1784 |
not their names (see sharedPoolNames)" |
|
13762 | 1785 |
|
14147 | 1786 |
|ns ns2 pools| |
13999 | 1787 |
|
1788 |
ns := self nameSpace. |
|
14837 | 1789 |
ns2 := self topNameSpace. |
13999 | 1790 |
pools := |
14929 | 1791 |
self sharedPoolNames |
1792 |
collect:[:eachName | |
|
1793 |
|pool| |
|
1794 |
||
1795 |
ns ~= Smalltalk ifTrue:[ |
|
15095 | 1796 |
pool := ns classNamed:eachName. |
14929 | 1797 |
]. |
1798 |
pool isNil ifTrue:[ |
|
1799 |
ns2 ~= Smalltalk ifTrue:[ |
|
15095 | 1800 |
pool := ns2 classNamed:eachName. |
14929 | 1801 |
]. |
1802 |
]. |
|
1803 |
pool isNil ifTrue:[ |
|
15095 | 1804 |
pool := Smalltalk classNamed:eachName. |
14929 | 1805 |
pool isNil ifTrue:[ |
1806 |
Transcript showCR:('Warning: no such pool: ',eachName). |
|
1807 |
] |
|
1808 |
]. |
|
1809 |
pool |
|
1810 |
] |
|
15095 | 1811 |
thenSelect:[:pool | pool notNil]. |
1812 |
||
1813 |
^ pools. |
|
1814 |
||
13214 | 1815 |
|
1816 |
" |
|
15095 | 1817 |
OSI::ASN1_Coder sharedPoolNames |
1818 |
OSI::ASN1_Coder sharedPools |
|
13214 | 1819 |
Croquet::OpenGL sharedPools |
13756 | 1820 |
OpenGLRenderingContext sharedPools |
14837 | 1821 |
Character sharedPools |
13756 | 1822 |
Win32OperatingSystem sharedPools |
13214 | 1823 |
" |
1824 |
||
14147 | 1825 |
"Modified: / 29-05-2012 / 12:09:27 / cg" |
13762 | 1826 |
! |
1827 |
||
1828 |
sharedPools:aCollection |
|
13214 | 1829 |
"{ Pragma: +optSpace }" |
1830 |
||
13762 | 1831 |
"set the sharedPools expects the real pools (i.e. the PoolDictionaries)" |
1832 |
||
15040 | 1833 |
"/ for backward compatibility, also allow a string arg.. |
13762 | 1834 |
aCollection isString ifTrue:[ |
15075 | 1835 |
Transcript show:self name; showCR:' [warning]: string passed to #sharedPools:'. |
15040 | 1836 |
self sharedPoolNames:(aCollection asCollectionOfWords collect:[:each | each asSymbol]). |
1837 |
^ self. |
|
13762 | 1838 |
]. |
1839 |
self sharedPoolNames: |
|
15040 | 1840 |
(aCollection |
1841 |
collect:[:each | |
|
1842 |
each isString |
|
1843 |
ifTrue:[ each asSymbol ] |
|
1844 |
ifFalse:[ each name ] |
|
1845 |
] |
|
1846 |
). |
|
13762 | 1847 |
|
13766 | 1848 |
"Modified: / 03-10-2011 / 10:30:30 / cg" |
8551 | 1849 |
! |
1850 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1851 |
source |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1852 |
"return the classes full source code" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1853 |
|
15466 | 1854 |
|code aStream| |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1855 |
|
10050 | 1856 |
" 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
|
1857 |
code := String new:1000. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1858 |
aStream := WriteStream on:code. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1859 |
self fileOutOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1860 |
" |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
1861 |
[ |
15466 | 1862 |
aStream := FileStream newTemporary. |
1863 |
aStream removeOnClose:true. |
|
8737
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1864 |
] on:OpenError do:[:ex| |
15466 | 1865 |
self warn:'Class>>#source: cannot create temporary file: ', ex description. |
1866 |
^ nil |
|
555 | 1867 |
]. |
8737
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1868 |
[ |
15466 | 1869 |
FileOutErrorSignal handle:[:ex | |
1870 |
aStream nextPut:$" ; nextPutAll:ex description; nextPut:$". |
|
1871 |
FileOutErrorSignal isHandled ifTrue:[ |
|
1872 |
ex reject. |
|
1873 |
]. |
|
1874 |
] do:[ |
|
1875 |
self fileOutOn:aStream. |
|
1876 |
]. |
|
1877 |
aStream reset. |
|
1878 |
code := aStream contents. |
|
8737
8ddb74dc1833
Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents:
8726
diff
changeset
|
1879 |
] ensure:[ |
15466 | 1880 |
aStream close. |
555 | 1881 |
]. |
1882 |
^ code |
|
10050 | 1883 |
|
1884 |
"Modified: / 06-10-2006 / 13:34:18 / cg" |
|
385 | 1885 |
! |
1886 |
||
19154
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1887 |
sourceChecksumFromBinaryRevision |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1888 |
| start checksum | |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1889 |
revision isNil ifTrue:[ ^ nil ]. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1890 |
start:= revision indexOfString: 'SHA1='. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1891 |
start ~~ 0 ifTrue:[ |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1892 |
checksum := ByteArray new: 20. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1893 |
1 to: 20 do: [ :i | |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1894 |
| si hi lo | |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1895 |
|
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1896 |
si := start + 3 + (i * 2). |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1897 |
hi := (revision at: si) digitValue. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1898 |
lo := (revision at: si + 1) digitValue. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1899 |
checksum at:i put: ((hi bitShift:4) bitOr: lo) |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1900 |
] |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1901 |
]. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1902 |
^ checksum |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1903 |
|
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1904 |
" |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1905 |
Class sourceChecksumFromBinaryRevision |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1906 |
" |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1907 |
|
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1908 |
"Created: / 26-01-2016 / 11:18:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1909 |
! |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1910 |
|
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1911 |
sourceChecksumFromStream: aStream |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1912 |
| stream position hash buffer | |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1913 |
|
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1914 |
stream := aStream stream. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1915 |
position := stream position. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1916 |
hash := SHA1Stream new. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1917 |
buffer := ByteArray new: 4096. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1918 |
stream position: 0. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1919 |
|
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1920 |
[ stream atEnd ] whileFalse:[ |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1921 |
| read | |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1922 |
|
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1923 |
read := stream nextAvailableBytes: buffer size into: buffer startingAt: 1. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1924 |
hash nextPutBytes: read from: buffer startingAt: 1 |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1925 |
]. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1926 |
stream position: position. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1927 |
^ hash hashValue. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1928 |
|
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1929 |
" |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1930 |
Class sourceChecksumFromStream: Class sourceStream |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1931 |
Class sourceChecksumFromBinaryRevision |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1932 |
|
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1933 |
(Class sourceChecksumFromStream: Class sourceStream) = (Class sourceChecksumFromBinaryRevision) |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1934 |
" |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1935 |
|
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1936 |
"Created: / 26-01-2016 / 11:24:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1937 |
! |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
1938 |
|
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1939 |
sourceCodeManager |
16815
0fa21cfaf70c
comment/format in: Class>>sourceCodeManager
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16814
diff
changeset
|
1940 |
"Return my (configured) source code manager." |
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1941 |
|
12308 | 1942 |
|owner| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1943 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1944 |
(owner := self owningClass) notNil ifTrue:[^ owner sourceCodeManager]. |
10166 | 1945 |
|
1946 |
"/ see if there is a package-specific manager |
|
12308 | 1947 |
AbstractSourceCodeManager notNil ifTrue:[ |
16814
20cb0799f5d3
Fix in Class>>sourceCodeManager: use instead od directly accessing package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16763
diff
changeset
|
1948 |
^ AbstractSourceCodeManager sourceCodeManagerForPackage: self package. |
10166 | 1949 |
]. |
12308 | 1950 |
|
17154 | 1951 |
^ Smalltalk at:#SourceCodeManager "/ nil if SCM is disabled |
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1952 |
|
10166 | 1953 |
" |
1954 |
Array sourceCodeManager |
|
1955 |
foo_p1 sourceCodeManager |
|
1956 |
" |
|
1957 |
||
1958 |
"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
|
1959 |
"Modified: / 05-12-2006 / 22:04:26 / cg" |
16815
0fa21cfaf70c
comment/format in: Class>>sourceCodeManager
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16814
diff
changeset
|
1960 |
"Modified (comment): / 04-08-2014 / 00:35:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12857
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1961 |
! |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
1962 |
|
15947 | 1963 |
sourceCodeManagerFromBinaryRevision |
1964 |
||
1965 |
"Returns the source code manager that should be used for |
|
1966 |
source code access based in class's binary revision. |
|
1967 |
If not binary revision is available, then configured source |
|
1968 |
code manager is returned. If source code management |
|
1969 |
is disabled or particular source code manager is not enabled, |
|
1970 |
return nil. |
|
1971 |
||
1972 |
Source code manager for source access may differ from |
|
1973 |
configured source code manager: |
|
1974 |
||
1975 |
- #sourceCodeManager returns the manager use has configured for |
|
1976 |
this class using preferences |
|
1977 |
||
1978 |
- #sourceCodeManagerForSourceAccess is the manager used when asking |
|
1979 |
for class source code. It compares version_XXX methods with |
|
1980 |
class's binary revision and. When method_XXX matches the |
|
1981 |
binary revision string, XXX source code manager is returned, |
|
1982 |
as this class has been likely compiled from a source checked out |
|
1983 |
using returned source code manager |
|
1984 |
||
1985 |
CAVEAT: Now, the code expects that the revision string is in |
|
1986 |
format '$revision ident$SCM'. It won't work for managers that |
|
1987 |
does not use dollar expansion. For, only CVS, SVN and Perforce |
|
1988 |
are used so this code should work |
|
1989 |
" |
|
1990 |
||
19876 | 1991 |
AbstractSourceCodeManager isNil ifTrue:[^ nil]. "/ SCM package not yet loaded. |
15947 | 1992 |
|
1993 |
||
16814
20cb0799f5d3
Fix in Class>>sourceCodeManager: use instead od directly accessing package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16763
diff
changeset
|
1994 |
revision isNil ifTrue:[^self sourceCodeManager]. |
20cb0799f5d3
Fix in Class>>sourceCodeManager: use instead od directly accessing package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16763
diff
changeset
|
1995 |
|
20cb0799f5d3
Fix in Class>>sourceCodeManager: use instead od directly accessing package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16763
diff
changeset
|
1996 |
AbstractSourceCodeManager availableManagers do:[:mgr | |
15947 | 1997 |
(revision endsWith: mgr managerTypeNameShort) ifTrue:[ |
1998 |
^mgr |
|
1999 |
] |
|
2000 |
]. |
|
2001 |
||
2002 |
"binary revision is not nil and we haven't found source code manager. |
|
2003 |
This may happen when (i) given source code manager is not available |
|
2004 |
or (ii) source version methods are somehow corrupted. |
|
2005 |
||
2006 |
Let's be strict about it for now and throw and error. More relaxed |
|
2007 |
version may simply return nil" |
|
2008 |
||
2009 |
"/ self error:'Cannot find source code manager for source access ' , |
|
2010 |
"/ '(manager yet not loaded or binary revision corrupted)' |
|
2011 |
"/ mayProceed: true. |
|
2012 |
||
2013 |
^nil |
|
2014 |
||
2015 |
||
2016 |
" |
|
2017 |
Object sourceCodeManager |
|
2018 |
Object sourceCodeManagerForSourceAccess |
|
2019 |
||
2020 |
JavaVM sourceCodeManager |
|
2021 |
JavaVM sourceCodeManagerForSourceAccess |
|
2022 |
" |
|
2023 |
||
2024 |
"Created: / 06-10-2011 / 09:33:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
16814
20cb0799f5d3
Fix in Class>>sourceCodeManager: use instead od directly accessing package.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16763
diff
changeset
|
2025 |
"Modified (format): / 04-08-2014 / 00:32:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
15947 | 2026 |
! |
2027 |
||
12903 | 2028 |
subclasses |
2029 |
"return a collection of the direct subclasses of the receiver" |
|
2030 |
||
2031 |
"/ use cached information (avoid class hierarchy search), if possible |
|
14837 | 2032 |
(subclasses isNil |
13860 | 2033 |
or:[ subclasses sequenceNumber ~= SubclassCacheSequenceNumber ]) ifTrue:[ |
14837 | 2034 |
self updateAllCachedSubclasses. |
2035 |
"subclasses may still be nil - obsolete classes may not be updated" |
|
2036 |
^ subclasses ? #(). |
|
12903 | 2037 |
]. |
12906 | 2038 |
^ subclasses. |
12903 | 2039 |
|
2040 |
" |
|
2041 |
Class flushSubclassInfo. |
|
12906 | 2042 |
Class subclasses. |
2043 |
SmallInteger subclasses |
|
12903 | 2044 |
" |
2045 |
||
13860 | 2046 |
"Modified: / 06-12-2011 / 16:05:16 / cg" |
12903 | 2047 |
! |
2048 |
||
12857
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2049 |
superclass:aClass |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2050 |
"set the superclass - this actually creates a new class, |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2051 |
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
|
2052 |
around anonymously to allow existing instances some life. |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2053 |
This may change in the future (adjusting existing instances)" |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2054 |
|
16622
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2055 |
|owner ns nm| |
12857
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2056 |
|
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2057 |
"must flush caches since lookup chain changes" |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2058 |
ObjectMemory flushCaches. |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2059 |
|
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2060 |
"/ for correct recompilation, just create a new class ... |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2061 |
"/ but care to avoid a nameSpace change, by giving my |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2062 |
"/ full name and answering with Smalltalk to a nameSpace query. |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2063 |
|
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2064 |
(owner := self owningClass) notNil ifTrue:[ |
16622
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2065 |
ns := owner. |
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2066 |
nm := self nameWithoutPrefix asSymbol |
12857
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2067 |
] ifFalse:[ |
16622
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2068 |
ns := Smalltalk. |
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2069 |
nm := self name |
12857
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2070 |
]. |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2071 |
|
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2072 |
Class classRedefinitionNotification answer:#keep do:[ |
16622
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2073 |
Class nameSpaceQuerySignal |
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2074 |
answer:ns |
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2075 |
do:[ |
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2076 |
aClass |
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2077 |
perform:(self definitionSelector) |
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2078 |
withArguments:(Array with:nm |
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2079 |
with:(self instanceVariableString) |
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2080 |
with:(self classVariableString) |
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2081 |
with:(self sharedPoolNames asStringWith: ' ') |
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2082 |
with:(self category)). |
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2083 |
] |
12857
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2084 |
] |
2a99557cf850
moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents:
12840
diff
changeset
|
2085 |
|
16622
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2086 |
"Modified: / 20-06-1998 / 18:17:37 / cg" |
8f09bdc1c316
Fix Class>>superclass: dor RegressionTests::ClassBuilderTests>>test_pools_02
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16498
diff
changeset
|
2087 |
"Modified: / 24-06-2014 / 17:02:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13507
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
2088 |
! |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
2089 |
|
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
2090 |
withAllPrivateClasses |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
2091 |
"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
|
2092 |
This also inclueds all private classes of private classes, recursively. |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
2093 |
Elements are in no particular order." |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
2094 |
|
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
2095 |
|coll| |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
2096 |
|
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
2097 |
coll := OrderedCollection new. |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
2098 |
self withAllPrivateClassesDo:[:cls | coll add:cls]. |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
2099 |
^ coll |
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
2100 |
|
8a63453a75ec
added: #withAllPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
13476
diff
changeset
|
2101 |
"Created: / 18-07-2011 / 09:14:38 / cg" |
1 | 2102 |
! ! |
2103 |
||
19834 | 2104 |
|
5257 | 2105 |
!Class methodsFor:'adding & removing'! |
1 | 2106 |
|
12903 | 2107 |
removeFromSystem |
2108 |
"ST-80 compatibility |
|
2109 |
remove myself from the system" |
|
2110 |
||
2111 |
Smalltalk removeClass:self. |
|
2112 |
Smalltalk removeKey:name. |
|
2113 |
||
2114 |
"Created: 6.2.1996 / 11:32:58 / stefan" |
|
2115 |
! |
|
2116 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2117 |
unload |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2118 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2119 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2120 |
"if the receiver was autoloaded, unload and reinstall it as |
293 | 2121 |
autoloaded. Can be used to get rid of no longer needed autoloaded |
8551 | 2122 |
classes. |
328 | 2123 |
(maybe, autoloaded classes should unload themselfes when no |
8551 | 2124 |
longer needed - for example, after some delay when the last instance |
328 | 2125 |
is gone ...)" |
293 | 2126 |
|
9371
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
2127 |
|nm newClass privateClasses| |
293 | 2128 |
|
216 | 2129 |
self wasAutoloaded ifFalse:[ |
13756 | 2130 |
" |
2131 |
can it be done ? |
|
2132 |
(all of my methods must have a source) |
|
2133 |
" |
|
2134 |
self instAndClassSelectorsAndMethodsDo:[:sel :aMethod | |
|
2135 |
aMethod source isNil ifTrue:[^false]. |
|
2136 |
aMethod hasPrimitiveCode ifTrue:[^ false]. |
|
2137 |
]. |
|
216 | 2138 |
]. |
2139 |
||
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
2140 |
"/ 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
|
2141 |
self allSubclassesDo:[:eachSubclass | |
13756 | 2142 |
eachSubclass wasAutoloaded ifFalse:[ |
2143 |
eachSubclass isPrivate ifFalse:[ |
|
2144 |
self warn:('cannot unload ' , self name , ' (' , eachSubclass name , ' requires it)'). |
|
2145 |
^ false. |
|
2146 |
] |
|
2147 |
] |
|
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
2148 |
]. |
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
2149 |
|
9371
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
2150 |
self allSubclassesDo:[:eachSubclass | |
13756 | 2151 |
eachSubclass wasAutoloaded ifTrue:[ |
2152 |
eachSubclass unload |
|
2153 |
] ifFalse:[ |
|
2154 |
eachSubclass removeFromSystem. |
|
2155 |
] |
|
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
2156 |
]. |
9371
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
2157 |
privateClasses := self privateClasses. |
ebe6d3c65ade
Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents:
9178
diff
changeset
|
2158 |
privateClasses notEmpty ifTrue:[ |
13756 | 2159 |
self withoutUpdatingChangesDo:[ |
2160 |
privateClasses do:[:eachPrivateClass | |
|
2161 |
eachPrivateClass removeFromSystem. |
|
2162 |
]. |
|
2163 |
]. |
|
283 | 2164 |
]. |
1415 | 2165 |
Transcript showCR:'unloading ' , name , ' ...'. |
283 | 2166 |
|
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
2167 |
"/ reinstall as autoloaded |
8551 | 2168 |
Autoload removeClass:self. |
293 | 2169 |
nm := name. |
2170 |
Smalltalk at:nm put:nil. |
|
288 | 2171 |
ObjectMemory flushInlineCaches. |
2172 |
ObjectMemory flushMethodCache. |
|
4052 | 2173 |
newClass := Autoload addClass:nm inCategory:category. |
2174 |
newClass notNil ifTrue:[ |
|
13756 | 2175 |
newClass package:package |
4052 | 2176 |
]. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2177 |
Smalltalk flushCachedClasses. |
12701 | 2178 |
Class flushSubclassInfoFor:self. |
216 | 2179 |
^ true |
2180 |
||
2181 |
" |
|
2182 |
Clock open. |
|
2183 |
Clock unload. |
|
2184 |
ClockView unload. |
|
2185 |
Clock open |
|
2186 |
" |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2187 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2188 |
"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
|
2189 |
"Modified: 4.6.1997 / 14:48:02 / cg" |
1 | 2190 |
! ! |
2191 |
||
13474 | 2192 |
|
1 | 2193 |
!Class methodsFor:'changes management'! |
2194 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2195 |
addChangeRecordForChangeCategory |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2196 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2197 |
|
6097 | 2198 |
"add a category change" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2199 |
|
14612 | 2200 |
UpdateChangeFileQuerySignal query ifTrue:[ |
14837 | 2201 |
self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category. |
6097 | 2202 |
]. |
2203 |
||
2204 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2205 |
Project notNil ifTrue:[ |
|
14837 | 2206 |
UpdateChangeListQuerySignal query ifTrue:[ |
2207 |
Project addClassDefinitionChangeFor:self |
|
2208 |
] |
|
2256 | 2209 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2210 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2211 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2212 |
addChangeRecordForClass:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2213 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2214 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2215 |
"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
|
2216 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2217 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2218 |
self writingChangePerform:#addChangeRecordForClass:to: with:aClass. |
6166 | 2219 |
]. |
2220 |
||
2221 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2222 |
Project notNil ifTrue:[ |
|
13756 | 2223 |
UpdateChangeListQuerySignal query ifTrue:[ |
2224 |
Project addClassDefinitionChangeFor:aClass |
|
2225 |
] |
|
2256 | 2226 |
] |
2227 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2228 |
"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
|
2229 |
"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
|
2230 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2231 |
|
14929 | 2232 |
addChangeRecordForClass:aClass andNotifyChangeOf:aspect |
2233 |
"writes a change record and notifies dependents." |
|
2234 |
||
2235 |
|namespace| |
|
2236 |
||
2237 |
self addChangeRecordForClass:aClass. |
|
2238 |
||
2239 |
aClass changed:#definition. |
|
2240 |
||
2241 |
namespace := aClass nameSpace. |
|
2242 |
namespace changed:#classDefinition with:aClass. |
|
2243 |
namespace ~~ Smalltalk ifTrue:[ |
|
2244 |
Smalltalk changed:#classDefinition with:aClass. |
|
2245 |
]. |
|
2246 |
namespace changed:aspect with:aClass. |
|
2247 |
namespace ~~ Smalltalk ifTrue:[ |
|
2248 |
Smalltalk changed:aspect with:aClass. |
|
2249 |
]. |
|
2250 |
! |
|
2251 |
||
620 | 2252 |
addChangeRecordForClassCheckIn:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2253 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2254 |
|
620 | 2255 |
"append a class-was-checkedIn-record to the changes file" |
2256 |
||
12052
7aabd3b316a6
changed: #addChangeRecordForClassCheckIn:
Claus Gittinger <cg@exept.de>
parents:
12044
diff
changeset
|
2257 |
|rv pkg| |
1938 | 2258 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2259 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2260 |
rv := aClass revision. |
2261 |
rv isNil ifTrue:[rv := '???']. |
|
2262 |
pkg := aClass package. |
|
2263 |
||
2264 |
self |
|
2265 |
writingChangeWithTimeStamp:false |
|
2266 |
perform:#addInfoRecord:to: |
|
2267 |
with:('checkin %1 into %2 (%3)' |
|
2268 |
bindWith:aClass name |
|
2269 |
with:pkg |
|
2270 |
with:rv). |
|
2256 | 2271 |
] |
620 | 2272 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2273 |
"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
|
2274 |
"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
|
2275 |
"Modified: / 18.3.1999 / 18:14:14 / stefan" |
620 | 2276 |
! |
2277 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2278 |
addChangeRecordForClassComment:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2279 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2280 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2281 |
"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
|
2282 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2283 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2284 |
self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass. |
6166 | 2285 |
]. |
2286 |
||
2287 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2288 |
Project notNil ifTrue:[ |
|
13756 | 2289 |
UpdateChangeListQuerySignal query ifTrue:[ |
2290 |
Project addClassCommentChangeFor:aClass |
|
2291 |
] |
|
2256 | 2292 |
] |
2293 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2294 |
"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
|
2295 |
"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
|
2296 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2297 |
|
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
2298 |
addChangeRecordForClassContainerRemove:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2299 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2300 |
|
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
2301 |
"append a container-was-removed-record to the changes file" |
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
2302 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2303 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2304 |
self |
2305 |
writingChangeWithTimeStamp:false |
|
2306 |
perform:#addInfoRecord:to: |
|
2307 |
with:('removed source container of ' , aClass name). |
|
2256 | 2308 |
] |
2309 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2310 |
"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
|
2311 |
"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
|
2312 |
"Modified: / 18.3.1999 / 18:14:31 / stefan" |
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
2313 |
! |
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
2314 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2315 |
addChangeRecordForClassFileOut:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2316 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2317 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2318 |
"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
|
2319 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2320 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2321 |
self |
2322 |
writingChangeWithTimeStamp:false |
|
2323 |
perform:#addInfoRecord:to: |
|
2324 |
with:('fileOut ' , aClass name). |
|
2256 | 2325 |
] |
2326 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2327 |
"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
|
2328 |
"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
|
2329 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2330 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2331 |
addChangeRecordForClassInstvars:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2332 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2333 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2334 |
"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
|
2335 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2336 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2337 |
self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass. |
6166 | 2338 |
]. |
2339 |
||
2340 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2341 |
Project notNil ifTrue:[ |
|
13756 | 2342 |
UpdateChangeListQuerySignal query ifTrue:[ |
2343 |
Project addInstVarDefinitionChangeFor:aClass class |
|
2344 |
] |
|
2256 | 2345 |
] |
2346 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2347 |
"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
|
2348 |
"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
|
2349 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2350 |
|
7179 | 2351 |
addChangeRecordForClassRemove |
2352 |
"{ Pragma: +optSpace }" |
|
2353 |
||
2354 |
"add a class-remove-record to the changes file" |
|
2355 |
||
2356 |
UpdateChangeFileQuerySignal query ifTrue:[ |
|
13756 | 2357 |
self writingChangePerform:#addChangeRecordForClassRemove:to: with:self. |
7179 | 2358 |
]. |
2359 |
||
2360 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2361 |
Project notNil ifTrue:[ |
|
13756 | 2362 |
UpdateChangeListQuerySignal query ifTrue:[ |
2363 |
Project addClassRemoveChange:self |
|
2364 |
] |
|
7179 | 2365 |
] |
2366 |
||
2367 |
"Modified: / 24.1.1997 / 19:10:25 / cg" |
|
2368 |
"Modified: / 18.3.1999 / 18:14:53 / stefan" |
|
2369 |
! |
|
2370 |
||
6166 | 2371 |
addChangeRecordForClassRemove:oldClassName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2372 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2373 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2374 |
"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
|
2375 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2376 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2377 |
self writingChangePerform:#addChangeRecordForClassRemove:to: with:self. |
6166 | 2378 |
]. |
2379 |
||
2380 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2381 |
Project notNil ifTrue:[ |
|
13756 | 2382 |
UpdateChangeListQuerySignal query ifTrue:[ |
2383 |
Project addClassRemoveChange:self |
|
2384 |
] |
|
2256 | 2385 |
] |
2386 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2387 |
"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
|
2388 |
"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
|
2389 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2390 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2391 |
addChangeRecordForClassRename:oldName to:newName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2392 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2393 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2394 |
"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
|
2395 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2396 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2397 |
self writingChangeDo:[:aStream | |
2398 |
self addChangeRecordForClassRename:oldName to:newName to:aStream |
|
2399 |
] |
|
6166 | 2400 |
]. |
2401 |
||
2402 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2403 |
Project notNil ifTrue:[ |
|
13756 | 2404 |
UpdateChangeListQuerySignal query ifTrue:[ |
2405 |
Project addClassRenameChangeFrom:oldName to:newName |
|
2406 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2407 |
] |
1846 | 2408 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2409 |
"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
|
2410 |
"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
|
2411 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2412 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2413 |
addChangeRecordForPrimitiveDefinitions:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2414 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2415 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2416 |
"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
|
2417 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2418 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2419 |
self writingChangePerform:#addChangeRecordForPrimitiveDefinitions:to: with:aClass. |
6166 | 2420 |
]. |
2421 |
||
2422 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2423 |
Project notNil ifTrue:[ |
|
13756 | 2424 |
UpdateChangeListQuerySignal query ifTrue:[ |
2425 |
Project addPrimitiveDefinitionsChangeFor:aClass |
|
2426 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
2427 |
] |
2206 | 2428 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2429 |
"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
|
2430 |
"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
|
2431 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2432 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2433 |
addChangeRecordForPrimitiveFunctions:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2434 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2435 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2436 |
"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
|
2437 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2438 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2439 |
self writingChangePerform:#addChangeRecordForPrimitiveFunctions:to: with:aClass. |
6166 | 2440 |
]. |
2441 |
||
2442 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2443 |
Project notNil ifTrue:[ |
|
13756 | 2444 |
UpdateChangeListQuerySignal query ifTrue:[ |
2445 |
Project addPrimitiveFunctionsChangeFor:aClass |
|
2446 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
2447 |
] |
2206 | 2448 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2449 |
"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
|
2450 |
"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
|
2451 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2452 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2453 |
addChangeRecordForPrimitiveVariables:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2454 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2455 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2456 |
"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
|
2457 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2458 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2459 |
self writingChangePerform:#addChangeRecordForPrimitiveVariables:to: with:aClass. |
6166 | 2460 |
]. |
2461 |
||
2462 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
2463 |
Project notNil ifTrue:[ |
|
13756 | 2464 |
UpdateChangeListQuerySignal query ifTrue:[ |
2465 |
Project addPrimitiveVariablesChangeFor:aClass |
|
2466 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
2467 |
] |
2206 | 2468 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2469 |
"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
|
2470 |
"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
|
2471 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2472 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2473 |
addChangeRecordForSnapshot:aFileName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2474 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2475 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2476 |
"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
|
2477 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2478 |
UpdateChangeFileQuerySignal query ifTrue:[ |
13756 | 2479 |
self |
2480 |
writingChangeWithTimeStamp:false |
|
2481 |
perform:#addChangeRecordForSnapshot:to: |
|
2482 |
with:aFileName. |
|
2256 | 2483 |
] |
2484 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2485 |
"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
|
2486 |
"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
|
2487 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2488 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2489 |
addChangeRecordForSnapshot:aFileName to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2490 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2491 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2492 |
"add a snapshot-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2493 |
|
6166 | 2494 |
self addInfoRecord:('snapshot ' , aFileName) to:aStream |
2256 | 2495 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2496 |
"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
|
2497 |
"Modified: / 18.3.1999 / 18:15:30 / stefan" |
2917 | 2498 |
! ! |
2499 |
||
1824 | 2500 |
!Class methodsFor:'enumerating'! |
2501 |
||
3997 | 2502 |
allPrivateClassesDo:aBlock |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
2503 |
"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
|
2504 |
Evaluation is in no particular order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
2505 |
|
8551 | 2506 |
self allPrivateClasses do:aBlock |
3997 | 2507 |
! |
2508 |
||
1824 | 2509 |
privateClassesDo:aBlock |
5715
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2510 |
"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
|
2511 |
Evaluation is in no particular order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
2512 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
2513 |
self privateClasses do:aBlock |
5715
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2514 |
! |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2515 |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2516 |
subclassesDo:aBlock |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2517 |
"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
|
2518 |
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
|
2519 |
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
|
2520 |
|
13860 | 2521 |
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
|
2522 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2523 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2524 |
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
|
2525 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2526 |
|
13860 | 2527 |
"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
|
2528 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2529 |
|
5715
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2530 |
withAllPrivateClassesDo:aBlock |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2531 |
"evaluate aBlock on myself and all of my private classes (if any). |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2532 |
This recurses into private classes of private classes. |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2533 |
Evaluation is in no particular order." |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2534 |
|
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2535 |
aBlock value:self. |
8551 | 2536 |
self allPrivateClasses do:aBlock |
1824 | 2537 |
! ! |
2538 |
||
1 | 2539 |
!Class methodsFor:'fileIn interface'! |
2540 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2541 |
primitiveDefinitions |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2542 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2543 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2544 |
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
|
2545 |
unprocessed contents in the classes primitiveDefinitions section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2546 |
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
|
2547 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2548 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2549 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2550 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2551 |
"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
|
2552 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2553 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2554 |
primitiveFunctions |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2555 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2556 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2557 |
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
|
2558 |
unprocessed contents in the classes primitiveFunctions section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2559 |
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
|
2560 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2561 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2562 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2563 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2564 |
"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
|
2565 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2566 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2567 |
primitiveVariables |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2568 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2569 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2570 |
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
|
2571 |
unprocessed contents in the classes primitiveVariables section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2572 |
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
|
2573 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2574 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2575 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2576 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2577 |
"Modified: 10.2.1996 / 12:47:28 / cg" |
1 | 2578 |
! ! |
2579 |
||
2580 |
!Class methodsFor:'fileOut'! |
|
2581 |
||
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2582 |
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2583 |
"append an expression on aStream, which defines myself." |
238 | 2584 |
|
5344
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2585 |
self |
13756 | 2586 |
basicFileOutDefinitionOn:aStream |
2587 |
withNameSpace:forceNameSpace |
|
2588 |
withPackage:true |
|
5344
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2589 |
|
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2590 |
! |
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2591 |
|
8551 | 2592 |
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
|
2593 |
"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
|
2594 |
|
8551 | 2595 |
self class |
13756 | 2596 |
basicFileOutDefinitionOf:self |
2597 |
on:aStream |
|
2598 |
withNameSpace:forceNameSpace withPackage:showPackage |
|
1707 | 2599 |
! |
2600 |
||
8716 | 2601 |
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:showPackage syntaxHilighting:syntaxHilighting |
2602 |
"append an expression on aStream, which defines myself." |
|
2603 |
||
2604 |
self class |
|
13756 | 2605 |
basicFileOutDefinitionOf:self |
2606 |
on:aStream |
|
2607 |
withNameSpace:forceNameSpace |
|
2608 |
withPackage:showPackage |
|
2609 |
syntaxHilighting:syntaxHilighting |
|
8716 | 2610 |
! |
2611 |
||
1707 | 2612 |
basicFileOutInstvarTypeKeywordOn:aStream |
2613 |
"a helper for fileOutDefinition" |
|
2614 |
||
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2615 |
|isVar superclass| |
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2616 |
|
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2617 |
superclass := self superclass. |
1707 | 2618 |
superclass isNil ifTrue:[ |
13756 | 2619 |
isVar := self isVariable |
1707 | 2620 |
] ifFalse:[ |
13756 | 2621 |
"I cant remember what this is for ?" |
2622 |
isVar := (self isVariable and:[superclass isVariable not]) |
|
1707 | 2623 |
]. |
2624 |
||
3920
0c1b9b2fa23b
added longlong indexed instvars;
Claus Gittinger <cg@exept.de>
parents:
3788
diff
changeset
|
2625 |
aStream nextPutAll:(self firstDefinitionSelectorPart). |
1707 | 2626 |
|
2627 |
"Created: 11.10.1996 / 18:57:29 / cg" |
|
1 | 2628 |
! |
2629 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2630 |
fileOut |
894
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2631 |
"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
|
2632 |
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
|
2633 |
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
|
2634 |
directory. Care is taken, to not clobber any existing file in |
8551 | 2635 |
case of errors (for example: disk full). |
2636 |
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
|
2637 |
sourceFile may not be rewritten." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2638 |
|
7693 | 2639 |
|dirName nm fileName| |
2640 |
||
10053 | 2641 |
nm := (Smalltalk fileNameForClass:self name),'.st'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2642 |
|
139 | 2643 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2644 |
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
|
2645 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2646 |
Project notNil ifTrue:[ |
13756 | 2647 |
dirName := Project currentProjectDirectory |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2648 |
] ifFalse:[ |
13756 | 2649 |
dirName := Filename currentDirectory |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2650 |
]. |
3788
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2651 |
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
|
2652 |
fileName makeLegalFilename. |
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2653 |
|
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2654 |
self fileOutAs:fileName name. |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2655 |
|
2771 | 2656 |
"/ " |
2657 |
"/ add a change record; that way, administration is much easier, |
|
8551 | 2658 |
"/ since we can see in that changeBrowser, which changes have |
2771 | 2659 |
"/ already found their way into a sourceFile and which must be |
2660 |
"/ applied again |
|
2661 |
"/ " |
|
2662 |
"/ self addChangeRecordForClassFileOut:self |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2663 |
|
10053 | 2664 |
"Modified: / 07-06-1996 / 09:14:43 / stefan" |
2665 |
"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
|
2666 |
! |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2667 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2668 |
fileOutAllMethodsOn:aStream |
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2669 |
self fileOutAllMethodsOn:aStream methodFilter:nil |
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 |
"Created: 15.10.1996 / 11:13:00 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2672 |
"Modified: 22.3.1997 / 16:12:17 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2673 |
! |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2674 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2675 |
fileOutAllMethodsOn:aStream methodFilter:methodFilter |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2676 |
|collectionOfCategories| |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2677 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2678 |
collectionOfCategories := self class categories asSortedCollection. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2679 |
collectionOfCategories notNil ifTrue:[ |
13756 | 2680 |
collectionOfCategories do:[:aCategory | |
2681 |
self class fileOutCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2682 |
aStream cr |
|
2683 |
] |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2684 |
]. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2685 |
collectionOfCategories := self categories asSortedCollection. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2686 |
collectionOfCategories notNil ifTrue:[ |
13756 | 2687 |
collectionOfCategories do:[:aCategory | |
2688 |
self fileOutCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2689 |
aStream cr |
|
2690 |
] |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2691 |
]. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2692 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2693 |
self privateClassesSorted do:[:aClass | |
13756 | 2694 |
aClass fileOutAllMethodsOn:aStream methodFilter:methodFilter |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2695 |
]. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2696 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2697 |
"Created: 15.10.1996 / 11:13:00 / cg" |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2698 |
"Modified: 22.3.1997 / 16:12:17 / cg" |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2699 |
! |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2700 |
|
15466 | 2701 |
fileOutAs:filenameString |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2702 |
"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
|
2703 |
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
|
2704 |
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
|
2705 |
Care is taken, to not clobber any existing file in |
8551 | 2706 |
case of errors (for example: disk full). |
2707 |
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
|
2708 |
sourceFile may not be rewritten." |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2709 |
|
15466 | 2710 |
|filename fileExists needRename |
2711 |
mySourceFileName sameFile s mySourceFileID anySourceRef outStream savFilename| |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2712 |
|
3750
d544994a1c3e
in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents:
3702
diff
changeset
|
2713 |
self isLoaded ifFalse:[ |
15331 | 2714 |
^ FileOutErrorSignal |
2715 |
raiseRequestWith:self |
|
2716 |
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
|
2717 |
]. |
d544994a1c3e
in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents:
3702
diff
changeset
|
2718 |
|
15466 | 2719 |
filename := filenameString asFilename. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2720 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2721 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2722 |
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
|
2723 |
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
|
2724 |
and, if that worked rename afterwards ... |
153 | 2725 |
" |
15466 | 2726 |
[ |
2727 |
fileExists := filename exists. |
|
2728 |
fileExists ifTrue:[ |
|
2729 |
sameFile := false. |
|
2730 |
||
2731 |
"/ check carefully - maybe, my source does not really come from that |
|
2732 |
"/ file (i.e. all of my methods have their source as string) |
|
2733 |
||
2734 |
anySourceRef := false. |
|
2735 |
self instAndClassMethodsDo:[:m | |
|
2736 |
m sourcePosition notNil ifTrue:[ |
|
2737 |
anySourceRef := true |
|
15331 | 2738 |
] |
2739 |
]. |
|
15466 | 2740 |
|
2741 |
anySourceRef ifTrue:[ |
|
2742 |
s := self sourceStream. |
|
2743 |
s notNil ifTrue:[ |
|
2744 |
OperatingSystem isUNIXlike ifTrue:[ |
|
2745 |
mySourceFileID := s pathName asFilename info id. |
|
2746 |
sameFile := (filename info id) == mySourceFileID. |
|
2747 |
] ifFalse:[ |
|
2748 |
mySourceFileID := s pathName asFilename asAbsoluteFilename. |
|
2749 |
sameFile := (filename asFilename asAbsoluteFilename) = mySourceFileID. |
|
2750 |
]. |
|
2751 |
s close. |
|
2752 |
] ifFalse:[ |
|
2753 |
classFilename notNil ifTrue:[ |
|
2754 |
" |
|
2755 |
check for overwriting my current source file |
|
2756 |
this is not allowed, since it would clobber my methods source |
|
2757 |
file ... you have to save it to some other place. |
|
2758 |
This happens if you ask for a fileOut into the source-directory |
|
2759 |
(from which my methods get their source) |
|
2760 |
" |
|
2761 |
mySourceFileName := Smalltalk getSourceFileName:classFilename. |
|
2762 |
sameFile := (filenameString = mySourceFileName). |
|
2763 |
sameFile ifFalse:[ |
|
2764 |
mySourceFileName notNil ifTrue:[ |
|
2765 |
OperatingSystem isUNIXlike ifTrue:[ |
|
2766 |
sameFile := (filename info id) == (mySourceFileName asFilename info id) |
|
2767 |
] |
|
2768 |
] |
|
2769 |
]. |
|
2770 |
] |
|
2771 |
]. |
|
2772 |
]. |
|
2773 |
||
2774 |
sameFile ifTrue:[ |
|
2775 |
^ FileOutErrorSignal |
|
2776 |
raiseRequestWith:filenameString |
|
2777 |
errorString:(' - may not overwrite sourcefile: %1\try again after loading sources in the browser' withCRs bindWith:filenameString) |
|
2778 |
]. |
|
2779 |
||
2780 |
outStream := FileStream newTemporaryIn:filename directory. |
|
2781 |
outStream fileName accessRights:filename accessRights. |
|
2782 |
needRename := true |
|
2783 |
] ifFalse:[ |
|
2784 |
"/ another possible trap: if my sourceFileName is |
|
2785 |
"/ the same as the written one AND the new files directory |
|
2786 |
"/ is along the sourcePath, we also need a temporary file |
|
2787 |
"/ first, to avoid accessing the newly written file. |
|
2788 |
||
2789 |
self instAndClassMethodsDo:[:m | |
|
2790 |
|mSrc mSrcFilename| |
|
2791 |
||
2792 |
(anySourceRef isNil and:[(mSrc := m sourceFilename) notNil]) ifTrue:[ |
|
2793 |
mSrcFilename := mSrc asFilename. |
|
2794 |
(mSrcFilename baseName = filename baseName |
|
2795 |
and:[mSrcFilename exists]) ifTrue:[ |
|
2796 |
anySourceRef := mSrcFilename. |
|
2797 |
] |
|
15331 | 2798 |
] |
15466 | 2799 |
]. |
2800 |
anySourceRef notNil ifTrue:[ |
|
2801 |
outStream := FileStream newTemporaryIn:filename directory. |
|
2802 |
outStream fileName accessRights:anySourceRef accessRights. |
|
2803 |
needRename := true |
|
2804 |
] ifFalse:[ |
|
2805 |
outStream := filename writeStream. |
|
2806 |
needRename := false |
|
15331 | 2807 |
] |
2808 |
]. |
|
15466 | 2809 |
] on:FileStream openErrorSignal do:[:ex| |
2810 |
^ FileOutErrorSignal |
|
2811 |
raiseRequestWith:filename name |
|
2812 |
errorString:(' - cannot create file:', filename name) |
|
1 | 2813 |
]. |
15466 | 2814 |
self fileOutOn:outStream. |
2815 |
outStream syncData; close. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2816 |
|
199 | 2817 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2818 |
finally, replace the old-file |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2819 |
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
|
2820 |
we have to do a copy ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2821 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2822 |
needRename ifTrue:[ |
15466 | 2823 |
fileExists ifTrue:[ |
2824 |
savFilename := filename addSuffix:'.sav~'. |
|
2825 |
filename renameTo:savFilename. |
|
2826 |
]. |
|
2827 |
outStream fileName renameTo:filename. |
|
2828 |
fileExists ifTrue:[ |
|
2829 |
savFilename delete. |
|
2830 |
]. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2831 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2832 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2833 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2834 |
add a change record; that way, administration is much easier, |
8551 | 2835 |
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
|
2836 |
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
|
2837 |
applied again |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2838 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2839 |
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
|
2840 |
|
10035
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2841 |
"Modified: / 07-06-1996 / 09:14:43 / stefan" |
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2842 |
"Created: / 16-04-1997 / 20:44:05 / cg" |
f1408385efac
samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents:
10033
diff
changeset
|
2843 |
"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
|
2844 |
! |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2845 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2846 |
fileOutClassInstVarDefinitionOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2847 |
"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
|
2848 |
|
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8267
diff
changeset
|
2849 |
self class |
13756 | 2850 |
fileOutClassInstVarDefinitionOn:aStream |
2851 |
withNameSpace:false |
|
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2852 |
! |
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2853 |
|
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2854 |
fileOutClassInstVarDefinitionOn:aStream withNameSpace:withNameSpace |
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2855 |
"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
|
2856 |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2857 |
|anySuperClassInstVar| |
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2858 |
|
5296
12a5de62fef7
class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents:
5257
diff
changeset
|
2859 |
self isLoaded ifFalse:[ |
13756 | 2860 |
^ self basicFileOutDefinitionOn:aStream withNameSpace:withNameSpace |
5296
12a5de62fef7
class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents:
5257
diff
changeset
|
2861 |
]. |
12a5de62fef7
class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents:
5257
diff
changeset
|
2862 |
|
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2863 |
withNameSpace ifTrue:[ |
13756 | 2864 |
self name printOn:aStream. |
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2865 |
] ifFalse:[ |
13756 | 2866 |
self printClassNameOn:aStream. |
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2867 |
]. |
3338
0423dac35a45
dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
2868 |
aStream nextPutAll:' class instanceVariableNames:'''. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2869 |
self class printInstVarNamesOn:aStream indent:8. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2870 |
aStream nextPutAll:''''. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2871 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2872 |
"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
|
2873 |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2874 |
anySuperClassInstVar := false. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2875 |
self allSuperclassesDo:[:aSuperClass | |
13756 | 2876 |
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
|
2877 |
]. |
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2878 |
|
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2879 |
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
|
2880 |
anySuperClassInstVar ifFalse:[ |
13756 | 2881 |
aStream |
2882 |
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
|
2883 |
] ifTrue:[ |
13756 | 2884 |
aStream |
2885 |
nextPutLine:'The following class instance variables are inherited by this class:'. |
|
2886 |
aStream cr. |
|
2887 |
self allSuperclassesDo:[:aSuperClass | |
|
2888 |
aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '. |
|
2889 |
aStream nextPutLine:(aSuperClass class instanceVariableString). |
|
2890 |
]. |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2891 |
|
556 | 2892 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2893 |
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
|
2894 |
|
3338
0423dac35a45
dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
2895 |
"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
|
2896 |
"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
|
2897 |
"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
|
2898 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2899 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2900 |
fileOutCommentOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2901 |
"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
|
2902 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2903 |
|comment s| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2904 |
|
2011
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
2905 |
self printClassNameOn:aStream. |
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
2906 |
aStream nextPutAll:' comment:'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2907 |
(comment := self comment) isNil ifTrue:[ |
14837 | 2908 |
s := '''''' |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2909 |
] ifFalse:[ |
14837 | 2910 |
s := comment storeString |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2911 |
]. |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2912 |
aStream nextPutAllAsChunk:s. |
1063
b45a722a10c3
oops - forgot excla after comment-chunk
Claus Gittinger <cg@exept.de>
parents:
989
diff
changeset
|
2913 |
aStream nextPutChunkSeparator. |
14597 | 2914 |
aStream cr. |
2915 |
aStream cr. |
|
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2916 |
|
2011
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
2917 |
"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
|
2918 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2919 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2920 |
fileOutDefinitionOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2921 |
"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
|
2922 |
|
15947 | 2923 |
^ self basicFileOutDefinitionOn:aStream withNameSpace:true |
2924 |
||
2925 |
"Modified: / 04-01-1997 / 20:55:18 / cg" |
|
2926 |
"Modified: / 04-02-2014 / 16:49:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2927 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2928 |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2929 |
fileOutIn:aDirectoryName |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2930 |
"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
|
2931 |
directory aDirectoryName (ignoring any directory setting in |
8551 | 2932 |
the current project). |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2933 |
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
|
2934 |
|
12297
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2935 |
^ self fileOutIn:aDirectoryName withTimeStamp:true |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2936 |
|
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2937 |
" |
13756 | 2938 |
self fileOutIn:'/tmp' |
2939 |
self fileOutIn:'/tmp/doesNotExistBla' |
|
2940 |
self fileOutIn:'/tmp' asFilename |
|
12297
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2941 |
" |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2942 |
|
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2943 |
"Modified: / 19-09-1997 / 00:03:53 / stefan" |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2944 |
"Modified: / 06-10-2006 / 16:16:13 / cg" |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2945 |
! |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2946 |
|
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2947 |
fileOutIn:aDirectoryName withTimeStamp:withTimeStamp |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2948 |
"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
|
2949 |
directory aDirectoryName (ignoring any directory setting in |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2950 |
the current project). |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2951 |
This is not logged in that change file (should it be ?)." |
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2952 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2953 |
|aStream fileName| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2954 |
|
10053 | 2955 |
fileName := (Smalltalk fileNameForClass:self name),'.st'. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2956 |
[ |
13756 | 2957 |
aStream := (aDirectoryName asFilename construct:fileName) writeStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2958 |
] on:FileStream openErrorSignal do:[:ex| |
13756 | 2959 |
^ FileOutErrorSignal |
2960 |
raiseRequestWith:fileName |
|
2961 |
errorString:(' - cannot create file:', fileName) |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2962 |
]. |
12297
31d62fae7c8d
added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents:
12259
diff
changeset
|
2963 |
self fileOutOn:aStream withTimeStamp:withTimeStamp. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2964 |
aStream close |
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2965 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2966 |
" |
13756 | 2967 |
self fileOutIn:'/tmp' |
2968 |
self fileOutIn:'/tmp/doesNotExistBla' |
|
2969 |
self fileOutIn:'/tmp' asFilename |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2970 |
" |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2971 |
|
10053 | 2972 |
"Modified: / 19-09-1997 / 00:03:53 / stefan" |
2973 |
"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
|
2974 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2975 |
|
555 | 2976 |
fileOutOn:aStream |
2977 |
"file out my definition and all methods onto aStream" |
|
2978 |
||
2979 |
^ self fileOutOn:aStream withTimeStamp:true |
|
2980 |
||
2981 |
"Created: 15.11.1995 / 12:53:32 / cg" |
|
2046 | 2982 |
"Modified: 3.1.1997 / 17:50:28 / cg" |
555 | 2983 |
! |
2984 |
||
2985 |
fileOutOn:aStream withTimeStamp:stampIt |
|
3339
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2986 |
"file out my definition and all methods onto aStream. |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2987 |
If stampIt is true, a timeStamp comment is prepended." |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2988 |
|
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2989 |
self fileOutOn:aStream withTimeStamp:stampIt withInitialize:true |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2990 |
|
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2991 |
"Modified: / 13.3.1998 / 12:23:02 / cg" |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2992 |
! |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2993 |
|
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2994 |
fileOutOn:aStream withTimeStamp:stampIt withInitialize:initIt |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2995 |
"file out my definition and all methods onto aStream. |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2996 |
If stampIt is true, a timeStamp comment is prepended. |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2997 |
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
|
2998 |
append a corresponding doIt expression for initialization." |
555 | 2999 |
|
8551 | 3000 |
self |
13756 | 3001 |
fileOutOn:aStream |
3002 |
withTimeStamp:stampIt |
|
3003 |
withInitialize:initIt |
|
3004 |
withDefinition:true |
|
3005 |
methodFilter:nil |
|
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
3006 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
3007 |
"Created: / 15.11.1995 / 12:53:06 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
3008 |
"Modified: / 1.4.1997 / 16:01:05 / stefan" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
3009 |
"Modified: / 13.3.1998 / 12:23:59 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
3010 |
! |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
3011 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
3012 |
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
|
3013 |
"file out my definition and all methods onto aStream. |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
3014 |
If stampIt is true, a timeStamp comment is prepended. |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
3015 |
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
|
3016 |
append a corresponding doIt expression for initialization. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3017 |
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
|
3018 |
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
|
3019 |
|
8212 | 3020 |
|encoder any16Bit| |
8164 | 3021 |
|
17154 | 3022 |
"/ check if we need UTF8 encoding |
13508
59531dc7d4e8
changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents:
13507
diff
changeset
|
3023 |
any16Bit := self withAllPrivateClasses contains:[:cls | |
15746 | 3024 |
cls instAndClassMethods contains:[:m | |
3025 |
(methodFilter isNil or:[ (methodFilter value:m) ]) |
|
3026 |
and:[ |
|
3027 |
|src| |
|
3028 |
||
3029 |
src := m source. |
|
18599 | 3030 |
src notNil and:[src containsNon7BitAscii] |
15746 | 3031 |
]]]. |
11699 | 3032 |
|
8551 | 3033 |
any16Bit ifTrue:[ |
15746 | 3034 |
encoder := CharacterEncoder encoderForUTF8. |
8075 | 3035 |
]. |
8051
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
3036 |
^ self |
15746 | 3037 |
fileOutOn:aStream |
3038 |
withTimeStamp:stampIt |
|
3039 |
withInitialize:initIt |
|
3040 |
withDefinition:withDefinition |
|
3041 |
methodFilter:methodFilter |
|
3042 |
encoder:encoder |
|
13508
59531dc7d4e8
changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents:
13507
diff
changeset
|
3043 |
|
59531dc7d4e8
changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents:
13507
diff
changeset
|
3044 |
"Modified: / 18-07-2011 / 09:17:17 / cg" |
18210
d1768187cb74
fileout: file out class in UTF8 only if necessary
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18209
diff
changeset
|
3045 |
"Modified: / 13-04-2015 / 21:15:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8051
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
3046 |
! |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
3047 |
|
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
3048 |
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
|
3049 |
"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
|
3050 |
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
|
3051 |
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
|
3052 |
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
|
3053 |
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
|
3054 |
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
|
3055 |
|
8230 | 3056 |
self class |
13756 | 3057 |
fileOutOn:outStreamArg |
3058 |
withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition |
|
3059 |
methodFilter:methodFilter encoder:encoderOrNil |
|
8230 | 3060 |
|
555 | 3061 |
|
3339
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
3062 |
"Created: / 15.11.1995 / 12:53:06 / cg" |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
3063 |
"Modified: / 1.4.1997 / 16:01:05 / stefan" |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
3064 |
"Modified: / 13.3.1998 / 12:23:59 / cg" |
555 | 3065 |
! |
3066 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3067 |
fileOutPrimitiveDefinitionsOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3068 |
"append primitive defs (if any) to aStream." |
555 | 3069 |
|
3070 |
|s| |
|
3071 |
||
3072 |
" |
|
3073 |
primitive definitions - if any |
|
3074 |
" |
|
3075 |
(s := self primitiveDefinitionsString) notNil ifTrue:[ |
|
13756 | 3076 |
aStream nextPutChunkSeparator. |
3077 |
self printClassNameOn:aStream. |
|
3078 |
aStream nextPutAll:' primitiveDefinitions'; |
|
3079 |
nextPutChunkSeparator; |
|
3080 |
cr. |
|
3081 |
aStream nextPutAll:s. |
|
3082 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
555 | 3083 |
]. |
3084 |
(s := self primitiveVariablesString) notNil ifTrue:[ |
|
13756 | 3085 |
aStream nextPutChunkSeparator. |
3086 |
self printClassNameOn:aStream. |
|
3087 |
aStream nextPutAll:' primitiveVariables'; |
|
3088 |
nextPutChunkSeparator; |
|
3089 |
cr. |
|
3090 |
aStream nextPutAll:s. |
|
3091 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
555 | 3092 |
]. |
2088
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3093 |
|
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3094 |
"Modified: 8.1.1997 / 17:45:40 / cg" |
555 | 3095 |
! |
3096 |
||
14597 | 3097 |
fileOutPrimitiveFunctionsOn:aStream |
3098 |
|s| |
|
3099 |
||
3100 |
" |
|
3101 |
primitive functions - if any |
|
3102 |
" |
|
3103 |
(s := self primitiveFunctionsString) notNil ifTrue:[ |
|
14837 | 3104 |
aStream nextPutChunkSeparator. |
3105 |
self printClassNameOn:aStream. |
|
3106 |
aStream nextPutAll:' primitiveFunctions'; |
|
3107 |
nextPutChunkSeparator; |
|
3108 |
cr. |
|
3109 |
aStream nextPutAll:s. |
|
3110 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
14597 | 3111 |
]. |
3112 |
! |
|
3113 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3114 |
fileOutPrimitiveSpecsOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3115 |
"append primitive defs (if any) to aStream." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3116 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3117 |
|s| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3118 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3119 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3120 |
primitive definitions - if any |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3121 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3122 |
self fileOutPrimitiveDefinitionsOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3123 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3124 |
primitive functions - if any |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3125 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3126 |
(s := self primitiveFunctionsString) notNil ifTrue:[ |
14837 | 3127 |
self fileOutPrimitiveFunctionsOn:aStream |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3128 |
]. |
2088
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3129 |
|
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3130 |
"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
|
3131 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3132 |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3133 |
!Class methodsFor:'fileOut-binary'! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3134 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3135 |
binaryFileOut |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3136 |
"create a file 'class.cls' (in the current projects fileOut-directory), |
8551 | 3137 |
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
|
3138 |
The methods source is saved by reference |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3139 |
to the classes sourceFile if there is any. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3140 |
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
|
3141 |
browsable." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3142 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3143 |
self binaryFileOutWithSourceMode:#reference |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3144 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3145 |
"Modified: 5.1.1997 / 15:40:05 / cg" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3146 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3147 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3148 |
binaryFileOutOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3149 |
"append a binary representation of myself to aStream" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3150 |
|
8551 | 3151 |
self binaryFileOutOn:aStream sourceMode:#reference |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3152 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3153 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3154 |
binaryFileOutOn:aStream sourceMode:sourceMode |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3155 |
"append a binary representation of myself to aStream in |
8551 | 3156 |
a portable binary format. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3157 |
The argument controls how sources are to be saved: |
13756 | 3158 |
#keep - include the source |
3159 |
#reference - include a reference to the sourceFile |
|
3160 |
#discard - dont save sources. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3161 |
|
8551 | 3162 |
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
|
3163 |
in order to be browsable." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3164 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3165 |
|bos| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3166 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3167 |
bos := BinaryObjectStorage onNew:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3168 |
bos sourceMode:sourceMode. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3169 |
bos nextPutClasses:(Array with:self). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3170 |
bos close. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3171 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3172 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3173 |
binaryFileOutWithSourceMode:sourceMode |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3174 |
"create a file 'class.cls' (in the current projects fileOut-directory), |
8551 | 3175 |
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
|
3176 |
The argument controls how sources are to be saved: |
13756 | 3177 |
#keep - include the source |
3178 |
#reference - include a reference to the sourceFile |
|
3179 |
#discard - dont save sources. |
|
8551 | 3180 |
|
3181 |
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
|
3182 |
in order to be browsable." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3183 |
|
7693 | 3184 |
|fileName dirName| |
3185 |
||
10053 | 3186 |
fileName := (Smalltalk fileNameForClass:self name), '.cls'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3187 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3188 |
Project notNil ifTrue:[ |
13756 | 3189 |
dirName := Project currentProjectDirectory |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3190 |
] ifFalse:[ |
13756 | 3191 |
dirName := '.' |
5374
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 |
fileName := dirName asFilename construct:fileName. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3194 |
fileName makeLegalFilename. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3195 |
fileName := fileName name. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3196 |
self binaryFileOutWithSourceMode:sourceMode as:fileName. |
10053 | 3197 |
|
3198 |
"Modified: / 06-10-2006 / 16:16:29 / cg" |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3199 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3200 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3201 |
binaryFileOutWithSourceMode:sourceMode as:fileNameString |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3202 |
"create a file fileNameString, |
8551 | 3203 |
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
|
3204 |
The argument controls how sources are to be saved: |
13756 | 3205 |
#keep - include the source |
3206 |
#reference - include a reference to the sourceFile |
|
3207 |
#discard - dont save sources. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3208 |
|
8551 | 3209 |
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
|
3210 |
in order to be browsable." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3211 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3212 |
|fileName aStream| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3213 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3214 |
fileName := fileNameString asFilename. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3215 |
fileName makeLegalFilename. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
3216 |
|
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
3217 |
[ |
13756 | 3218 |
aStream := fileName newReadWriteStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
3219 |
] on:FileStream openErrorSignal do:[:ex| |
13756 | 3220 |
^ FileOutErrorSignal |
3221 |
raiseRequestWith:fileName name |
|
3222 |
errorString:(' - cannot create file:', fileName name) |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3223 |
]. |
8551 | 3224 |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3225 |
aStream binary. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3226 |
self binaryFileOutOn:aStream sourceMode:sourceMode. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3227 |
aStream close. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3228 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3229 |
"Created: / 29.12.1998 / 21:38:38 / cg" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3230 |
! ! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3231 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3232 |
!Class methodsFor:'fileOut-xml'! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3233 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3234 |
fileOutXML |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3235 |
"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
|
3236 |
XML sourceForm. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3237 |
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
|
3238 |
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
|
3239 |
case of errors (for example: disk full)" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3240 |
|
7693 | 3241 |
|dirName nm fileName| |
3242 |
||
3243 |
nm := (Smalltalk fileNameForClass:self name) , '.xml'. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3244 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3245 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3246 |
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
|
3247 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3248 |
Project notNil ifTrue:[ |
13756 | 3249 |
dirName := Project currentProjectDirectory |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3250 |
] ifFalse:[ |
13756 | 3251 |
dirName := Filename currentDirectory |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3252 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3253 |
fileName := (dirName asFilename construct:nm). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3254 |
fileName makeLegalFilename. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3255 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3256 |
self fileOutXMLAs:fileName. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3257 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3258 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3259 |
Class fileOutXML |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3260 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3261 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3262 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3263 |
fileOutXMLAllDefinitionsOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3264 |
"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
|
3265 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3266 |
self fileOutXMLDefinitionOn:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3267 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3268 |
"/ here, the full nameSpace prefixes are output, |
8551 | 3269 |
"/ to avoid confusing stc |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3270 |
"/ (which otherwise could not find the correct superclass) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3271 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3272 |
FileOutNameSpaceQuerySignal answer:true do:[ |
13756 | 3273 |
self privateClassesSorted do:[:aClass | |
3274 |
aClass fileOutXMLAllDefinitionsOn:aStream |
|
3275 |
] |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3276 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3277 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3278 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3279 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3280 |
|
5464 | 3281 |
fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter |
3282 |
|collectionOfCategories| |
|
3283 |
||
3284 |
collectionOfCategories := self class categories asSortedCollection. |
|
3285 |
collectionOfCategories notNil ifTrue:[ |
|
13756 | 3286 |
collectionOfCategories do:[:aCategory | |
3287 |
self class fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
3288 |
aStream cr |
|
3289 |
] |
|
5464 | 3290 |
]. |
3291 |
collectionOfCategories := self categories asSortedCollection. |
|
3292 |
collectionOfCategories notNil ifTrue:[ |
|
13756 | 3293 |
collectionOfCategories do:[:aCategory | |
3294 |
self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
3295 |
aStream cr |
|
3296 |
] |
|
5464 | 3297 |
]. |
3298 |
||
3299 |
self privateClassesSorted do:[:aClass | |
|
13756 | 3300 |
aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter |
5464 | 3301 |
]. |
3302 |
||
3303 |
! |
|
3304 |
||
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3305 |
fileOutXMLAs:fileNameOrString |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3306 |
"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
|
3307 |
XML sourceForm. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3308 |
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
|
3309 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3310 |
|aStream fileName| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3311 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3312 |
self isLoaded ifFalse:[ |
13756 | 3313 |
^ FileOutErrorSignal |
3314 |
raiseRequestWith:self |
|
3315 |
errorString:' - will not fileOut unloaded class: ', self name |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3316 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3317 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3318 |
fileName := fileNameOrString asFilename. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
3319 |
[ |
13756 | 3320 |
aStream := fileName writeStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
3321 |
] on:FileStream openErrorSignal do:[:ex| |
13756 | 3322 |
^ FileOutErrorSignal |
3323 |
raiseRequestWith:fileName name |
|
3324 |
errorString:(' - cannot create file: ', fileName name) |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3325 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3326 |
self fileOutXMLOn:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3327 |
aStream close. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3328 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3329 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3330 |
Class fileOutXMLAs:'test.xml' |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
3331 |
Class fileOutXMLAs:'/blaDoesNotExist/test.xml' |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3332 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3333 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3334 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3335 |
fileOutXMLDefinitionOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3336 |
"append an xml expression on aStream, which defines myself." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3337 |
|
6703 | 3338 |
|varNames| |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3339 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3340 |
aStream nextPutLine:'<class>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3341 |
|
5464 | 3342 |
aStream nextPutAll:' <name>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3343 |
aStream nextPutAll:(self nameWithoutPrefix). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3344 |
aStream nextPutLine:'</name>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3345 |
|
5464 | 3346 |
aStream nextPutAll:' <environment>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3347 |
aStream nextPutAll:(self nameSpace name). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3348 |
aStream nextPutLine:'</environment>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3349 |
|
5464 | 3350 |
aStream nextPutAll:' <super>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3351 |
aStream nextPutAll:(self theNonMetaclass superclass name). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3352 |
aStream nextPutLine:'</super>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3353 |
|
5464 | 3354 |
aStream nextPutAll:' <private>'. |
3355 |
aStream nextPutAll:(self isPrivate printString). |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3356 |
aStream nextPutLine:'</private>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3357 |
|
5464 | 3358 |
aStream nextPutAll:' <indexed-type>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3359 |
aStream nextPutAll:'none'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3360 |
aStream nextPutLine:'</indexed-type>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3361 |
|
5464 | 3362 |
aStream nextPutAll:' <inst-vars>'. |
3363 |
varNames := self instVarNames. |
|
3364 |
varNames size > 0 ifTrue:[ |
|
14837 | 3365 |
aStream cr. |
3366 |
varNames do:[:nm | |
|
3367 |
aStream nextPutAll:' <name>'. |
|
3368 |
aStream nextPutAll:nm. |
|
3369 |
aStream nextPutLine:'</name>'. |
|
3370 |
]. |
|
3371 |
aStream nextPutAll:' '. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3372 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3373 |
aStream nextPutLine:'</inst-vars>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3374 |
|
5464 | 3375 |
aStream nextPutAll:' <class-inst-vars>'. |
3376 |
varNames := self class instVarNames. |
|
3377 |
varNames size > 0 ifTrue:[ |
|
14837 | 3378 |
aStream cr. |
3379 |
varNames do:[:nm | |
|
3380 |
aStream nextPutAll:' <name>'. |
|
3381 |
aStream nextPutAll:nm. |
|
3382 |
aStream nextPutLine:'</name>'. |
|
3383 |
]. |
|
3384 |
aStream nextPutAll:' '. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3385 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3386 |
aStream nextPutLine:'</class-inst-vars>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3387 |
|
5464 | 3388 |
aStream nextPutAll:' <imports>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3389 |
aStream nextPutAll:''. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3390 |
aStream nextPutLine:'</imports>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3391 |
|
5464 | 3392 |
aStream nextPutAll:' <category>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3393 |
aStream nextPutAll:self category. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3394 |
aStream nextPutLine:'</category>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3395 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3396 |
aStream nextPutLine:'</class>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3397 |
|
14146 | 3398 |
self classVarNames do:[:nm | |
14837 | 3399 |
aStream nextPutLine:'<static>'. |
3400 |
aStream nextPutAll:' <name>'. |
|
3401 |
aStream nextPutAll:nm. |
|
3402 |
aStream nextPutLine:'</name>'. |
|
3403 |
aStream nextPutAll:' <environment>'. |
|
3404 |
aStream nextPutAll:self name. |
|
3405 |
aStream nextPutLine:'</environment>'. |
|
3406 |
aStream nextPutLine:'</static>'. |
|
5464 | 3407 |
]. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3408 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3409 |
|
8551 | 3410 |
fileOutXMLOn:aStream |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3411 |
"WARNING: untested first version. Not for general use (yet) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3412 |
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
|
3413 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3414 |
self |
13756 | 3415 |
fileOutXMLOn:aStream |
3416 |
withTimeStamp:true |
|
3417 |
withInitialize:true |
|
3418 |
withDefinition:true |
|
3419 |
methodFilter:nil |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3420 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3421 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3422 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3423 |
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
|
3424 |
"WARNING: untested first version. Not for general use (yet) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3425 |
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
|
3426 |
If stampIt is true, a timeStamp comment is prepended. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3427 |
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
|
3428 |
append a corresponding doIt expression for initialization. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3429 |
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
|
3430 |
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
|
3431 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3432 |
|collectionOfCategories copyrightMethod copyrightText comment meta| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3433 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3434 |
self isLoaded ifFalse:[ |
15160
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3435 |
^ FileOutErrorSignal |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3436 |
raiseRequestWith:self |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3437 |
errorString:' - will not fileOut unloaded class: ', self name |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3438 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3439 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3440 |
meta := self class. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3441 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3442 |
aStream nextPutLine:'<?xml version="1.0"?>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3443 |
aStream nextPutLine:'<st-source>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3444 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3445 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3446 |
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
|
3447 |
taking the string from the copyright method. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3448 |
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
|
3449 |
being put on your code ;-). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3450 |
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
|
3451 |
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
|
3452 |
code was edited in the browser and filedOut. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3453 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3454 |
(copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[ |
15160
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3455 |
" |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3456 |
get the copyright methods source, |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3457 |
and insert at beginning. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3458 |
" |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3459 |
copyrightText := copyrightMethod source. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3460 |
copyrightText isNil ifTrue:[ |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3461 |
" |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3462 |
no source available - trigger an error |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3463 |
" |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3464 |
FileOutErrorSignal |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3465 |
raiseRequestWith:' - no source for class: '. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3466 |
^ self |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3467 |
]. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3468 |
" |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3469 |
strip off the selector-line |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3470 |
" |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3471 |
copyrightText := copyrightText asCollectionOfLines asStringCollection. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3472 |
copyrightText := copyrightText copyFrom:2 to:(copyrightText size). |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3473 |
[copyrightText last isEmpty] whileTrue:[ |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3474 |
copyrightText := copyrightText copyButLast:1. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3475 |
]. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3476 |
(copyrightText first = '"') ifTrue:[ |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3477 |
(copyrightText last = '"') ifTrue:[ |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3478 |
copyrightText := copyrightText copyFrom:2 to:(copyrightText size - 1). |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3479 |
] |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3480 |
]. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3481 |
copyrightText := copyrightText asString. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3482 |
|
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3483 |
aStream nextPutAll:'<copyright>'. |
15789 | 3484 |
copyrightText printXmlTextQuotedOn:aStream. |
15160
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3485 |
aStream nextPutLine:'</copyright>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3486 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3487 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3488 |
stampIt ifTrue:[ |
15160
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3489 |
"/ |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3490 |
"/ first, a timestamp |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3491 |
"/ |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3492 |
aStream nextPutAll:'<time-stamp>'. |
15789 | 3493 |
Smalltalk timeStampString printXmlTextQuotedOn:aStream. |
15160
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3494 |
aStream nextPutLine:'</time-stamp>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3495 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3496 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3497 |
withDefinition ifTrue:[ |
15160
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3498 |
"/ |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3499 |
"/ then the definition |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3500 |
"/ |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3501 |
self fileOutXMLAllDefinitionsOn:aStream. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3502 |
"/ |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3503 |
"/ a comment - if any |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3504 |
"/ |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3505 |
(comment := self comment) notNil ifTrue:[ |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3506 |
aStream nextPutLine:'<comment>'. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3507 |
aStream nextPutAll:'<class-id>'. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3508 |
aStream nextPutAll:(self name). |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3509 |
aStream nextPutLine:'</class-id>'. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3510 |
aStream nextPutLine:'</comment>'. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3511 |
]. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3512 |
"/ |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3513 |
"/ primitive definitions - if any |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3514 |
"/ |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3515 |
"/ self fileOutPrimitiveSpecsOn:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3516 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3517 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3518 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3519 |
"/ 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
|
3520 |
"/ 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
|
3521 |
"/ avoid sourcePosition-shifts when checked out later. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3522 |
"/ (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
|
3523 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3524 |
collectionOfCategories := meta categories asSortedCollection. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3525 |
collectionOfCategories notNil ifTrue:[ |
15160
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3526 |
collectionOfCategories do:[:aCategory | |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3527 |
meta fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3528 |
] |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3529 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3530 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3531 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3532 |
"/ methods from all categories in myself |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3533 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3534 |
collectionOfCategories := self categories asSortedCollection. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3535 |
collectionOfCategories notNil ifTrue:[ |
15160
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3536 |
collectionOfCategories do:[:aCategory | |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3537 |
self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3538 |
] |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3539 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3540 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3541 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3542 |
"/ any private classes' methods |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3543 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3544 |
self privateClassesSorted do:[:aClass | |
15160
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3545 |
aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3546 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3547 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3548 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3549 |
initIt ifTrue:[ |
15160
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3550 |
"/ |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3551 |
"/ optionally an initialize message |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3552 |
"/ |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3553 |
(meta includesSelector:#initialize) ifTrue:[ |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3554 |
aStream nextPutLine:'<initialize>'. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3555 |
aStream nextPutAll:'<class-id>'. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3556 |
aStream nextPutAll:(self name). |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3557 |
aStream nextPutLine:'</class-id>'. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3558 |
aStream nextPutLine:'</initialize>'. |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3559 |
] |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3560 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3561 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3562 |
aStream nextPutLine:'</st-source>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3563 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3564 |
" |
8551 | 3565 |
Class |
15160
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3566 |
fileOutXMLOn:'test.xml' asFilename writeStream |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3567 |
withTimeStamp:true |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3568 |
withInitialize:true |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3569 |
withDefinition:true |
a936839c7675
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
15104
diff
changeset
|
3570 |
methodFilter:nil |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3571 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3572 |
! ! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3573 |
|
14929 | 3574 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3575 |
!Class methodsFor:'printOut'! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3576 |
|
2482 | 3577 |
htmlDocumentation |
8356 | 3578 |
<resource: #obsolete> |
7227
5df22f2ffebc
htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents:
7222
diff
changeset
|
3579 |
self obsoleteMethodWarning:'use HTMLDocGenerator htmlDocOf:'. |
5df22f2ffebc
htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents:
7222
diff
changeset
|
3580 |
|
2482 | 3581 |
^ HTMLDocGenerator htmlDocOf:self |
3582 |
||
3583 |
"Created: 22.3.1997 / 14:18:23 / cg" |
|
3584 |
! |
|
3585 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3586 |
printClassVarNamesOn:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3587 |
"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
|
3588 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3589 |
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
|
3590 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3591 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3592 |
printFullHierarchyOn:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3593 |
"print myself and all subclasses on aStream. |
8551 | 3594 |
recursively calls itself to print subclasses. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3595 |
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
|
3596 |
|
1996
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3597 |
|nm| |
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3598 |
|
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3599 |
nm := self name. |
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3600 |
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
|
3601 |
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
|
3602 |
aStream nextPutLine:')'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3603 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3604 |
(self subclasses sort:[:a :b | a name < b name]) do:[:aSubclass | |
13756 | 3605 |
aSubclass printFullHierarchyOn:aStream indent:(indent + 2) |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3606 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3607 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3608 |
"|printStream| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3609 |
printStream := Printer new. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3610 |
Object printFullHierarchyOn:printStream indent:0. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3611 |
printStream close" |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3612 |
|
1996
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3613 |
"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
|
3614 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3615 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3616 |
printOutDefinitionOn:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3617 |
"print out my definition" |
1 | 3618 |
|
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
3619 |
|comment s superclass| |
333 | 3620 |
|
8551 | 3621 |
aPrintStream nextPutAll:'class '; bold; nextPutLine:self name; normal. |
1 | 3622 |
aPrintStream nextPutAll:'superclass '. |
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
3623 |
superclass := self superclass. |
1 | 3624 |
superclass isNil ifTrue:[ |
13756 | 3625 |
s := 'Object' |
1 | 3626 |
] ifFalse:[ |
13756 | 3627 |
s := superclass name |
1 | 3628 |
]. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3629 |
aPrintStream nextPutLine:s. |
1 | 3630 |
|
3631 |
aPrintStream nextPutAll:'instance Variables '. |
|
3632 |
self printInstVarNamesOn:aPrintStream indent:21. |
|
8551 | 3633 |
aPrintStream cr. |
1 | 3634 |
|
3635 |
aPrintStream nextPutAll:'class Variables '. |
|
3636 |
self printClassVarNamesOn:aPrintStream indent:21. |
|
3637 |
aPrintStream cr. |
|
3638 |
||
3639 |
category notNil ifTrue:[ |
|
13756 | 3640 |
aPrintStream nextPutAll:'category '; |
3641 |
nextPutLine:(category printString). |
|
1 | 3642 |
]. |
3643 |
||
193 | 3644 |
(comment := self comment) notNil ifTrue:[ |
13756 | 3645 |
aPrintStream cr; nextPutLine:'comment:'; italic; nextPutLine:comment; normal |
1 | 3646 |
] |
733
983d045c17f5
make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
3647 |
|
983d045c17f5
make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
3648 |
"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
|
3649 |
"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
|
3650 |
"Modified: 1.4.1997 / 16:01:26 / stefan" |
1 | 3651 |
! |
3652 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3653 |
printOutOn:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3654 |
"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
|
3655 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3656 |
|collectionOfCategories| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3657 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3658 |
self printOutDefinitionOn:aPrintStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3659 |
aPrintStream cr. |
3937 | 3660 |
collectionOfCategories := self class categories asSortedCollection. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3661 |
collectionOfCategories notNil ifTrue:[ |
13756 | 3662 |
aPrintStream nextPutLine:'class protocol'. |
3663 |
aPrintStream cr. |
|
3664 |
collectionOfCategories do:[:aCategory | |
|
3665 |
self class printOutCategory:aCategory on:aPrintStream |
|
3666 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3667 |
]. |
3937 | 3668 |
collectionOfCategories := self categories asSortedCollection. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3669 |
collectionOfCategories notNil ifTrue:[ |
13756 | 3670 |
aPrintStream nextPutLine:'instance protocol'. |
3671 |
aPrintStream cr. |
|
3672 |
collectionOfCategories do:[:aCategory | |
|
3673 |
self printOutCategory:aCategory on:aPrintStream |
|
3674 |
] |
|
555 | 3675 |
] |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3676 |
|
3937 | 3677 |
"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
|
3678 |
! |
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3679 |
|
12903 | 3680 |
printOutProtocolOn:aPrintStream |
3681 |
"{ Pragma: +optSpace }" |
|
3682 |
||
3683 |
|collectionOfCategories| |
|
3684 |
||
3685 |
self printOutDefinitionOn:aPrintStream. |
|
3686 |
aPrintStream cr. |
|
3687 |
collectionOfCategories := self class categories asSortedCollection. |
|
3688 |
collectionOfCategories notNil ifTrue:[ |
|
13756 | 3689 |
aPrintStream nextPutLine:'class protocol'. |
3690 |
aPrintStream cr. |
|
3691 |
collectionOfCategories do:[:aCategory | |
|
3692 |
self class printOutCategoryProtocol:aCategory on:aPrintStream |
|
3693 |
] |
|
12903 | 3694 |
]. |
3695 |
collectionOfCategories := self categories asSortedCollection. |
|
3696 |
collectionOfCategories notNil ifTrue:[ |
|
13756 | 3697 |
aPrintStream nextPutLine:'instance protocol'. |
3698 |
aPrintStream cr. |
|
3699 |
collectionOfCategories do:[:aCategory | |
|
3700 |
self printOutCategoryProtocol:aCategory on:aPrintStream |
|
3701 |
] |
|
12903 | 3702 |
] |
3703 |
||
3704 |
"Modified: / 25.11.1998 / 12:40:38 / cg" |
|
3705 |
! |
|
3706 |
||
8551 | 3707 |
printSharedPoolNamesOn:aStream indent:indent |
3708 |
"print the pool names indented and breaking at line end" |
|
3709 |
||
13214 | 3710 |
self printNameArray:(self sharedPoolNames) on:aStream indent:indent |
3711 |
||
3712 |
"Modified: / 18-01-2011 / 17:56:16 / cg" |
|
8551 | 3713 |
! |
3714 |
||
5938
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3715 |
storeOn:aStream |
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3716 |
"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
|
3717 |
|
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3718 |
aStream nextPutAll:self name |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3719 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3720 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3721 |
!Class methodsFor:'private-accessing'! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3722 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3723 |
attributes |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3724 |
"return the extra class attributes or nil" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3725 |
|
12259 | 3726 |
attributes isNil ifTrue:[^ nil]. |
8551 | 3727 |
^ self classAttributes |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3728 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3729 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3730 |
attributes:aClassAttributesObject |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3731 |
"set the extra class attributes" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3732 |
|
8551 | 3733 |
self classAttributes:aClassAttributesObject |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3734 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3735 |
|
7486 | 3736 |
classAttributes |
12259 | 3737 |
"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
|
3738 |
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
|
3739 |
therefore, it generates arrays which are converted here, when we first access the attribute." |
7486 | 3740 |
|
12259 | 3741 |
attributes isNil ifTrue:[ |
13756 | 3742 |
attributes := ClassAttributes new. |
12259 | 3743 |
] ifFalse:[ |
13756 | 3744 |
attributes isArray ifTrue:[ |
3745 |
attributes := ClassAttributes new fromSTCPrimitiveArray:attributes. |
|
3746 |
]. |
|
7486 | 3747 |
]. |
12219
dd55372693c1
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
12197
diff
changeset
|
3748 |
^ attributes |
7486 | 3749 |
! |
3750 |
||
3751 |
classAttributes:aClassAttributesObject |
|
3752 |
"set the extra class attributes" |
|
3753 |
||
3754 |
attributes := aClassAttributesObject |
|
3755 |
! |
|
3756 |
||
12903 | 3757 |
flushSubclasses |
3758 |
subclasses := nil |
|
3759 |
! |
|
3760 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3761 |
getAttribute:aKey |
12259 | 3762 |
"get an attribute (by symbolic key)" |
3763 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3764 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3765 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3766 |
attributes isNil ifTrue:[ ^ nil]. |
13715 | 3767 |
^ self classAttributes valueFor:aKey |
3768 |
||
3769 |
"Modified: / 23-09-2011 / 10:23:45 / cg" |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3770 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3771 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3772 |
getSourceChunkAttribute:aKey |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3773 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3774 |
|
7472 | 3775 |
|pos stream string| |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3776 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3777 |
pos := self getAttribute:aKey. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3778 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3779 |
"the attribute is either a string, or an integer specifying the |
7472 | 3780 |
position within the classes sourcefile ..." |
3781 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3782 |
pos isNumber ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3783 |
"/ classFilename notNil ifTrue:[ |
15610 | 3784 |
stream := self sourceStream. |
3785 |
stream notNil ifTrue:[ |
|
3786 |
stream position:pos. |
|
3787 |
string := stream nextChunk. |
|
3788 |
stream close. |
|
3789 |
^ string |
|
3790 |
]. |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3791 |
"/ ]. |
15610 | 3792 |
^ nil |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3793 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3794 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3795 |
^ pos |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3796 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3797 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3798 |
setAttribute:key to:aValue |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3799 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3800 |
|
16227 | 3801 |
self classAttributes perform:key asMutator with:aValue |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3802 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3803 |
|
12903 | 3804 |
setName:aString |
3805 |
"set the classes name - be careful, it will be still |
|
3806 |
in the Smalltalk dictionary - under another key. |
|
3807 |
This is NOT for general use - see renameTo:" |
|
3808 |
||
3809 |
environment := nil. |
|
3810 |
name := aString |
|
3811 |
||
3812 |
"Created: 1.4.1997 / 15:46:01 / stefan" |
|
3813 |
! |
|
3814 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3815 |
setPrimitiveDefinitions:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3816 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3817 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3818 |
"set the primitiveDefinition string (no change notifications)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3819 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3820 |
^ self setAttribute:#primitiveDefinitions to:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3821 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3822 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3823 |
setPrimitiveFunctions:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3824 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3825 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3826 |
"set the primitiveFunction string (no change notifications)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3827 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3828 |
^ self setAttribute:#primitiveFunctions to:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3829 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3830 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3831 |
setPrimitiveVariables:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3832 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3833 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3834 |
"set the primitiveVariable string (no change notifications)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3835 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3836 |
^ 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
|
3837 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3838 |
|
13221
11f21a9fb78d
added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents:
13214
diff
changeset
|
3839 |
setSharedPoolNames:aStringOrCollection |
8551 | 3840 |
"{ Pragma: +optSpace }" |
3841 |
||
3842 |
"set the sharedPools string (no change notifications)" |
|
3843 |
||
3844 |
^ self setAttribute:#sharedPools to:aStringOrCollection |
|
13221
11f21a9fb78d
added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents:
13214
diff
changeset
|
3845 |
|
11f21a9fb78d
added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents:
13214
diff
changeset
|
3846 |
"Created: / 18-01-2011 / 20:41:09 / cg" |
8551 | 3847 |
! |
3848 |
||
12903 | 3849 |
setSubclasses:aCollection |
3850 |
subclasses := aCollection |
|
3851 |
||
3852 |
"Created: / 28-04-2010 / 08:48:49 / cg" |
|
3853 |
! |
|
3854 |
||
3855 |
updateAllCachedSubclasses |
|
13860 | 3856 |
|subclassesPerClass seqNr makeNewSet| |
3857 |
||
3858 |
makeNewSet := [Set new]. |
|
12903 | 3859 |
|
3860 |
subclassesPerClass := Dictionary new. |
|
3861 |
Smalltalk allClassesDo:[:each | |
|
14837 | 3862 |
|cls superclass| |
3863 |
||
3864 |
cls := each theNonMetaclass. |
|
3865 |
(superclass := each superclass) notNil ifTrue:[ |
|
3866 |
(subclassesPerClass at:superclass ifAbsentPut:makeNewSet) add:cls |
|
3867 |
]. |
|
3868 |
subclassesPerClass at:cls ifAbsentPut:makeNewSet. |
|
12689
834adbd43cc1
comment/format in: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents:
12633
diff
changeset
|
3869 |
]. |
13860 | 3870 |
|
3871 |
SubclassCacheSequenceNumber isNil ifTrue:[ |
|
14837 | 3872 |
SubclassCacheSequenceNumber := 0. |
13860 | 3873 |
]. |
3874 |
seqNr := SubclassCacheSequenceNumber. |
|
12903 | 3875 |
subclassesPerClass keysAndValuesDo:[:cls :subclasses | |
14837 | 3876 |
|coll| |
3877 |
||
3878 |
coll := ArrayWithSequenceNumberValidation withAll:subclasses. |
|
3879 |
coll sequenceNumber:seqNr. |
|
3880 |
cls setSubclasses:coll. |
|
12903 | 3881 |
]. |
3882 |
||
3883 |
" |
|
3884 |
Class updateAllCachedSubclasses |
|
13861 | 3885 |
Array subclasses |
12903 | 3886 |
" |
3887 |
||
3888 |
"Created: / 28-04-2010 / 08:47:20 / cg" |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3889 |
! ! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3890 |
|
7258 | 3891 |
!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
|
3892 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3893 |
addChangeRecordForChangeCategory:category to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3894 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3895 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3896 |
"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
|
3897 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3898 |
self printClassNameOn:aStream. |
14146 | 3899 |
aStream nextPutAll:' category:'. |
3900 |
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
|
3901 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3902 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3903 |
"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
|
3904 |
"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
|
3905 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3906 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3907 |
addChangeRecordForClass:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3908 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3909 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3910 |
"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
|
3911 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3912 |
aClass isLoaded ifTrue:[ |
13756 | 3913 |
aClass basicFileOutDefinitionOn:aStream withNameSpace:true. |
3914 |
aStream nextPutChunkSeparator. |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3915 |
] |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3916 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3917 |
"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
|
3918 |
"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
|
3919 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3920 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3921 |
addChangeRecordForClassComment:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3922 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3923 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3924 |
"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
|
3925 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3926 |
aClass fileOutCommentOn:aStream. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3927 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3928 |
"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
|
3929 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3930 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3931 |
addChangeRecordForClassInstvars:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3932 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3933 |
|
5225
d74b4c895376
comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents:
5190
diff
changeset
|
3934 |
"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
|
3935 |
|
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8267
diff
changeset
|
3936 |
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
|
3937 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3938 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3939 |
|
7179 | 3940 |
addChangeRecordForClassRemove:oldClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3941 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3942 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3943 |
"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
|
3944 |
|
14837 | 3945 |
aStream |
3946 |
nextPutAll:'Smalltalk removeClass:'; |
|
3947 |
nextPutAll:oldClass name; |
|
3948 |
nextPutChunkSeparator. |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3949 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3950 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3951 |
addChangeRecordForClassRename:oldName to:newName to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3952 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3953 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3954 |
"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
|
3955 |
|
14837 | 3956 |
aStream |
3957 |
nextPutAll:'Smalltalk renameClass:'; |
|
3958 |
nextPutAll:oldName; |
|
3959 |
nextPutAll:' to:'''; |
|
3960 |
nextPutAll:newName; |
|
3961 |
nextPutAll:''''; |
|
3962 |
nextPutChunkSeparator. |
|
1846 | 3963 |
|
14149
9e1500b191f7
changed: #addChangeRecordForClassRename:to:to:
Claus Gittinger <cg@exept.de>
parents:
14147
diff
changeset
|
3964 |
"Modified: / 01-06-2012 / 09:44:04 / cg" |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3965 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3966 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3967 |
addChangeRecordForPrimitiveDefinitions:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3968 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3969 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3970 |
"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
|
3971 |
|
8551 | 3972 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveDefinitions:'''; |
13756 | 3973 |
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
|
3974 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3975 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3976 |
"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
|
3977 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3978 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3979 |
addChangeRecordForPrimitiveFunctions:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3980 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3981 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3982 |
"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
|
3983 |
|
8551 | 3984 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveFunctions:'''; |
13756 | 3985 |
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
|
3986 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3987 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3988 |
"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
|
3989 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3990 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3991 |
addChangeRecordForPrimitiveVariables:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3992 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3993 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3994 |
"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
|
3995 |
|
8551 | 3996 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveVariables:'''; |
13756 | 3997 |
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
|
3998 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3999 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
4000 |
"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
|
4001 |
! ! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4002 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4003 |
!Class methodsFor:'queries'! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4004 |
|
9815 | 4005 |
canHaveExtensions |
4006 |
"return true, if this class allows extensions from other packages. |
|
4007 |
Private classes, namespaces and projectDefinitions dont allow this" |
|
4008 |
||
4009 |
^ self isPrivate not |
|
4010 |
||
4011 |
" |
|
4012 |
Smalltalk allClasses select:[:each | each canHaveExtensions not] |
|
4013 |
" |
|
4014 |
||
4015 |
"Created: / 30-08-2006 / 15:27:53 / cg" |
|
4016 |
! |
|
4017 |
||
8167 | 4018 |
classResources |
8185 | 4019 |
self isPrivate ifTrue:[ |
13756 | 4020 |
^ self owningClass classResources |
8185 | 4021 |
]. |
9930 | 4022 |
^ ResourcePack for:self cached:true. |
4023 |
||
4024 |
"Modified: / 18-09-2006 / 20:37:16 / cg" |
|
8167 | 4025 |
! |
4026 |
||
16036 | 4027 |
defaultCategoryForUncategorizedClasses |
4028 |
"used only when the short scripting class creation messages are used" |
|
4029 |
||
4030 |
^ DefaultCategoryForUncategorizedClasses ? 'Uncategorized classes'. |
|
4031 |
! |
|
4032 |
||
4033 |
defaultCategoryForUndeclaredClasses |
|
4034 |
^ DefaultCategoryForUndeclaredClasses ? '* undeclared classes *' |
|
4035 |
! |
|
4036 |
||
10084 | 4037 |
extensions |
17470 | 4038 |
"return a collection of extension-methods (both class and inst) from any other package, |
4039 |
or empty if there are none. |
|
15258 | 4040 |
Unassigned methods are ignored" |
4041 |
||
4042 |
|classPackage defaultPkg| |
|
10084 | 4043 |
|
4044 |
classPackage := self package. |
|
15258 | 4045 |
defaultPkg := PackageId noProjectID. |
4046 |
^ self methodsForWhich:[:mthd | mthd package ~= classPackage and:[ mthd package ~= defaultPkg ]] |
|
10084 | 4047 |
|
4048 |
" |
|
4049 |
CType extensions |
|
4050 |
Rectangle extensions |
|
4051 |
Rectangle hasExtensions |
|
15258 | 4052 |
Object extensions |
4053 |
Object hasExtensions |
|
10084 | 4054 |
" |
4055 |
||
4056 |
"Created: / 12-10-2006 / 18:29:51 / cg" |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
4057 |
"Modified: / 05-03-2007 / 17:12:04 / cg" |
10084 | 4058 |
! |
4059 |
||
9494 | 4060 |
extensionsFrom:aPackageID |
17470 | 4061 |
"return the set of extension-methods (both class and inst) from the given package." |
9494 | 4062 |
|
10084 | 4063 |
aPackageID = self package ifTrue:[^ #() ]. |
15258 | 4064 |
^ self methodsForWhich:[:mthd | mthd package = aPackageID] |
9494 | 4065 |
|
4066 |
" |
|
10084 | 4067 |
CType extensionsFrom:#'bosch:dapasx' |
13756 | 4068 |
Rectangle extensionsFrom:#'bosch:dapasx/support' |
10084 | 4069 |
Rectangle extensions |
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
4070 |
Class extensions |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
4071 |
Class extensionsFrom:#'stx:libboss' |
9494 | 4072 |
" |
4073 |
||
4074 |
"Created: / 07-08-2006 / 22:02:15 / fm" |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
4075 |
"Modified: / 06-03-2007 / 11:54:53 / cg" |
9494 | 4076 |
! |
4077 |
||
5545 | 4078 |
hasExtensions |
4079 |
"return true, if there are methods in the receiver, which belong to |
|
4080 |
a different package (i.e. package of class ~= package of method). |
|
4081 |
Those are class extensions, which must be treated specially when checking classes |
|
15258 | 4082 |
into the sourceCode repository. (extensions are stored separate). |
4083 |
Unassigned extensions are ignored here (i.e. as yet unpackaged changes)" |
|
5545 | 4084 |
|
6166 | 4085 |
|clsPkg defaultPkg| |
4086 |
||
12219
dd55372693c1
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
12197
diff
changeset
|
4087 |
defaultPkg := PackageId noProjectID. |
6166 | 4088 |
clsPkg := self package. |
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
4089 |
self instAndClassMethodsDo:[:mthd | |
15258 | 4090 |
|mthdPkg| |
4091 |
(((mthdPkg := mthd package) ~= clsPkg) and:[ mthdPkg ~= defaultPkg ]) ifTrue:[^ true ]. |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
4092 |
]. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
4093 |
^ false |
5545 | 4094 |
|
4095 |
" |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
4096 |
Time millisecondsToRun:[ |
15258 | 4097 |
Smalltalk allClasses select:[:each | each hasExtensions] |
17252 | 4098 |
]. |
10084 | 4099 |
|
13756 | 4100 |
Dictionary |
15258 | 4101 |
withAssociations: |
4102 |
(Smalltalk allClasses |
|
4103 |
select:[:each | each hasExtensions] |
|
4104 |
thenCollect:[:each | each -> each extensions]) |
|
5545 | 4105 |
" |
10084 | 4106 |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
4107 |
"Modified: / 05-03-2007 / 17:06:20 / cg" |
5545 | 4108 |
! |
4109 |
||
5659 | 4110 |
hasExtensionsFrom:aPackageID |
4111 |
"return true, if there are methods in the receiver, which belong to |
|
4112 |
the package with aPackageID (i.e. package of class ~= package of method). |
|
4113 |
Those are class extensions, which must be treated specially when checking classes |
|
8551 | 4114 |
into the sourceCode repository. (extensions are stored separate)" |
5659 | 4115 |
|
10084 | 4116 |
|clsPkg| |
4117 |
||
4118 |
clsPkg := self package. |
|
14146 | 4119 |
aPackageID = clsPkg ifTrue:[^ false]. |
10084 | 4120 |
|
13756 | 4121 |
self instAndClassMethodsDo:[:mthd | |
14837 | 4122 |
mthd package = aPackageID ifTrue:[ ^ true]. |
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
4123 |
]. |
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
4124 |
^ false |
5659 | 4125 |
|
4126 |
" |
|
13756 | 4127 |
Smalltalk allClasses |
14837 | 4128 |
select:[:each | each hasExtensionsFrom:'stx:goodies/refactyBrowser'] |
13756 | 4129 |
Smalltalk allClasses |
14837 | 4130 |
select:[:each | each hasExtensionsFrom:'stx:libboss'] |
5659 | 4131 |
" |
10084 | 4132 |
|
10438
9b6b921306c7
+hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents:
10376
diff
changeset
|
4133 |
"Modified: / 06-03-2007 / 11:55:39 / cg" |
5659 | 4134 |
! |
4135 |
||
15258 | 4136 |
hasUnassignedExtensions |
4137 |
"return true, if there are methods in the receiver, which have not been |
|
4138 |
assigned to any package." |
|
4139 |
||
4140 |
^ self unassignedExtensions notEmpty |
|
4141 |
||
4142 |
" |
|
4143 |
Time millisecondsToRun:[ |
|
4144 |
Smalltalk allClasses select:[:each | each hasUnassignedExtensions] |
|
4145 |
]. 190 130 260 |
|
4146 |
||
4147 |
Dictionary |
|
4148 |
withAssociations: |
|
4149 |
(Smalltalk allClasses |
|
4150 |
select:[:each | each hasUnassignedExtensions] |
|
4151 |
thenCollect:[:each | each -> each unassignedExtensions]) |
|
4152 |
" |
|
4153 |
! |
|
4154 |
||
12415 | 4155 |
hasUnsavedChanges |
4156 |
"return true, if there are changes for this class in the current changeSet" |
|
4157 |
||
4158 |
^ ChangeSet current includesChangeForClassOrMetaclassOrPrivateClassOf:self |
|
4159 |
||
4160 |
" |
|
4161 |
Class hasUnsavedChanges |
|
4162 |
Array hasUnsavedChanges |
|
4163 |
" |
|
4164 |
! |
|
4165 |
||
10042
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
4166 |
isBrowserStartable |
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
4167 |
"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
|
4168 |
which can be started from the browser" |
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
4169 |
|
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
4170 |
^ 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
|
4171 |
|
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
4172 |
"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
|
4173 |
! |
d028c01995f8
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
10035
diff
changeset
|
4174 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4175 |
isClass |
8551 | 4176 |
"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
|
4177 |
(a real class, not just behavior); |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4178 |
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
|
4179 |
See also Behavior>>isBehavior." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4180 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4181 |
^ true |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4182 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4183 |
" |
8551 | 4184 |
Point isClass |
4185 |
1 isClass |
|
4186 |
Behavior new isBehavior |
|
4187 |
Behavior new isClass |
|
4188 |
Class new isBehavior |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4189 |
Class new isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4190 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4191 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4192 |
|
8933 | 4193 |
isJavaScriptClass |
8936 | 4194 |
^ self class isJavaScriptMetaclass |
8933 | 4195 |
! |
4196 |
||
6723 | 4197 |
isStartableWithMain |
4198 |
"return true, if this is an application class, |
|
4199 |
which can be started via #main" |
|
4200 |
||
4201 |
^ self theMetaclass includesSelector:#main |
|
4202 |
||
4203 |
"Created: / 2.11.2001 / 09:37:01 / cg" |
|
4204 |
"Modified: / 2.11.2001 / 09:48:05 / cg" |
|
4205 |
! |
|
4206 |
||
8756 | 4207 |
isStartableWithStart |
4208 |
"return true, if this is an application class, |
|
4209 |
which can be started via #start" |
|
4210 |
||
4211 |
^ self theMetaclass includesSelector:#start |
|
4212 |
! |
|
4213 |
||
15258 | 4214 |
methodsForWhich:aFilter |
17470 | 4215 |
"return a collection of methods (both class and inst) for which aFilter returns true" |
15258 | 4216 |
|
4217 |
|matching| |
|
4218 |
||
4219 |
self instAndClassMethodsDo:[:mthd | |
|
4220 |
(aFilter value:mthd) ifTrue:[ |
|
4221 |
matching isNil ifTrue:[ |
|
4222 |
matching := OrderedCollection new. |
|
4223 |
]. |
|
4224 |
matching add:mthd |
|
4225 |
]. |
|
4226 |
]. |
|
4227 |
^ matching ? #() |
|
4228 |
! |
|
4229 |
||
16465 | 4230 |
methodsWithAnyResource:aResourceSymbolCollection |
4231 |
|methods| |
|
4232 |
||
4233 |
methods := OrderedCollection new. |
|
4234 |
||
4235 |
self withAllSuperclassesDo:[:eachClass| |
|
4236 |
eachClass instAndClassMethodsDo:[:eachMethod| |
|
4237 |
(eachMethod hasAnyResource:aResourceSymbolCollection) ifTrue:[ |
|
4238 |
methods add:eachMethod. |
|
4239 |
]. |
|
4240 |
]. |
|
4241 |
]. |
|
4242 |
||
4243 |
^ methods |
|
4244 |
||
4245 |
" |
|
4246 |
ApplicationModel methodsWithAnyResource:#(fontSpec) |
|
4247 |
" |
|
4248 |
! |
|
4249 |
||
11382 | 4250 |
packageDirectory |
11413 | 4251 |
"return the packageDirectory of this classes package. |
4252 |
That is usually the directory where my source is, and where package specific additional |
|
4253 |
files (bitmaps, resources etc.) are found." |
|
4254 |
||
11382 | 4255 |
^ Smalltalk getPackageDirectoryForPackage:self package. |
4256 |
||
4257 |
" |
|
13756 | 4258 |
self packageDirectory |
4259 |
stx_libbasic3 packageDirectory |
|
4260 |
Array packageDirectory |
|
11382 | 4261 |
" |
4262 |
! |
|
4263 |
||
2568
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
4264 |
rootsOfTheWorld |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
4265 |
"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
|
4266 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
4267 |
|set| |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
4268 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
4269 |
set := IdentitySet new. |
8551 | 4270 |
Smalltalk allClassesDo:[:aClass | |
13756 | 4271 |
aClass superclass isNil ifTrue:[set add:aClass] |
2568
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
4272 |
]. |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
4273 |
^ set asOrderedCollection |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
4274 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
4275 |
" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
4276 |
Class rootsOfTheWorld |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
4277 |
" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
4278 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
4279 |
"Modified: 18.4.1997 / 20:55:34 / cg" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
4280 |
! |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
4281 |
|
15258 | 4282 |
unassignedExtensions |
4283 |
"return a collection of methods which have not been assigned to any |
|
4284 |
any package, or empty if there are none." |
|
4285 |
||
4286 |
|noPackage| |
|
4287 |
||
4288 |
noPackage := PackageId noProjectID. |
|
4289 |
^ self methodsForWhich:[:mthd | mthd package == noPackage ] |
|
4290 |
||
4291 |
" |
|
4292 |
SchemeBoolean unassignedExtensions |
|
4293 |
" |
|
4294 |
! |
|
4295 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4296 |
wasAutoloaded |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4297 |
"return true, if this class came into the system via an |
555 | 4298 |
autoload; false otherwise. |
4299 |
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
|
4300 |
Autoload. The interface here is for your convenience." |
555 | 4301 |
|
4302 |
^ 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
|
4303 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4304 |
"Modified: 21.3.1996 / 16:27:09 / cg" |
555 | 4305 |
! |
4306 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4307 |
whichClassDefinesClassVar:aVariableName |
19834 | 4308 |
"return the class which defines the class variable named aVariableName." |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4309 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4310 |
|cls| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4311 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4312 |
cls := self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4313 |
[cls notNil] whileTrue:[ |
19834 | 4314 |
(cls classVarNames includes:aVariableName) ifTrue:[ ^ cls]. |
4315 |
cls := cls superclass |
|
556 | 4316 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4317 |
^ nil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4318 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4319 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4320 |
StandardSystemView whichClassDefinesClassVar:'ErrorSignal' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4321 |
StandardSystemView whichClassDefinesClassVar:'Foo' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4322 |
" |
19834 | 4323 |
! |
4324 |
||
4325 |
whichPoolDefinesPoolVar:aVariableName |
|
4326 |
"return the shared which defines the class variable named aVariableName or nil." |
|
4327 |
||
4328 |
self sharedPools do:[:eachPool | |
|
4329 |
(eachPool classVariableNames includes:aVariableName) ifTrue:[ ^ eachPool]. |
|
4330 |
]. |
|
4331 |
^ nil |
|
4332 |
||
4333 |
" |
|
4334 |
ZipArchiveConstants classVariableNames |
|
4335 |
ZipArchive sharedPools |
|
4336 |
ZipArchive whichPoolDefinesPoolVar:'ECREC_SIZE' |
|
4337 |
" |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4338 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4339 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4340 |
!Class methodsFor:'renaming'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4341 |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4342 |
makePrivateIn:newOwner |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4343 |
"make a private class of newOwner from the receiver; |
5612 | 4344 |
the receiver must be a public class. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4345 |
Returns the new private class." |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4346 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4347 |
|sel newClass| |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4348 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4349 |
self owningClass notNil ifTrue:[ |
13756 | 4350 |
^ self |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4351 |
]. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4352 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4353 |
sel := self definitionSelectorPrivate. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4354 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4355 |
newClass := self superclass |
13756 | 4356 |
perform:sel |
4357 |
withArguments:(Array |
|
4358 |
with:(self nameWithoutPrefix asSymbol) |
|
4359 |
with:(self instanceVariableString) |
|
4360 |
with:(self classVariableString) |
|
4361 |
with:'' |
|
4362 |
with:newOwner). |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4363 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4364 |
"/ copy over methods ... |
6023 | 4365 |
ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class. |
4366 |
ClassBuilder copyInvalidatedMethodsFrom:self for:newClass. |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4367 |
newClass class recompileInvalidatedMethods. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4368 |
newClass recompileInvalidatedMethods. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4369 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4370 |
newOwner changed:#newClass with:newClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4371 |
Smalltalk changed:#newClass with:newClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4372 |
|
2835 | 4373 |
self removeFromSystem. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4374 |
^ newClass |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4375 |
|
3494
23a6cf28b3a6
fixed makePrivate, if newOwner is in a nameSpace
Claus Gittinger <cg@exept.de>
parents:
3407
diff
changeset
|
4376 |
"Modified: / 29.5.1998 / 19:03:49 / cg" |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4377 |
! |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4378 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4379 |
makePublic |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4380 |
"make a public class from the receiver. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4381 |
The receiver must be a private class. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4382 |
Returns the new public class." |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4383 |
|
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
4384 |
^ self makePublicIn:Smalltalk |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
4385 |
! |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
4386 |
|
9417 | 4387 |
makePublicIn:newNameSpace |
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
4388 |
"make a public class from the receiver. |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
4389 |
The receiver must be a private class. |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
4390 |
Returns the new public class." |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
4391 |
|
9417 | 4392 |
|sel owner baseName newName newClass| |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4393 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4394 |
owner := self topOwningClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4395 |
owner isNil ifTrue:[^ self]. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4396 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4397 |
"/ first, create the public class ... |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4398 |
sel := self definitionSelector. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4399 |
|
9417 | 4400 |
Class nameSpaceQuerySignal answer:newNameSpace |
3044 | 4401 |
do:[ |
13756 | 4402 |
baseName := self nameWithoutPrefix. |
9417 | 4403 |
"/ (newNameSpace isNil or:[newNameSpace == Smalltalk]) ifTrue:[ |
4404 |
"/ newName := baseName |
|
4405 |
"/ ] ifFalse:[ |
|
4406 |
"/ newName := newNameSpace name , '::' , baseName |
|
4407 |
"/ ]. |
|
13756 | 4408 |
newName := baseName. |
4409 |
||
4410 |
newClass := self superclass |
|
4411 |
perform:sel |
|
4412 |
withArguments:(Array |
|
4413 |
with:(newName asSymbol) |
|
4414 |
with:(self instanceVariableString) |
|
4415 |
with:(self classVariableString) |
|
4416 |
with:'' |
|
4417 |
with:(owner category)). |
|
4418 |
||
4419 |
"/ copy over methods ... |
|
4420 |
ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class. |
|
4421 |
ClassBuilder copyInvalidatedMethodsFrom:self for:newClass. |
|
4422 |
newClass class recompileInvalidatedMethods. |
|
4423 |
newClass recompileInvalidatedMethods. |
|
3044 | 4424 |
]. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4425 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4426 |
owner changed:#newClass with:newClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4427 |
Smalltalk changed:#newClass with:newClass. |
9417 | 4428 |
(newNameSpace notNil and:[newNameSpace ~~ Smalltalk]) ifTrue:[ |
13756 | 4429 |
newNameSpace changed:#newClass with:newClass. |
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
4430 |
]. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4431 |
|
2835 | 4432 |
self removeFromSystem. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4433 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4434 |
^ newClass |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4435 |
|
9417 | 4436 |
"Created: / 23-06-1997 / 13:28:52 / cg" |
4437 |
"Modified: / 04-07-2006 / 16:27:12 / cg" |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4438 |
! |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4439 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4440 |
renameTo:newName |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4441 |
"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
|
4442 |
|
5863 | 4443 |
<resource:#obsolete> |
4444 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4445 |
|oldSym newSym| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4446 |
|
2835 | 4447 |
"/ the code below is obsolete - it does not deal with |
4448 |
"/ classVariables, private classes and does not |
|
5863 | 4449 |
"/ recompile other classes in order to care for namespace |
2835 | 4450 |
"/ changes. |
3702 | 4451 |
"/ Please use Smalltalk>>renameClass:to:, |
4452 |
"/ which deals with all of that. |
|
4453 |
self obsoleteMethodWarning:'use Smalltalk>>renameClass:to:'. |
|
2835 | 4454 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4455 |
oldSym := name asSymbol. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4456 |
newSym := newName asSymbol. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4457 |
self setName:newSym. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4458 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4459 |
Smalltalk at:oldSym put:nil. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4460 |
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
|
4461 |
Smalltalk at:newSym put:self. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4462 |
|
3702 | 4463 |
"Created: / 1.4.1997 / 15:27:53 / stefan" |
4464 |
"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
|
4465 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4466 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4467 |
!Class methodsFor:'signature checking'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4468 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4469 |
classinstSizeFromSignature:aSignature |
8551 | 4470 |
"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
|
4471 |
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
|
4472 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4473 |
^ (aSignature bitShift:-7) bitAnd:7 |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4474 |
|
12840 | 4475 |
" |
4476 |
Class classinstSizeFromSignature:16r100. 2 |
|
4477 |
Class classinstSizeFromSignature:16r180. 3 |
|
4478 |
" |
|
4479 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4480 |
"Created: 1.4.1997 / 15:23:01 / stefan" |
556 | 4481 |
! |
4482 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4483 |
instNameKeyFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4484 |
"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
|
4485 |
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
|
4486 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4487 |
^ (aSignature bitShift:-14) bitAnd:16rFFFF |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4488 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4489 |
" |
8551 | 4490 |
Point instNameKeyFromSignature:Point signature. |
4491 |
Association instNameKeyFromSignature:Association signature. |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4492 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4493 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4494 |
"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
|
4495 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4496 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4497 |
instSizeFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4498 |
"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
|
4499 |
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
|
4500 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4501 |
^ aSignature bitAnd:16r7F |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4502 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4503 |
" |
8551 | 4504 |
Class instSizeFromSignature:Point signature. |
4505 |
Class instSizeFromSignature:Association signature. |
|
4506 |
Class instSizeFromSignature:Dictionary signature. |
|
12840 | 4507 |
Class instSizeFromSignature:16r100. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4508 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4509 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4510 |
"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
|
4511 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4512 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4513 |
instTypeFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4514 |
"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
|
4515 |
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
|
4516 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4517 |
^ (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
|
4518 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4519 |
" |
8551 | 4520 |
Class instTypeFromSignature:Object signature. |
4521 |
Class instTypeFromSignature:Array signature. |
|
4522 |
Class instTypeFromSignature:String signature. |
|
4523 |
Class instTypeFromSignature:OrderedCollection signature. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4524 |
" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4525 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4526 |
"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
|
4527 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4528 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4529 |
signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4530 |
"return a signature number - this number is useful for a quick |
8551 | 4531 |
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
|
4532 |
and the dynamic class loader. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4533 |
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
|
4534 |
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
|
4535 |
(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
|
4536 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4537 |
|value "{ Class: SmallInteger }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4538 |
nameKey "{ Class: SmallInteger }" | |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4539 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4540 |
signature notNil ifTrue:[^ signature]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4541 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4542 |
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
|
4543 |
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
|
4544 |
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
|
4545 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4546 |
nameKey := 0. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4547 |
self allInstVarNames do:[:name | |
13756 | 4548 |
nameKey := nameKey bitShift:1. |
4549 |
(nameKey bitAnd:16r10000) ~~ 0 ifTrue:[ |
|
4550 |
nameKey := nameKey bitXor:1. |
|
4551 |
nameKey := nameKey bitAnd:16rFFFF. |
|
4552 |
]. |
|
4553 |
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
|
4554 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4555 |
value := value + (nameKey bitShift:14). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4556 |
signature := value. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4557 |
^ value |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4558 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4559 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4560 |
Array signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4561 |
ByteArray signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4562 |
View signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4563 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4564 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4565 |
"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
|
4566 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4567 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4568 |
!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
|
4569 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4570 |
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
|
4571 |
"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
|
4572 |
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
|
4573 |
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
|
4574 |
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
|
4575 |
|
15947 | 4576 |
|owner manager info c| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4577 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4578 |
(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
|
4579 |
|
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4580 |
revision notNil ifTrue:[ |
15947 | 4581 |
c := revision first. |
4582 |
c == $$ ifTrue:[ |
|
4583 |
manager := self sourceCodeManagerFromBinaryRevision. |
|
4584 |
manager notNil ifTrue:[ |
|
4585 |
info := manager revisionInfoFromString:revision. |
|
4586 |
]. |
|
4587 |
info isNil ifTrue:[^ '0']. |
|
4588 |
^ (info revision) ? '0'. |
|
4589 |
]. |
|
4590 |
c isDigit ifFalse:[ |
|
4591 |
^ '0' |
|
4592 |
]. |
|
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4593 |
]. |
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4594 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4595 |
^ 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
|
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 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4598 |
Object binaryRevision |
953
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4599 |
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
|
4600 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4601 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4602 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4603 |
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
|
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 |
|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
|
4606 |
|
8551 | 4607 |
classes := Smalltalk allClasses |
15947 | 4608 |
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
|
4609 |
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
|
4610 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4611 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
4612 |
"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
|
4613 |
"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
|
4614 |
"Modified: / 22-10-2008 / 20:37:05 / cg" |
15947 | 4615 |
"Modified: / 23-01-2012 / 19:38:50 / Jan Vrany <jan.vrany@fit.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
|
4616 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4617 |
|
13474 | 4618 |
binaryRevisionString |
4619 |
"return the revision-ID from which the class was stc-compiled; |
|
4620 |
nil if its an autoloaded or filedIn class. |
|
4621 |
If a classes binary is up-to-date w.r.t. the source repository, |
|
4622 |
the returned string is the same as the one returned by #revision." |
|
4623 |
||
4624 |
^ revision |
|
4625 |
||
4626 |
" |
|
4627 |
Object binaryRevisionString |
|
4628 |
Object class binaryRevisionString |
|
4629 |
" |
|
4630 |
||
4631 |
" |
|
4632 |
to find all classes which are not up-to-date: |
|
4633 |
||
4634 |
|classes| |
|
4635 |
||
4636 |
classes := Smalltalk allClasses |
|
13756 | 4637 |
select:[:cls | cls binaryRevision notNil and:[cls binaryRevision ~= cls revision]]. |
13474 | 4638 |
SystemBrowser browseClasses:classes title:'classes which are not up-to-date' |
4639 |
" |
|
4640 |
||
4641 |
"Modified: / 01-04-1997 / 23:33:01 / stefan" |
|
4642 |
"Modified: / 22-10-2008 / 20:37:05 / cg" |
|
4643 |
"Created: / 01-07-2011 / 10:55:03 / cg" |
|
4644 |
! |
|
4645 |
||
5183 | 4646 |
currentSourceStream |
4647 |
"return an open stream on the current source of the receiver" |
|
4648 |
||
4649 |
|theWriteStream theCurrentSource| |
|
4650 |
||
8222
f2c454a9a038
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
8212
diff
changeset
|
4651 |
theWriteStream := String writeStream. |
5183 | 4652 |
Method flushSourceStreamCache. |
4653 |
self fileOutOn:theWriteStream withTimeStamp:false. |
|
4654 |
theCurrentSource := theWriteStream contents asString. |
|
4655 |
theWriteStream close. |
|
4656 |
^ theCurrentSource |
|
4657 |
||
4658 |
"Modified: 15.10.1996 / 18:59:40 / cg" |
|
4659 |
"Modified: 1.4.1997 / 14:33:12 / stefan" |
|
4660 |
! |
|
4661 |
||
12103 | 4662 |
findVersionMethod |
4663 |
"{ Pragma: +optSpace }" |
|
4664 |
||
4665 |
"return my revision method. Either this is the sourceCodeManager-specific versionMethod, |
|
4666 |
or the fallBack (for backward compatibility)" |
|
4667 |
||
13342 | 4668 |
|owner| |
12103 | 4669 |
|
4670 |
(owner := self owningClass) notNil ifTrue:[^ owner findVersionMethod]. |
|
15947 | 4671 |
^ self findVersionMethodOfManager:self sourceCodeManagerFromBinaryRevision |
13342 | 4672 |
|
4673 |
" |
|
4674 |
Smalltalk allClassesDo:[:cls | |
|
15947 | 4675 |
Transcript show:cls name; show:' -> '; showCR:cls findVersionMethod |
13342 | 4676 |
]. |
4677 |
||
13756 | 4678 |
Number findVersionMethod |
4679 |
FileDirectory findVersionMethod |
|
4680 |
Metaclass findVersionMethod |
|
4681 |
Class findVersionMethod |
|
13342 | 4682 |
" |
4683 |
||
4684 |
"Modified: / 19-04-2011 / 13:30:42 / cg" |
|
15947 | 4685 |
"Modified: / 19-07-2013 / 22:11:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13342 | 4686 |
! |
4687 |
||
4688 |
findVersionMethodOfManager:aSourceCodemanagerOrNil |
|
4689 |
"{ Pragma: +optSpace }" |
|
4690 |
||
4691 |
"return my revision method. Either this is the sourceCodeManager-specific versionMethod, |
|
4692 |
or the fallBack (for backward compatibility)" |
|
4693 |
||
13755 | 4694 |
|owner cls meta allVersionMethodNames nameOfVersionMethodForManager nameOfOldVersionMethod |
14228
48b79a50c1e7
changed: #findVersionMethodOfManager:
Claus Gittinger <cg@exept.de>
parents:
14149
diff
changeset
|
4695 |
tryVersionFromVersionMethod prefixOfVersionMethodSelector| |
13342 | 4696 |
|
4697 |
(owner := self owningClass) notNil ifTrue:[^ owner findVersionMethodOfManager:aSourceCodemanagerOrNil]. |
|
12103 | 4698 |
|
13756 | 4699 |
tryVersionFromVersionMethod := |
14837 | 4700 |
[:versionMethodsName | |
4701 |
|aVersionMethod val| |
|
4702 |
||
4703 |
aVersionMethod := meta compiledMethodAt:versionMethodsName. |
|
4704 |
(aVersionMethod notNil and:[aVersionMethod isExecutable]) ifTrue:[ |
|
4705 |
"/ |
|
4706 |
"/ if it's a method returning the version string, |
|
4707 |
"/ that's the returned value |
|
4708 |
"/ |
|
4709 |
val := cls perform:versionMethodsName. |
|
4710 |
val isString ifTrue:[^ aVersionMethod]. |
|
4711 |
]. |
|
4712 |
]. |
|
13755 | 4713 |
|
12103 | 4714 |
meta := self theMetaclass. |
4715 |
cls := self theNonMetaclass. |
|
4716 |
||
14837 | 4717 |
prefixOfVersionMethodSelector := |
4718 |
AbstractSourceCodeManager notNil |
|
4719 |
ifTrue: [AbstractSourceCodeManager prefixOfVersionMethodSelector ] |
|
4720 |
ifFalse:[ 'version_' ]. "/ sigh - for standalone apps without libbasic3 |
|
14228
48b79a50c1e7
changed: #findVersionMethodOfManager:
Claus Gittinger <cg@exept.de>
parents:
14149
diff
changeset
|
4721 |
|
48b79a50c1e7
changed: #findVersionMethodOfManager:
Claus Gittinger <cg@exept.de>
parents:
14149
diff
changeset
|
4722 |
allVersionMethodNames := meta methodDictionary keys select:[:sel | sel startsWith:prefixOfVersionMethodSelector]. |
13755 | 4723 |
|
13342 | 4724 |
aSourceCodemanagerOrNil notNil ifTrue:[ |
14837 | 4725 |
nameOfVersionMethodForManager := aSourceCodemanagerOrNil nameOfVersionMethodInClasses. |
4726 |
(allVersionMethodNames includes:nameOfVersionMethodForManager) ifTrue:[ |
|
4727 |
tryVersionFromVersionMethod value:nameOfVersionMethodForManager |
|
4728 |
]. |
|
4729 |
||
4730 |
"/ only trust the oldVersion method, iff there is no other scv-version |
|
4731 |
"/ (i.e. do not misuse an svn-checked-in #version as a version_cvs) |
|
4732 |
(allVersionMethodNames copyWithout:nameOfVersionMethodForManager) notEmpty ifTrue:[ |
|
4733 |
^ nil |
|
4734 |
]. |
|
13756 | 4735 |
]. |
13755 | 4736 |
|
4737 |
nameOfOldVersionMethod := self nameOfOldVersionMethod. |
|
4738 |
tryVersionFromVersionMethod value:nameOfOldVersionMethod. |
|
4739 |
||
12103 | 4740 |
^ nil. |
4741 |
||
4742 |
" |
|
4743 |
Smalltalk allClassesDo:[:cls | |
|
14837 | 4744 |
Transcript show:cls name; show:' -> '; showCR:cls findVersionMethod |
12103 | 4745 |
]. |
4746 |
||
13756 | 4747 |
Number findVersionMethod |
4748 |
FileDirectory findVersionMethod |
|
4749 |
Metaclass findVersionMethod |
|
4750 |
Class findVersionMethod |
|
12103 | 4751 |
" |
13342 | 4752 |
|
4753 |
"Created: / 19-04-2011 / 13:30:05 / cg" |
|
12103 | 4754 |
! |
4755 |
||
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4756 |
localSourceStreamFor:sourceFile |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4757 |
"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
|
4758 |
|
5073 | 4759 |
|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
|
4760 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4761 |
"/ |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4762 |
"/ old: look in 'source/<filename>' |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4763 |
"/ 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
|
4764 |
"/ classes in her currentDirectory. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4765 |
"/ |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4766 |
fileName := Smalltalk getSourceFileName:sourceFile. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4767 |
fileName notNil ifTrue:[ |
13756 | 4768 |
^ fileName asFilename readStreamOrNil. |
3165
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
4769 |
]. |
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
4770 |
|
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
4771 |
(package := self package) notNil ifTrue:[ |
13756 | 4772 |
"/ newest scheme ... |
4773 |
packageDir := Smalltalk findPackageDirectoryForPackage:package. |
|
4774 |
packageDir notNil ifTrue:[ |
|
4775 |
"/ present there ? |
|
4776 |
packageDir := packageDir asFilename. |
|
4777 |
(fn := packageDir construct:sourceFile) exists ifTrue:[ |
|
4778 |
^ fn readStreamOrNil. |
|
4779 |
]. |
|
4780 |
||
4781 |
"/ a source subdirectory ? |
|
4782 |
fn := (packageDir construct:'source') construct:sourceFile. |
|
4783 |
fn exists ifTrue:[ |
|
4784 |
^ fn readStreamOrNil. |
|
4785 |
]. |
|
4786 |
||
4787 |
"/ a zip-file ? |
|
4788 |
fn := (packageDir construct:'source.zip'). |
|
4789 |
fn exists ifTrue:[ |
|
4790 |
zar := ZipArchive oldFileNamed:fn. |
|
4791 |
zar notNil ifTrue:[ |
|
4792 |
entry := zar extract:sourceFile. |
|
4793 |
entry notNil ifTrue:[ |
|
4794 |
^ entry asString readStream |
|
4795 |
] |
|
4796 |
] |
|
4797 |
] |
|
4798 |
]. |
|
4799 |
||
4800 |
"/ will vanish ... |
|
4801 |
(package includes:$:) ifTrue:[ |
|
4802 |
package := package asString copyReplaceAll:$: with:$/ |
|
4803 |
] ifFalse:[ |
|
4804 |
package := 'stx/' , package |
|
4805 |
]. |
|
4806 |
fileName := Smalltalk getSourceFileName:(package , '/' , sourceFile). |
|
4807 |
fileName notNil ifTrue:[ |
|
4808 |
^ fileName asFilename readStreamOrNil. |
|
4809 |
]. |
|
4810 |
(package startsWith:'stx/') ifTrue:[ |
|
4811 |
fileName := Smalltalk getSourceFileName:((package copyFrom:5) , '/' , sourceFile). |
|
4812 |
fileName notNil ifTrue:[ |
|
4813 |
^ fileName asFilename readStreamOrNil. |
|
4814 |
] |
|
4815 |
] |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4816 |
]. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4817 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4818 |
"/ |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4819 |
"/ new: look in 'source/<module>/<package>/<filename> |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4820 |
"/ 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
|
4821 |
"/ obsolete. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4822 |
info := self packageSourceCodeInfo. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4823 |
info notNil ifTrue:[ |
13756 | 4824 |
module := info at:#module ifAbsent:nil. |
4825 |
module notNil ifTrue:[ |
|
4826 |
dir := info at:#directory ifAbsent:nil. |
|
4827 |
dir notNil ifTrue:[ |
|
4828 |
fn := (module asFilename construct:dir) construct:sourceFile. |
|
4829 |
fileName := Smalltalk getSourceFileName:(fn name). |
|
4830 |
fileName notNil ifTrue:[ |
|
4831 |
^ fileName asFilename readStreamOrNil. |
|
4832 |
]. |
|
4833 |
||
4834 |
"/ brand new: look for source/<module>/package.zip |
|
4835 |
"/ containing an entry for <filename> |
|
4836 |
||
4837 |
fn := (module asFilename construct:dir) withSuffix:'zip'. |
|
4838 |
fileName := Smalltalk getSourceFileName:(fn name). |
|
4839 |
fileName notNil ifTrue:[ |
|
4840 |
zar := ZipArchive oldFileNamed:fileName. |
|
4841 |
zar notNil ifTrue:[ |
|
4842 |
entry := zar extract:sourceFile. |
|
4843 |
entry notNil ifTrue:[ |
|
4844 |
^ entry asString readStream |
|
4845 |
] |
|
4846 |
] |
|
4847 |
]. |
|
4848 |
||
4849 |
"/ and also in source/source.zip ... |
|
4850 |
||
4851 |
fileName := Smalltalk getSourceFileName:'source.zip'. |
|
4852 |
fileName notNil ifTrue:[ |
|
4853 |
zar := ZipArchive oldFileNamed:fileName. |
|
4854 |
zar notNil ifTrue:[ |
|
4855 |
entry := zar extract:sourceFile. |
|
4856 |
entry notNil ifTrue:[ |
|
4857 |
^ entry asString readStream |
|
4858 |
] |
|
4859 |
] |
|
4860 |
]. |
|
4861 |
] |
|
4862 |
] |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4863 |
]. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4864 |
^ nil |
3165
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
4865 |
|
3657 | 4866 |
"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
|
4867 |
! |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4868 |
|
13461
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4869 |
nameOfOldVersionMethod |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4870 |
"this is now more or less obsolete, as multiple sourceCodeManagers might use |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4871 |
different version_XXX methods. Currently, we keep this for backward compatibility. |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4872 |
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
|
4873 |
be removed and replaced by version_XXX methods (one per manager)." |
13342 | 4874 |
|
7174
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4875 |
^ #version |
13342 | 4876 |
|
4877 |
"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
|
4878 |
! |
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4879 |
|
13461
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4880 |
nameOfVersionMethod |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4881 |
"this is now more or less obsolete, as multiple sourceCodeManagers might use |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4882 |
different version_XXX methods. Keep this for backward compatibility. |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4883 |
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
|
4884 |
be removed and replaced by version_XXX methods (one per manager)." |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4885 |
|
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4886 |
self obsoleteMethodWarning. |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4887 |
^ self nameOfOldVersionMethod |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4888 |
|
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4889 |
"Modified: / 19-04-2011 / 13:42:18 / cg" |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4890 |
! |
ec9713586014
added: #nameOfOldVersionMethod
Claus Gittinger <cg@exept.de>
parents:
13418
diff
changeset
|
4891 |
|
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
|
4892 |
packageSourceCodeInfo |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4893 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4894 |
|
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
|
4895 |
"return the sourceCodeInfo, which defines the module and the subdirectory |
8551 | 4896 |
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
|
4897 |
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
|
4898 |
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
|
4899 |
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
|
4900 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4901 |
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
|
4902 |
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
|
4903 |
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
|
4904 |
(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
|
4905 |
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
|
4906 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4907 |
By convention, this info is encoded in the classes package |
8551 | 4908 |
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
|
4909 |
The info consists of 1 to 3 subcomponents, separated by colons. |
8551 | 4910 |
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
|
4911 |
the second defines the subdirectory within that module, the third |
8551 | 4912 |
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
|
4913 |
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
|
4914 |
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
|
4915 |
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
|
4916 |
(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
|
4917 |
|
8551 | 4918 |
For example: |
15517 | 4919 |
'....(libbasic)' -> module: stx directory: libbasic library: libbasic |
4920 |
'....(stx:libbasic)' -> module: stx directory: libbasic library: libbasic |
|
4921 |
'....(stx:foo:libbfoo)' -> module: stx directory: foo library: libfoo |
|
4922 |
'....(aeg:libIECInterface)' -> module: aeg directory: libIECInterface library:libIECInterface |
|
4923 |
'....(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
|
4924 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4925 |
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
|
4926 |
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
|
4927 |
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
|
4928 |
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
|
4929 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4930 |
Caveat: |
15517 | 4931 |
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
|
4932 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4933 |
|
8551 | 4934 |
|owner sourceInfo packageString idx1 idx2 |
4116 | 4935 |
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
|
4936 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4937 |
(owner := self owningClass) notNil ifTrue:[^ owner packageSourceCodeInfo]. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4938 |
|
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
|
4939 |
package isNil ifTrue:[^ nil]. |
12219
dd55372693c1
Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents:
12197
diff
changeset
|
4940 |
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
|
4941 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4942 |
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
|
4943 |
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
|
4944 |
idx1 ~~ 0 ifTrue:[ |
15517 | 4945 |
idx2 := packageString indexOf:$) startingAt:idx1+1. |
4946 |
idx2 ~~ 0 ifTrue:[ |
|
4947 |
sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1 |
|
4948 |
] |
|
2453
603af5a4e0fc
handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents:
2444
diff
changeset
|
4949 |
] ifFalse:[ |
15517 | 4950 |
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
|
4951 |
]. |
2453
603af5a4e0fc
handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents:
2444
diff
changeset
|
4952 |
|
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
|
4953 |
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
|
4954 |
components := sourceInfo asCollectionOfSubstringsSeparatedBy:$:. |
15517 | 4955 |
components isEmpty ifTrue:[ |
2958
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
4956 |
"/ moduleString := 'stx'. |
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
4957 |
"/ directoryString := libraryString := ''. |
15517 | 4958 |
^ nil |
2454 | 4959 |
]. |
4116 | 4960 |
|
4961 |
component1 := components at:1. |
|
2454 | 4962 |
components size == 1 ifTrue:[ |
15517 | 4963 |
"/ a single name given - the module becomes 'stx' or |
4964 |
"/ the very first directory component (if such a module exists). |
|
4965 |
"/ If the component includes slashes, its the directory |
|
4966 |
"/ otherwise the library. |
|
4967 |
"/ |
|
4968 |
dirComponents := Filename components:component1. |
|
4969 |
(dirComponents size > 1 |
|
4970 |
and:[(mgr := self sourceCodeManager) notNil |
|
4971 |
and:[mgr checkForExistingModule:dirComponents first]]) ifTrue:[ |
|
4972 |
moduleString := dirComponents first. |
|
4973 |
directoryString := libraryString := (Filename fromComponents:(dirComponents copyFrom:2)) asString. |
|
4974 |
] ifFalse:[ |
|
4975 |
"/ non-existing; assume directory under the stx package. |
|
4976 |
moduleString := 'stx'. |
|
4977 |
(component1 startsWith:'stx/') ifTrue:[ |
|
4978 |
component1 := component1 copyFrom:5 |
|
4979 |
]. |
|
4980 |
directoryString := libraryString := component1. |
|
4981 |
]. |
|
4982 |
||
4983 |
(libraryString includes:$/) ifTrue:[ |
|
4984 |
libraryString := libraryString asFilename baseName |
|
4985 |
] |
|
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
|
4986 |
] ifFalse:[ |
15517 | 4987 |
moduleString := component1. |
4988 |
component2 := components at:2. |
|
4989 |
directoryString := component2. |
|
4990 |
components size == 2 ifTrue:[ |
|
4991 |
"/ two components - assume its the module and the directory; |
|
4992 |
"/ the library is assumed to be named after the directory |
|
4993 |
"/ except, if slashes are in the name; then the libraryname |
|
4994 |
"/ is the last component. |
|
4995 |
"/ |
|
4996 |
libraryString := component2. |
|
4997 |
(libraryString includes:$/) ifTrue:[ |
|
4998 |
libraryString := libraryString asFilename baseName |
|
4999 |
] |
|
5000 |
] ifFalse:[ |
|
5001 |
"/ all components given |
|
5002 |
libraryString := components at:3. |
|
5003 |
] |
|
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
|
5004 |
]. |
2454 | 5005 |
|
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
|
5006 |
libraryString isEmpty ifTrue:[ |
15517 | 5007 |
directoryString notEmpty ifTrue:[ |
5008 |
libraryString := directoryString asFilename baseName |
|
5009 |
]. |
|
5010 |
libraryString isEmpty ifTrue:[ |
|
5011 |
"/ lets extract the library from the liblist file ... |
|
5012 |
libraryString := Smalltalk libraryFileNameOfClass:self. |
|
5013 |
libraryString isNil ifTrue:[^ nil]. |
|
5014 |
] |
|
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
|
5015 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5016 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5017 |
moduleString isEmpty ifTrue:[ |
15517 | 5018 |
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
|
5019 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5020 |
directoryString isEmpty ifTrue:[ |
15517 | 5021 |
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
|
5022 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5023 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5024 |
^ IdentityDictionary |
15517 | 5025 |
with:(#module->moduleString) |
5026 |
with:(#directory->directoryString) |
|
5027 |
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
|
5028 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5029 |
" |
8551 | 5030 |
Object packageSourceCodeInfo |
5031 |
View packageSourceCodeInfo |
|
5032 |
Model packageSourceCodeInfo |
|
5033 |
BinaryObjectStorage packageSourceCodeInfo |
|
5034 |
MemoryMonitor packageSourceCodeInfo |
|
5035 |
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
|
5036 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5037 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5038 |
"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
|
5039 |
"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
|
5040 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5041 |
|
8770 | 5042 |
projectDirectory |
16498 | 5043 |
"return my package's/project's directory - that's where the sources, binaries, classLib, |
8770 | 5044 |
resources etc. are typically found." |
5045 |
||
5046 |
^ Smalltalk projectDirectoryForClass:self |
|
5047 |
||
5048 |
" |
|
5049 |
Object projectDirectory |
|
5050 |
View projectDirectory |
|
5051 |
ApplicationModel projectDirectory |
|
5052 |
" |
|
5053 |
! |
|
5054 |
||
7866 | 5055 |
resourceDirectory |
5056 |
"return the directory where my resource file is supposed to live. |
|
5057 |
Here, take the package and assume that a directory named 'resources' exists |
|
5058 |
in my package directory. |
|
5059 |
Return nil, if no such directory exists." |
|
5060 |
||
10102 | 5061 |
^ Smalltalk resourceDirectoryForPackage:(self package) |
7866 | 5062 |
|
5063 |
" |
|
8551 | 5064 |
Object resourceDirectory |
5065 |
View resourceDirectory |
|
5066 |
ApplicationModel resourceDirectory |
|
7866 | 5067 |
" |
10102 | 5068 |
|
5069 |
"Modified: / 19-10-2006 / 23:08:37 / cg" |
|
7866 | 5070 |
! |
5071 |
||
3248
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
5072 |
resourcePackName |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
5073 |
"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
|
5074 |
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
|
5075 |
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
|
5076 |
The default here is the classes name - this can be redefined in classes |
10102 | 5077 |
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
|
5078 |
|
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
5079 |
^ self name |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
5080 |
|
10102 | 5081 |
"Created: / 29-01-1998 / 22:20:12 / cg" |
5082 |
"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
|
5083 |
! |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
5084 |
|
8267 | 5085 |
resourcePackage |
5086 |
"return the package from where my resources are loaded. |
|
5087 |
By default, that is the classes package." |
|
5088 |
||
5089 |
^ self package |
|
5090 |
! |
|
5091 |
||
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
|
5092 |
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
|
5093 |
"return the revision-ID of the class which corresponds to the |
13474 | 5094 |
scm-version-id of the source to which this class is equivalent. |
17160 | 5095 |
The class's default source code manager is asked here. |
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
|
5096 |
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
|
5097 |
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
|
5098 |
the old revision, while logically, the class has the new (checked-in) revision. |
8551 | 5099 |
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
|
5100 |
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
|
5101 |
|
13622 | 5102 |
^ 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
|
5103 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5104 |
" |
8551 | 5105 |
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
|
5106 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5107 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
5108 |
"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
|
5109 |
"Modified: / 26-03-1997 / 00:14:00 / stefan" |
13622 | 5110 |
"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
|
5111 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5112 |
|
2582 | 5113 |
revisionDateString |
5114 |
"return the revision-Date of the class as a string. |
|
5115 |
This is extracted from the version string." |
|
5116 |
||
5117 |
|info| |
|
5118 |
||
5119 |
info := self revisionInfo. |
|
5120 |
info notNil ifTrue:[ |
|
13756 | 5121 |
^ (info date) ? '??/??/??' |
2582 | 5122 |
]. |
5123 |
^ '??/??/??' |
|
5124 |
||
5125 |
" |
|
8551 | 5126 |
Object revisionDateString |
2582 | 5127 |
" |
5128 |
||
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
5129 |
"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
|
5130 |
"Modified: / 22-10-2008 / 20:38:25 / cg" |
2582 | 5131 |
! |
5132 |
||
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
|
5133 |
revisionInfo |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
5134 |
"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
|
5135 |
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
|
5136 |
The revisionInfo contains all or a subset of: |
13756 | 5137 |
binaryRevision - the revision upon which the binary of this class is based |
5138 |
revision - the revision upon which the class is based logically |
|
5139 |
(different, if a changed class was checked in, but not yet recompiled) |
|
5140 |
user - the user who checked in the logical revision |
|
5141 |
date - the date when the logical revision was checked in |
|
5142 |
time - the time when the logical revision was checked in |
|
5143 |
fileName - the classes source file name |
|
5144 |
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
|
5145 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5146 |
|
15947 | 5147 |
^ self revisionInfoOfManager:self sourceCodeManagerFromBinaryRevision |
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
|
5148 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5149 |
" |
8551 | 5150 |
Object revisionString |
5151 |
Object revisionInfo |
|
5152 |
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
|
5153 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5154 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
5155 |
"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
|
5156 |
"Modified: / 26-03-1997 / 00:13:17 / stefan" |
13342 | 5157 |
"Modified: / 19-04-2011 / 13:41:24 / cg" |
5158 |
! |
|
5159 |
||
5160 |
revisionInfoOfManager:aSourceCodemanagerOrNil |
|
17160 | 5161 |
"return an object filled with revision info for a given scm manager (or the default manager, if nil) |
13342 | 5162 |
This extracts the relevant info from the revisionString. |
5163 |
The revisionInfo contains all or a subset of: |
|
17160 | 5164 |
binaryRevision - the revision upon which the binary of this class is based |
5165 |
revision - the revision upon which the class is based logically |
|
5166 |
(different, if a changed class was checked in, but not yet recompiled) |
|
5167 |
user - the user who checked in the logical revision |
|
5168 |
date - the date when the logical revision was checked in |
|
5169 |
time - the time when the logical revision was checked in |
|
5170 |
fileName - the classes source file name |
|
5171 |
repositoryPath - the classes source container |
|
13342 | 5172 |
" |
5173 |
||
5174 |
|vsnString info| |
|
5175 |
||
5176 |
aSourceCodemanagerOrNil notNil ifTrue:[ |
|
17160 | 5177 |
vsnString := self revisionStringOfManager:aSourceCodemanagerOrNil. |
13342 | 5178 |
]. |
5179 |
vsnString isNil ifTrue:[ |
|
17160 | 5180 |
"/ cg: I am not sure if this is the correct thing to do, iff the passed in scm-manager |
5181 |
"/ was not nil. It will return another manager's revision info. Please check. |
|
5182 |
vsnString := self revisionStringOfManager:nil. |
|
17161 | 5183 |
vsnString isNil ifTrue:[^ nil]. |
13342 | 5184 |
]. |
5185 |
||
5186 |
aSourceCodemanagerOrNil notNil ifTrue:[ |
|
17160 | 5187 |
info := aSourceCodemanagerOrNil revisionInfoFromString:vsnString inClass:self |
13342 | 5188 |
] ifFalse:[ |
17160 | 5189 |
info := Class revisionInfoFromString:vsnString. |
13342 | 5190 |
]. |
5191 |
info notNil ifTrue:[ |
|
17160 | 5192 |
info binaryRevision:self binaryRevision. |
13342 | 5193 |
]. |
5194 |
^ info |
|
5195 |
||
5196 |
" |
|
5197 |
Object revisionString |
|
5198 |
Object revisionInfo |
|
5199 |
Image revisionInfo |
|
5200 |
" |
|
5201 |
||
5202 |
"Modified: / 26-03-1997 / 00:13:17 / stefan" |
|
5203 |
"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
|
5204 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5205 |
|
13622 | 5206 |
revisionOfManager:aSourceCodemanagerOrNil |
5207 |
"return the revision-ID of the class which corresponds to the |
|
5208 |
scm-version-id of the source to which this class is equivalent. |
|
17160 | 5209 |
The passed in source code manager (or the default manager, if nil) is asked here. |
13622 | 5210 |
Initially, this is the same as #binaryRevision; however, once changes have |
5211 |
been checked into a source repository, the binary continues to remain based upon |
|
5212 |
the old revision, while logically, the class has the new (checked-in) revision. |
|
5213 |
To check if a source corresponds to a compiled binary, compare this |
|
5214 |
ID with the one returned by #binaryRevision." |
|
5215 |
||
5216 |
|info| |
|
5217 |
||
5218 |
info := self revisionInfoOfManager:aSourceCodemanagerOrNil. |
|
5219 |
info notNil ifTrue:[ |
|
17160 | 5220 |
^ info revision |
13622 | 5221 |
]. |
5222 |
^ nil "/ ^ self binaryRevision |
|
5223 |
||
5224 |
" |
|
5225 |
Object revision |
|
5226 |
" |
|
5227 |
||
5228 |
"Modified: / 26-03-1997 / 00:14:00 / stefan" |
|
5229 |
"Modified (comment): / 01-07-2011 / 10:57:16 / cg" |
|
5230 |
"Created: / 04-09-2011 / 11:03:34 / cg" |
|
5231 |
! |
|
5232 |
||
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
|
5233 |
revisionString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
5234 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
5235 |
|
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
|
5236 |
"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
|
5237 |
classes #version method. Either this is a method returning that string, |
12014 | 5238 |
or it's a comment-only method and the comment defines the version. |
19119 | 5239 |
If the receiver is unloaded, or the source is not accessible, |
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
5240 |
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
|
5241 |
|
13342 | 5242 |
^ self revisionStringOfManager:nil |
5243 |
||
5244 |
" |
|
5245 |
Smalltalk allClassesDo:[:cls | |
|
19119 | 5246 |
Transcript show:cls name; show:' -> '; showCR:cls revisionString |
13342 | 5247 |
]. |
5248 |
||
5249 |
Number revisionString |
|
5250 |
FileDirectory revisionString |
|
5251 |
Metaclass revisionString |
|
5252 |
" |
|
5253 |
||
5254 |
"Created: / 29-10-1995 / 19:28:03 / cg" |
|
5255 |
"Modified: / 01-04-1997 / 23:37:25 / stefan" |
|
5256 |
"Modified: / 07-02-2001 / 18:03:39 / ps" |
|
5257 |
"Modified: / 19-04-2011 / 13:38:07 / cg" |
|
5258 |
! |
|
5259 |
||
5260 |
revisionStringOfManager:aSourceCodeManagerOrNil |
|
5261 |
"{ Pragma: +optSpace }" |
|
5262 |
||
5263 |
"return my revision string; that one is extracted from the |
|
5264 |
classes #version method. Either this is a method returning that string, |
|
5265 |
or it's a comment-only method and the comment defines the version. |
|
19109 | 5266 |
If the receiver is unloaded, or the source is not accessible, |
13342 | 5267 |
or no such method exists, then nil is returned." |
5268 |
||
12103 | 5269 |
|owner versionMethod| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
5270 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
5271 |
(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
|
5272 |
|
13342 | 5273 |
versionMethod := self findVersionMethodOfManager:aSourceCodeManagerOrNil. |
12103 | 5274 |
versionMethod notNil ifTrue:[ |
19109 | 5275 |
^ 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
|
5276 |
]. |
12014 | 5277 |
^ 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
|
5278 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5279 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5280 |
Smalltalk allClassesDo:[:cls | |
19109 | 5281 |
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
|
5282 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5283 |
|
8551 | 5284 |
Number revisionString |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
5285 |
FileDirectory revisionString |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
5286 |
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
|
5287 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5288 |
|
11277
8a3339bf1d7f
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
11261
diff
changeset
|
5289 |
"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
|
5290 |
"Modified: / 07-02-2001 / 18:03:39 / ps" |
13342 | 5291 |
"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
|
5292 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5293 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5294 |
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
|
5295 |
"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
|
5296 |
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
|
5297 |
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
|
5298 |
(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
|
5299 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5300 |
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
|
5301 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5302 |
"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
|
5303 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5304 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5305 |
setPackageFromRevision |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
5306 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
5307 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5308 |
"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
|
5309 |
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
|
5310 |
(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
|
5311 |
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
|
5312 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5313 |
|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
|
5314 |
|
1756 | 5315 |
self owningClass notNil ifTrue:[^ self]. |
5316 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5317 |
mgr := self sourceCodeManager. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5318 |
mgr notNil ifTrue:[ |
13756 | 5319 |
info := mgr sourceInfoOfClass:self. |
5320 |
||
5321 |
info notNil ifTrue:[ |
|
5322 |
mod := info at:#module ifAbsent:nil. "/ stx, aeg, <your-organization> |
|
5323 |
dir := info at:#directory ifAbsent:nil. "/ libbasic, libtool ... |
|
5324 |
lib := info at:#library ifAbsent:dir. |
|
5325 |
||
5326 |
p := ''. |
|
5327 |
mod notNil ifTrue:[ |
|
4012
e87e53bc45a6
when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents:
3997
diff
changeset
|
5328 |
"/ mod ~= 'stx' ifTrue:[ |
13756 | 5329 |
p := p , mod |
4012
e87e53bc45a6
when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents:
3997
diff
changeset
|
5330 |
"/ ] |
13756 | 5331 |
]. |
5332 |
dir notNil ifTrue:[ |
|
5333 |
p notEmpty ifTrue:[p := p , ':']. |
|
5334 |
p := p , dir. |
|
5335 |
] ifFalse:[ |
|
5336 |
lib notNil ifTrue:[ |
|
5337 |
p notEmpty ifTrue:[p := p , ':']. |
|
5338 |
p := p , lib. |
|
5339 |
]. |
|
5340 |
]. |
|
5341 |
(p notEmpty and:[p ~= package]) ifTrue:[ |
|
2072
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
5342 |
"/ package notNil ifTrue:[ |
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
5343 |
"/ (name , ': changing packageID from ''' , package , ''' to ''' , p , '''') infoPrintCR. |
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
5344 |
"/ ]. |
13756 | 5345 |
package := p. |
5346 |
||
5347 |
self methodDictionary do:[:aMethod | |
|
5348 |
aMethod package isNil ifTrue:[ |
|
5349 |
aMethod setPackage:p |
|
5350 |
] |
|
5351 |
] |
|
5352 |
]. |
|
5353 |
]. |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5354 |
]. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5355 |
^ self |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5356 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5357 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5358 |
MemoryMonitor autoload. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5359 |
MemoryMonitor setPackageFromRevision |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5360 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5361 |
|
9839 | 5362 |
"Modified: / 12-06-1996 / 11:49:31 / stefan" |
5363 |
"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
|
5364 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5365 |
|
8230 | 5366 |
sourceFileSuffix |
5367 |
^ self class sourceFileSuffix |
|
5368 |
! |
|
5369 |
||
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
|
5370 |
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
|
5371 |
"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
|
5372 |
|
11429 | 5373 |
|owner source stream| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
5374 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
5375 |
(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
|
5376 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5377 |
classFilename notNil ifTrue:[ |
13756 | 5378 |
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
|
5379 |
] ifFalse:[ |
13756 | 5380 |
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
|
5381 |
]. |
8149 | 5382 |
stream := self sourceStreamFor:source. |
5383 |
stream notNil ifTrue:[ |
|
13756 | 5384 |
"/ see if its utf8 encoded... |
5385 |
stream := EncodedStream decodedStreamFor:stream. |
|
8149 | 5386 |
]. |
5387 |
^ stream. |
|
953
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
5388 |
! |
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
5389 |
|
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
5390 |
sourceStreamFor:source |
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
5391 |
"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
|
5392 |
|
12509
0a69e1d87ba3
comment/format in: #validateSourceStream:
Claus Gittinger <cg@exept.de>
parents:
12507
diff
changeset
|
5393 |
|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
|
5394 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
5395 |
(owner := self owningClass) notNil ifTrue:[^ owner sourceStreamFor:source]. |
1909 | 5396 |
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
|
5397 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5398 |
"/ |
8551 | 5399 |
"/ if there is no SourceCodeManager, |
892
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
5400 |
"/ or TryLocalSourceFirst is true, |
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
5401 |
"/ 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
|
5402 |
"/ |
15947 | 5403 |
"JV@2011-12-08: |
5404 |
(i) first check TryLocalSourceFirst, this avoids useless call to |
|
5405 |
#sourceCodeManagerFromBinaryRevision when TryLocalSourceFirst is |
|
5406 |
set (for whatever reason) |
|
5407 |
(ii) do NOT ask source code manager during system startup - source code |
|
5408 |
managers are not configured anyway!! Also, avoids hangups during |
|
5409 |
startup when CVSROOT is set but server is unreacheable. |
|
5410 |
CAVEAT: When somebody modifies the code after compilation and methods |
|
5411 |
are recompiled during startup (for whatever reason), a bad code may |
|
5412 |
used, compilation may fail. However, it may happen anyway as SCM's |
|
5413 |
are not yet configured so the system may use wrong one. Moreover, |
|
5414 |
the source from which the class is compiled may not be the one in |
|
5415 |
repository. I (JV) think this is a good, less confusing compromise. |
|
5416 |
" |
|
5417 |
(TryLocalSourceFirst == true |
|
5418 |
or:[Smalltalk isInitialized not |
|
5419 |
or: [(sourceCodeManager := self sourceCodeManagerFromBinaryRevision) isNil]]) |
|
5420 |
ifTrue:[ |
|
5421 |
sourceStream := self localSourceStreamFor:source. |
|
5422 |
]. |
|
5423 |
||
5424 |
sourceStream isNil ifTrue:[ |
|
5425 |
"/ mhmh - still no source file. |
|
5426 |
"/ If there is a SourceCodeManager, ask it to aquire the |
|
5427 |
"/ the source for my class, and return an open stream on it. |
|
5428 |
"/ if that one does not know about the source, look in |
|
5429 |
"/ standard places |
|
5430 |
||
5431 |
sourceCodeManager notNil ifTrue:[ |
|
5432 |
classFilename ~= source ifTrue:[ |
|
5433 |
package notNil ifTrue:[ |
|
5434 |
sep := package indexOfAny:'/\:'. |
|
5435 |
sep ~~ 0 ifTrue:[ |
|
5436 |
mod := package copyTo:sep - 1. |
|
5437 |
dir := package copyFrom:sep + 1. |
|
5438 |
sourceStream := sourceCodeManager streamForClass:nil fileName:source revision:(self binaryRevision) directory:dir module:mod cache:true. |
|
5439 |
] |
|
5440 |
]. |
|
5441 |
]. |
|
5442 |
sourceStream isNil ifTrue:[ |
|
5443 |
classFilename isNil ifTrue:[ |
|
5444 |
guessedFileName := (Smalltalk fileNameForClass:self) , '.st'. |
|
5445 |
]. |
|
5446 |
source asFilename baseName = (classFilename ? guessedFileName) asFilename baseName ifTrue:[ |
|
5447 |
sourceStream := sourceCodeManager getSourceStreamFor:self. |
|
5448 |
] |
|
5449 |
]. |
|
5450 |
sourceStream notNil ifTrue:[ |
|
5451 |
(self validateSourceStream:sourceStream) ifFalse:[ |
|
5452 |
('Class [info]: repositories source for "%1" is invalid.' bindWith:self theNonMetaclass name) errorPrintCR. |
|
5453 |
sourceStream close. |
|
5454 |
sourceStream := nil |
|
5455 |
] ifTrue:[ |
|
5456 |
validated := true. |
|
5457 |
]. |
|
5458 |
]. |
|
5459 |
] |
|
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
|
5460 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5461 |
|
12014 | 5462 |
sourceStream isNil ifTrue:[ |
15947 | 5463 |
"/ |
5464 |
"/ hard case - there is no source file for this class |
|
5465 |
"/ (in the source-dir-path). |
|
5466 |
"/ |
|
5467 |
||
5468 |
"/ |
|
5469 |
"/ look if my binary is from a dynamically loaded module, |
|
5470 |
"/ and, if so, look in the modules directory for the |
|
5471 |
"/ source file. |
|
5472 |
"/ |
|
5473 |
ObjectFileLoader notNil ifTrue:[ |
|
5474 |
ObjectFileLoader loadedObjectHandlesDo:[:h | |
|
5475 |
|f classes| |
|
5476 |
||
5477 |
sourceStream isNil ifTrue:[ |
|
5478 |
(classes := h classes) notEmptyOrNil ifTrue:[ |
|
5479 |
(classes includes:self) ifTrue:[ |
|
5480 |
f := h pathName. |
|
5481 |
f := f asFilename directory. |
|
5482 |
f := f construct:source. |
|
5483 |
f exists ifTrue:[ |
|
5484 |
sourceStream := f readStreamOrNil. |
|
5485 |
]. |
|
5486 |
]. |
|
5487 |
]. |
|
5488 |
] |
|
5489 |
]. |
|
5490 |
]. |
|
5116
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5491 |
]. |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5492 |
|
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5493 |
"/ |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5494 |
"/ try along sourcePath |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5495 |
"/ |
12014 | 5496 |
sourceStream isNil ifTrue:[ |
15947 | 5497 |
sourceStream := self localSourceStreamFor:source. |
5116
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5498 |
]. |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5499 |
|
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5500 |
"/ |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5501 |
"/ final chance: try current directory |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
5502 |
"/ |
12014 | 5503 |
sourceStream isNil ifTrue:[ |
15947 | 5504 |
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
|
5505 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5506 |
|
12014 | 5507 |
(sourceStream notNil and:[validated not]) ifTrue:[ |
15947 | 5508 |
(self validateSourceStream:sourceStream) ifFalse:[ |
5509 |
('Class [warning]: source for "%1" is invalid or stripped. Take care.' bindWith:self theNonMetaclass name) errorPrintCR. |
|
5510 |
sourceStream close. |
|
5511 |
sourceStream := nil |
|
5512 |
]. |
|
1909 | 5513 |
]. |
12014 | 5514 |
"/ (sourceStream notNil and:[sourceStream isFileStream]) ifTrue:[ |
9610 | 5515 |
"/ guessedFileName notNil ifTrue:[ |
5516 |
"/ self setClassFilename:(aStream pathName asFilename baseName). |
|
5517 |
"/ ] |
|
12014 | 5518 |
"/ ]. |
5519 |
^ 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
|
5520 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5521 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5522 |
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
|
5523 |
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
|
5524 |
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
|
5525 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5526 |
|
15947 | 5527 |
"Created: / 10-11-1995 / 21:05:13 / cg" |
5528 |
"Modified: / 22-04-1998 / 19:20:50 / ca" |
|
5529 |
"Modified: / 05-11-2001 / 16:36:30 / cg" |
|
5530 |
"Modified: / 08-12-2011 / 19:16:23 / Jan Vrany <jan.vrany@fit.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
|
5531 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5532 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5533 |
updateVersionMethodFor:newRevisionString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
5534 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
5535 |
|
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
|
5536 |
"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
|
5537 |
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
|
5538 |
|
12044 | 5539 |
"/ for backward compatibility - however, please change callers... |
5540 |
^ 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
|
5541 |
! |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5542 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5543 |
validateSourceStream:aStream |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5544 |
"check if aStream really contains my source. |
12509
0a69e1d87ba3
comment/format in: #validateSourceStream:
Claus Gittinger <cg@exept.de>
parents:
12507
diff
changeset
|
5545 |
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
|
5546 |
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
|
5547 |
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
|
5548 |
|
19154
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
5549 |
|cls cannotCheckReason versionMethod info |
12103 | 5550 |
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
|
5551 |
|
13755 | 5552 |
ValidateSourceOnlyOnce == true ifTrue:[ |
15610 | 5553 |
ValidatedClasses notNil ifTrue:[ |
5554 |
(ValidatedClasses includes:self) ifTrue:[ |
|
5555 |
Transcript showCR:'trust validated'. |
|
5556 |
^ true |
|
5557 |
]. |
|
5558 |
] ifFalse:[ |
|
5559 |
ValidatedClasses := WeakIdentitySet new. |
|
5560 |
]. |
|
13755 | 5561 |
]. |
5562 |
||
6150
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
5563 |
cls := self theNonMetaclass. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5564 |
|
1766 | 5565 |
cannotCheckReason := nil. |
12103 | 5566 |
|
19154
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
5567 |
(cls sourceChecksumFromBinaryRevision) = (cls sourceChecksumFromStream: aStream) ifTrue:[ |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
5568 |
^ true. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
5569 |
]. |
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
5570 |
|
12103 | 5571 |
versionMethod := self findVersionMethod. |
5572 |
versionMethod isNil ifTrue:[ |
|
15610 | 5573 |
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
|
5574 |
] ifFalse:[ |
15610 | 5575 |
"/ |
5576 |
"/ if its a method returning the string, |
|
5577 |
"/ thats the returned value |
|
5578 |
"/ |
|
5579 |
versionFromCode := versionMethod valueWithReceiver:cls arguments:#(). |
|
5580 |
versionFromCode isString ifFalse:[ |
|
5581 |
cannotCheckReason := 'version method does not return a string' |
|
5582 |
]. |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5583 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5584 |
|
1942 | 5585 |
versionMethod notNil ifTrue:[ |
15610 | 5586 |
pos := versionMethod sourcePosition. |
5587 |
pos isInteger ifFalse:[ |
|
5588 |
"/ mhmh - either no version method, |
|
5589 |
"/ or updated due to a checkin. |
|
5590 |
"/ in any case, this should be a good source. |
|
5591 |
||
5592 |
^ true. |
|
5593 |
"/ cannotCheckReason := 'no source position for version-method' |
|
5594 |
] |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5595 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5596 |
|
1766 | 5597 |
cannotCheckReason notNil ifTrue:[ |
15610 | 5598 |
('Class [warning]: ' , cannotCheckReason , ' in ' , self name) infoPrintCR. |
5599 |
'Class [info]: cannot validate source; trusting source' infoPrintCR. |
|
5600 |
^ true |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5601 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5602 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5603 |
oldPos := aStream position. |
3371
1d8aa07c4b7f
care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents:
3365
diff
changeset
|
5604 |
Stream positionErrorSignal handle:[:ex | |
15610 | 5605 |
'Class [info]: position error when accessing source' infoPrintCR. |
5606 |
^ false |
|
3371
1d8aa07c4b7f
care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents:
3365
diff
changeset
|
5607 |
] do:[ |
15610 | 5608 |
aStream position:pos-1. |
3371
1d8aa07c4b7f
care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents:
3365
diff
changeset
|
5609 |
]. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5610 |
src := aStream nextChunk. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5611 |
aStream position:oldPos. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5612 |
|
9063
953b305e35d6
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
8952
diff
changeset
|
5613 |
(src isEmptyOrNil) ifTrue:[ |
15610 | 5614 |
'Class [info]: empty source for version-method' infoPrintCR. |
5615 |
^ false |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5616 |
]. |
13755 | 5617 |
(src startsWith:'version') ifFalse:[ |
15610 | 5618 |
'Class [info]: corrupted source (source does not correspond to binary)' infoPrintCR. |
5619 |
^ false |
|
13755 | 5620 |
]. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5621 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5622 |
versionFromSource := Class revisionStringFromSource:src. |
13755 | 5623 |
versionFromSource = versionFromCode ifTrue:[ |
15610 | 5624 |
ValidatedClasses notNil ifTrue:[ ValidatedClasses add:self ]. |
5625 |
^ true |
|
13755 | 5626 |
]. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5627 |
|
4784 | 5628 |
versionFromSource isNil ifTrue:[ |
15610 | 5629 |
'Class [info]: version-from source is nil' infoPrintCR. |
5630 |
^ false |
|
4784 | 5631 |
]. |
1786 | 5632 |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5633 |
"/ mhmh - check my binary version ... |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5634 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5635 |
info := Class revisionInfoFromString:versionFromSource. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5636 |
info notNil ifTrue:[ |
15610 | 5637 |
rev := info at:#revision. |
5638 |
rev = self binaryRevision ifTrue:[ |
|
5639 |
ValidatedClasses notNil ifTrue:[ ValidatedClasses add:self ]. |
|
5640 |
^ true |
|
5641 |
]. |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5642 |
]. |
4784 | 5643 |
'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
|
5644 |
^ false |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
5645 |
|
13755 | 5646 |
"Modified: / 29-09-2011 / 14:29:55 / cg" |
19154
e602376b6797
Use SHA1 checksums to validate source file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19127
diff
changeset
|
5647 |
"Modified: / 26-01-2016 / 12:32:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
12015 | 5648 |
! |
5649 |
||
5650 |
versionMethodTemplateForSourceCodeManager:aSourceCodeManager |
|
5651 |
||
5652 |
^self class versionMethodTemplateForSourceCodeManager:aSourceCodeManager |
|
5653 |
||
5654 |
"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
|
5655 |
! ! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
5656 |
|
13860 | 5657 |
!Class::ArrayWithSequenceNumberValidation methodsFor:'accessing'! |
5658 |
||
5659 |
sequenceNumber |
|
5660 |
^ sequenceNumber |
|
5661 |
! |
|
5662 |
||
5663 |
sequenceNumber:something |
|
5664 |
sequenceNumber := something. |
|
5665 |
! ! |
|
5666 |
||
5667 |
!Class::ArrayWithSequenceNumberValidation methodsFor:'checking'! |
|
5668 |
||
5669 |
checkIfValidFor:aSequenceNumber |
|
5670 |
^ aSequenceNumber ~= sequenceNumber |
|
5671 |
||
5672 |
"Created: / 06-12-2011 / 16:01:16 / cg" |
|
5673 |
! ! |
|
5674 |
||
12020 | 5675 |
!Class::ClassAttributes class methodsFor:'documentation'! |
5676 |
||
5677 |
documentation |
|
5678 |
" |
|
5679 |
Instances hold additional attributes of a class. |
|
5680 |
Currently, these are primitive definitions and sharedPools information. |
|
5681 |
As these are seldom needed, they are only present as object in some classes |
|
5682 |
thus saving us from mostly empty additional slots in the class object itself for most classes |
|
5683 |
" |
|
5684 |
! ! |
|
5685 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5686 |
!Class::ClassAttributes methodsFor:'accessing'! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5687 |
|
13716 | 5688 |
fGuid |
5689 |
^ fGuid |
|
5690 |
||
5691 |
"Created: / 23-09-2011 / 10:28:25 / cg" |
|
5692 |
! |
|
5693 |
||
5694 |
fGuid:something |
|
5695 |
fGuid := something. |
|
5696 |
||
5697 |
"Created: / 23-09-2011 / 10:28:28 / cg" |
|
5698 |
! |
|
5699 |
||
12259 | 5700 |
localSelectors |
5701 |
^ localSelectors |
|
5702 |
! |
|
5703 |
||
5704 |
localSelectors:something |
|
5705 |
localSelectors := something. |
|
5706 |
! |
|
5707 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5708 |
primitiveDefinitions |
7463 | 5709 |
^ primitiveDefinitions |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5710 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5711 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5712 |
primitiveDefinitions:something |
7463 | 5713 |
primitiveDefinitions := something. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5714 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5715 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5716 |
primitiveFunctions |
7463 | 5717 |
^ primitiveFunctions |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5718 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5719 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5720 |
primitiveFunctions:something |
7463 | 5721 |
primitiveFunctions := something. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5722 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5723 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5724 |
primitiveVariables |
7463 | 5725 |
^ primitiveVariables |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5726 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5727 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5728 |
primitiveVariables:something |
7463 | 5729 |
primitiveVariables := something. |
8551 | 5730 |
! |
5731 |
||
14579
177a885c9a92
added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents:
14572
diff
changeset
|
5732 |
projectDirectory |
177a885c9a92
added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents:
14572
diff
changeset
|
5733 |
^ projectDirectory |
177a885c9a92
added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents:
14572
diff
changeset
|
5734 |
! |
177a885c9a92
added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents:
14572
diff
changeset
|
5735 |
|
177a885c9a92
added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents:
14572
diff
changeset
|
5736 |
projectDirectory:something |
177a885c9a92
added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents:
14572
diff
changeset
|
5737 |
projectDirectory := something. |
177a885c9a92
added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents:
14572
diff
changeset
|
5738 |
! |
177a885c9a92
added a projectDirectory attribute (for use by ProjectDefinitions)
Claus Gittinger <cg@exept.de>
parents:
14572
diff
changeset
|
5739 |
|
8551 | 5740 |
sharedPools |
5741 |
^ sharedPools |
|
5742 |
! |
|
5743 |
||
5744 |
sharedPools:something |
|
5745 |
sharedPools := something. |
|
12259 | 5746 |
! |
5747 |
||
5748 |
traitComposition |
|
5749 |
^ traitComposition |
|
5750 |
! |
|
5751 |
||
5752 |
traitComposition:something |
|
5753 |
traitComposition := something. |
|
13715 | 5754 |
! |
5755 |
||
13716 | 5756 |
vGuid |
5757 |
^ vGuid |
|
5758 |
||
5759 |
"Created: / 23-09-2011 / 10:28:41 / cg" |
|
5760 |
! |
|
5761 |
||
5762 |
vGuid:something |
|
5763 |
vGuid := something. |
|
5764 |
||
5765 |
"Created: / 23-09-2011 / 10:28:34 / cg" |
|
5766 |
! |
|
5767 |
||
13715 | 5768 |
valueFor:aKey |
5769 |
^ self perform:aKey asSymbol |
|
5770 |
||
5771 |
"Created: / 23-09-2011 / 10:23:26 / cg" |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5772 |
! ! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5773 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5774 |
!Class::ClassAttributes methodsFor:'conversion'! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5775 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5776 |
fromSTCPrimitiveArray:anArray |
8551 | 5777 |
"for now, the stc compiler generates a 3- or 4-element primitive spec array |
5778 |
(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
|
5779 |
This method is invoked to convert." |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5780 |
|
7463 | 5781 |
primitiveDefinitions := anArray at:1. |
5782 |
primitiveVariables := anArray at:2. |
|
5783 |
primitiveFunctions := anArray at:3. |
|
8551 | 5784 |
anArray size > 3 ifTrue:[ |
13756 | 5785 |
sharedPools := anArray at:4. |
8551 | 5786 |
]. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5787 |
! ! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5788 |
|
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5789 |
!Class::SimulatedClassPool class methodsFor:'documentation'! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5790 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5791 |
documentation |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5792 |
" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5793 |
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
|
5794 |
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
|
5795 |
with the className as prefix (colon-separated). |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5796 |
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
|
5797 |
in a similar fashion to globals. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5798 |
|
17045 | 5799 |
Whenever a classes classPool is requested (by code imported from visualworks), |
5800 |
an instance of myself is created, which forwards at: and at:put: messages |
|
5801 |
to the original class. |
|
5802 |
Notice that classPools are never asked for by smalltalk/x |
|
5803 |
code - especially not by the browser. However, imported code (like the refactory browser) |
|
5804 |
may do so. |
|
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5805 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5806 |
This is an additional goody class; therefore: |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5807 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5808 |
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
|
5809 |
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
|
5810 |
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
|
5811 |
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
|
5812 |
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
|
5813 |
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
|
5814 |
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
|
5815 |
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
|
5816 |
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
|
5817 |
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
|
5818 |
SUCH DAMAGE. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5819 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5820 |
[author:] |
17045 | 5821 |
Claus Gittinger |
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5822 |
" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5823 |
! ! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5824 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5825 |
!Class::SimulatedClassPool methodsFor:'accessing'! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5826 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5827 |
associationAt:aName |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5828 |
"simulate an association" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5829 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5830 |
^ SimulatedVariableBinding key:aName value:(class classVarAt:aName) |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5831 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5832 |
"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
|
5833 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5834 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5835 |
associationAt:aName ifAbsent:exceptionBlock |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5836 |
"simulate an association" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5837 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5838 |
|internalName cls| |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5839 |
|
13756 | 5840 |
cls := class theNonMetaclass. |
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5841 |
internalName := (cls name , ':' , aName) asSymbol. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5842 |
^ SimulatedVariableBinding key:internalName value:(cls classVarAt:aName) |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5843 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5844 |
"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
|
5845 |
"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
|
5846 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5847 |
|
13680 | 5848 |
associations |
5849 |
|assocs| |
|
5850 |
||
5851 |
assocs := OrderedCollection new. |
|
5852 |
self associationsDo:[:eachAssoc | |
|
13756 | 5853 |
assocs add:eachAssoc |
13680 | 5854 |
]. |
5855 |
^ assocs |
|
5856 |
||
5857 |
"Created: / 12-09-2011 / 10:15:11 / cg" |
|
5858 |
! |
|
5859 |
||
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5860 |
associationsDo:aBlock |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5861 |
"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
|
5862 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5863 |
class classVarNames do:[:eachName | |
13756 | 5864 |
aBlock value:(self associationAt:eachName) |
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5865 |
]. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5866 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5867 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5868 |
at:aKey |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5869 |
^ class classVarAt:aKey |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5870 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5871 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5872 |
at:aKey ifAbsent:exceptionBlock |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5873 |
^ class classVarAt:aKey ifAbsent:exceptionBlock |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5874 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5875 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5876 |
at:aKey put:something |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5877 |
^ class classVarAt:aKey put:something |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5878 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5879 |
|
13680 | 5880 |
bindingOf:aKey |
5881 |
^ self associationAt:aKey |
|
5882 |
||
5883 |
"Created: / 12-09-2011 / 09:41:18 / cg" |
|
5884 |
! |
|
5885 |
||
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5886 |
keys |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5887 |
^ class classVarNames collect:[:nm | nm asSymbol] |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5888 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5889 |
" |
13756 | 5890 |
Button classPool keys |
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5891 |
Button classPool at:#ReturnForm |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5892 |
" |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5893 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5894 |
! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5895 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5896 |
keysAndValuesDo:aBlock |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5897 |
"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
|
5898 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5899 |
class classVarNames do:[:eachName | |
13756 | 5900 |
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
|
5901 |
]. |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5902 |
! ! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5903 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5904 |
!Class::SimulatedClassPool methodsFor:'accessing-private'! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5905 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5906 |
setClass:aClass |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5907 |
class := aClass |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5908 |
! ! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5909 |
|
12020 | 5910 |
!Class::SimulatedClassPool::SimulatedVariableBinding class methodsFor:'documentation'! |
5911 |
||
5912 |
documentation |
|
5913 |
" |
|
5914 |
Instances are returned from the simulated classPool for VW compatibility. |
|
17045 | 5915 |
See the documentation in SimulatedClassPool for more info. |
12020 | 5916 |
" |
5917 |
! ! |
|
5918 |
||
8605
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5919 |
!Class::SimulatedClassPool::SimulatedVariableBinding methodsFor:'queries'! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5920 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5921 |
isVariableBinding |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5922 |
^ true |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5923 |
|
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5924 |
"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
|
5925 |
! ! |
12e3a0f16d76
Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents:
8561
diff
changeset
|
5926 |
|
1739 | 5927 |
!Class class methodsFor:'documentation'! |
662 | 5928 |
|
13508
59531dc7d4e8
changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents:
13507
diff
changeset
|
5929 |
version |
18559 | 5930 |
^ '$Header$' |
13508
59531dc7d4e8
changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents:
13507
diff
changeset
|
5931 |
! |
59531dc7d4e8
changed: #fileOutOn:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents:
13507
diff
changeset
|
5932 |
|
12044 | 5933 |
version_CVS |
18559 | 5934 |
^ '$Header$' |
13418 | 5935 |
! |
5936 |
||
18646
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
5937 |
version_HG |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
5938 |
|
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
5939 |
^ '$Changeset: <not expanded> $' |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
5940 |
! |
9779b1210b8c
Added more Squeak/Pharo compatibilty methods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
18608
diff
changeset
|
5941 |
|
13418 | 5942 |
version_SVN |
15258 | 5943 |
^ '$ 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
|
5944 |
! ! |
14929 | 5945 |