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