author | Stefan Vogel <sv@exept.de> |
Fri, 20 Jun 2003 09:32:25 +0200 | |
changeset 7435 | c5afb1b0fd1b |
parent 7371 | e6fccc3b935c |
child 7463 | 3d74f00e444b |
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 |
7368 | 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 |
" |
|
12 |
||
5340
cdc42cba8f01
add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents:
5296
diff
changeset
|
13 |
"{ Package: 'stx:libbasic' }" |
cdc42cba8f01
add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents:
5296
diff
changeset
|
14 |
|
719
c557a530f971
dont appending a chunk-separator to the initial copyright
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
15 |
ClassDescription subclass:#Class |
5849
4cc89ecfbbda
prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents:
5801
diff
changeset
|
16 |
instanceVariableNames:'name category classvars comment subclasses classFilename package |
7371
e6fccc3b935c
kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents:
7369
diff
changeset
|
17 |
revision environment signature attributes' |
6823 | 18 |
classVariableNames:'DefaultCategoryForSTV DefaultCategoryForVAGE |
19 |
DefaultCategoryForDolphin' |
|
5849
4cc89ecfbbda
prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents:
5801
diff
changeset
|
20 |
poolDictionaries:'' |
4cc89ecfbbda
prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents:
5801
diff
changeset
|
21 |
category:'Kernel-Classes' |
1 | 22 |
! |
23 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
24 |
Object subclass:#ClassAttributes |
7371
e6fccc3b935c
kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents:
7369
diff
changeset
|
25 |
instanceVariableNames:'primDefinitions primVariables primFunctions' |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
26 |
classVariableNames:'' |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
27 |
poolDictionaries:'' |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
28 |
privateIn:Class |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
29 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
30 |
|
1739 | 31 |
!Class class methodsFor:'documentation'! |
68 | 32 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
33 |
copyright |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
34 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
35 |
COPYRIGHT (c) 1989 by Claus Gittinger |
7368 | 36 |
All Rights Reserved |
527
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
37 |
|
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
38 |
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
|
39 |
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
|
40 |
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
|
41 |
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
|
42 |
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
|
43 |
hereby transferred. |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
44 |
" |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
45 |
! |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
46 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
47 |
documentation |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
48 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
49 |
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
|
50 |
been defined in Behavior and ClassDescription; this adds naming, categories etc. |
68 | 51 |
|
1287 | 52 |
[Instance variables:] |
53 |
||
7368 | 54 |
name <Symbol> the classes name |
55 |
||
56 |
category <Symbol> the classes category |
|
57 |
||
58 |
classvars <String> the names of the class variables |
|
59 |
||
60 |
comment <String> the classes comment; either a string, |
|
61 |
a number specifying the offset in classFilename, or nil |
|
62 |
||
63 |
subclasses <Collection> cached collection of subclasses |
|
64 |
(currently unused - but will be soon) |
|
65 |
||
66 |
classFilename <String> the file (or nil) where the classes |
|
67 |
sources are found |
|
68 |
||
69 |
package <Symbol> the package, in which the class was defined |
|
70 |
(inserted by compilers) |
|
71 |
||
72 |
revision <String> revision string - inserted by stc |
|
73 |
||
74 |
environment <Symbol | nil> cached environment (i.e. Smalltalk or a namespace) |
|
75 |
||
76 |
signature <SmallInteger> the classes signature (used to detect obsolete |
|
77 |
or changed classes with binaryStorage) |
|
78 |
This is filled in lazy - i.e. upon the first signature query. |
|
79 |
||
7371
e6fccc3b935c
kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents:
7369
diff
changeset
|
80 |
attributes <Array | nil> describes primitiveIncludes, primitiveFunctions etc. |
e6fccc3b935c
kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents:
7369
diff
changeset
|
81 |
also a place to add additional attributes, |
7368 | 82 |
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
|
83 |
|
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
84 |
|
68 | 85 |
WARNING: layout known by compiler and runtime system |
1287 | 86 |
|
87 |
[author:] |
|
7368 | 88 |
Claus Gittinger |
1669 | 89 |
|
90 |
[see also:] |
|
7368 | 91 |
Behavior ClassDescription Metaclass |
68 | 92 |
" |
662 | 93 |
! ! |
68 | 94 |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
95 |
!Class class methodsFor:'accessing-flags'! |
362 | 96 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
97 |
tryLocalSourceFirst |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
98 |
^ TryLocalSourceFirst |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
99 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
100 |
"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
|
101 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
102 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
103 |
tryLocalSourceFirst:aBoolean |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
104 |
TryLocalSourceFirst := aBoolean |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
105 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
106 |
"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
|
107 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
108 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
109 |
updateChanges:aBoolean |
858 | 110 |
"turn on/off changes management. Return the prior value of the flag. |
111 |
This value is used as a default fallback - a querySignal handler may still |
|
112 |
decide to return something else." |
|
362 | 113 |
|
114 |
|prev| |
|
115 |
||
555 | 116 |
prev := UpdatingChanges. |
117 |
UpdatingChanges := aBoolean. |
|
362 | 118 |
^ prev |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
119 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
120 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
121 |
updatingChanges |
858 | 122 |
"return true if changes are recorded. |
123 |
The value returned here is the default fallback - a querySignal handler may still |
|
124 |
decide to return something else." |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
125 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
126 |
^ UpdatingChanges |
1 | 127 |
! ! |
128 |
||
1739 | 129 |
!Class class methodsFor:'helpers'! |
620 | 130 |
|
131 |
revisionInfoFromString:aString |
|
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
132 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
133 |
|
620 | 134 |
"return a dictionary filled with revision info. |
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
135 |
This extracts the relevant info from aString, asking |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
136 |
the sourceCode manager (if there is one)" |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
137 |
|
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
138 |
" |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
139 |
For now, this is a bad design - since the sourceCodeManager |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
140 |
is not always delivered, here, a fallBack is provided. |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
141 |
(should probably deliver some RCS-header extractor in any case, |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
142 |
even if no AbstractSourceCodeManager is present) |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
143 |
(knowing about the details of RCS headers here is a bad design ...) |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
144 |
" |
620 | 145 |
|
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
146 |
|words info nm mgr| |
620 | 147 |
|
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
148 |
"/ |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
149 |
"/ mhmh - ask the default manager |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
150 |
"/ |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
151 |
(mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[ |
7368 | 152 |
info := mgr revisionInfoFromString:aString. |
153 |
info notNil ifTrue:[ |
|
154 |
^ info |
|
155 |
] |
|
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
156 |
]. |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
157 |
|
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
158 |
"/ |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
159 |
"/ fallBack - handles some RCS headers only |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
160 |
"/ is this really needed ? |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
161 |
"/ |
620 | 162 |
info := IdentityDictionary new. |
163 |
words := aString asCollectionOfWords. |
|
164 |
||
744
db7b733455b9
dont crash with bad revision strings (again)
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
165 |
words notEmpty ifTrue:[ |
7368 | 166 |
"/ |
167 |
"/ supported formats: |
|
168 |
"/ |
|
169 |
"/ $-Header: pathName rev date time user state $ |
|
170 |
"/ $-Revision: rev $ |
|
171 |
"/ $-Id: fileName rev date time user state $ |
|
172 |
"/ |
|
173 |
||
174 |
((words at:1) = '$Header:') ifTrue:[ |
|
175 |
nm := words at:2. |
|
176 |
info at:#repositoryPathName put:nm. |
|
177 |
(nm endsWith:',v') ifTrue:[ |
|
178 |
nm := nm copyWithoutLast:2 |
|
179 |
]. |
|
180 |
info at:#fileName put:nm asFilename baseName. |
|
181 |
words size > 2 ifTrue:[ |
|
182 |
(words at:3) = '$' ifFalse:[ |
|
183 |
info at:#revision put:(words at:3). |
|
184 |
(words at:4) = '$' ifFalse:[ |
|
185 |
info at:#date put:(words at:4). |
|
186 |
info at:#time put:(words at:5). |
|
187 |
info at:#user put:(words at:6). |
|
188 |
info at:#state put:(words at:7). |
|
189 |
] |
|
190 |
]. |
|
191 |
]. |
|
192 |
^ info |
|
193 |
]. |
|
194 |
((words at:1) = '$Revision:') ifTrue:[ |
|
195 |
info at:#revision put:(words at:2). |
|
196 |
^ info |
|
197 |
]. |
|
198 |
((words at:1) = '$Id:') ifTrue:[ |
|
199 |
info at:#fileName put:(words at:2). |
|
200 |
info at:#revision put:(words at:3). |
|
201 |
info at:#date put:(words at:4). |
|
202 |
info at:#time put:(words at:5). |
|
203 |
info at:#user put:(words at:6). |
|
204 |
info at:#state put:(words at:7). |
|
205 |
^ info |
|
206 |
]. |
|
620 | 207 |
]. |
208 |
||
209 |
^ nil |
|
210 |
||
211 |
"Created: 15.11.1995 / 14:58:35 / cg" |
|
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
212 |
"Modified: 29.1.1997 / 19:36:31 / cg" |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
213 |
! |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
214 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
215 |
revisionStringFromSource:aMethodSourceString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
216 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
217 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
218 |
"extract a revision string from a methods source string" |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
219 |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
220 |
|lines line| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
221 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
222 |
lines := aMethodSourceString asCollectionOfLines. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
223 |
lines do:[:l | |
7368 | 224 |
|i| |
225 |
||
226 |
i := l indexOfSubCollection:'$Header: '. |
|
227 |
i ~~ 0 ifTrue:[ |
|
228 |
line := l copyFrom:i. |
|
229 |
i := line lastIndexOf:$$. |
|
230 |
i > 1 ifTrue:[ |
|
231 |
line := line copyTo:i. |
|
232 |
]. |
|
233 |
^ line |
|
234 |
] |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
235 |
]. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
236 |
^ nil |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
237 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
238 |
"Created: 15.10.1996 / 18:57:57 / cg" |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
239 |
"Modified: 16.10.1996 / 16:54:40 / cg" |
620 | 240 |
! ! |
241 |
||
3618
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
242 |
!Class class methodsFor:'misc'! |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
243 |
|
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
244 |
template:aCategoryString |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
245 |
"return a class-definition template" |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
246 |
|
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
247 |
^ 'NameOfSuperclass subclass:#NameOfClass |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
248 |
instanceVariableNames:''instVarName1 instVarName2'' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
249 |
classVariableNames:''classVarName1 classVarName2'' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
250 |
poolDictionaries:'''' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
251 |
category:''' , aCategoryString , '''' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
252 |
|
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
253 |
"Created: / 19.6.1998 / 02:09:06 / cg" |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
254 |
! ! |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
255 |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
256 |
!Class class methodsFor:'private'! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
257 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
258 |
flushSubclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
259 |
"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
|
260 |
by #subclassInfo. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
261 |
This is private protocol" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
262 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
263 |
SubclassInfo := nil. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
264 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
265 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
266 |
Class flushSubclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
267 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
268 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
269 |
"Modified: 22.1.1997 / 18:39:36 / cg" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
270 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
271 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
272 |
subclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
273 |
"build & return a dictionary, containing the set of subclass |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
274 |
for each class. This information is kept until explicitely flushed |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
275 |
by #flushSubclassInfo. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
276 |
This cache is used internally, for enumerators like #allSubclasses |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
277 |
or #allSubclassesDo:, to avoid repeated recursive walks over the class |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
278 |
hierarchy. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
279 |
This is private protocol." |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
280 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
281 |
|d| |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
282 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
283 |
SubclassInfo notNil ifTrue:[^ SubclassInfo]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
284 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
285 |
d := IdentityDictionary new. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
286 |
Smalltalk allClassesDo:[:aClass | |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
287 |
|superCls setToAddSubclass| |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
288 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
289 |
superCls := aClass superclass. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
290 |
superCls notNil ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
291 |
setToAddSubclass := d at:superCls ifAbsent:nil. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
292 |
setToAddSubclass isNil ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
293 |
d at:superCls put:(Set with:aClass). |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
294 |
] ifFalse:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
295 |
setToAddSubclass add:aClass |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
296 |
] |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
297 |
] |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
298 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
299 |
SubclassInfo := d. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
300 |
^ d |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
301 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
302 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
303 |
Class subclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
304 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
305 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
306 |
"Modified: 22.1.1997 / 18:44:59 / cg" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
307 |
! ! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
308 |
|
1739 | 309 |
!Class class methodsFor:'queries'! |
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
310 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
311 |
isBuiltInClass |
1266 | 312 |
"return true if this class is known by the run-time-system. |
313 |
Here, true is returned for myself, false for subclasses." |
|
314 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
315 |
^ self == Class class or:[self == Class] |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
316 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
317 |
"Created: 15.4.1996 / 17:17:13 / cg" |
1266 | 318 |
"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
|
319 |
! ! |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
320 |
|
7261 | 321 |
!Class methodsFor:'Compatibility-Dolphin'! |
6823 | 322 |
|
323 |
defaultCategoryForDolphinClasses |
|
324 |
^ DefaultCategoryForDolphin ? 'Dolphin classes'. |
|
325 |
! |
|
326 |
||
327 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames |
|
328 |
"{ Pragma: +optSpace }" |
|
329 |
||
330 |
"this method allows fileIn of Dolphin classes " |
|
331 |
||
332 |
^ self subclass:t |
|
7368 | 333 |
instanceVariableNames:f |
334 |
classVariableNames:d |
|
335 |
poolDictionaries:s |
|
336 |
category:(self defaultCategoryForDolphinClasses) |
|
337 |
classInstanceVariableNames:classInstanceVariableNames |
|
6823 | 338 |
|
339 |
"Modified: / 15.6.1998 / 21:31:34 / cg" |
|
340 |
"Modified: / 18.3.1999 / 18:16:11 / stefan" |
|
341 |
! |
|
342 |
||
343 |
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames |
|
344 |
"{ Pragma: +optSpace }" |
|
345 |
||
346 |
"this method allows fileIn of Dolphin classes " |
|
347 |
||
348 |
^ self variableSubclass:t |
|
7368 | 349 |
instanceVariableNames:f |
350 |
classVariableNames:d |
|
351 |
poolDictionaries:s |
|
352 |
category:(self defaultCategoryForDolphinClasses) |
|
353 |
classInstanceVariableNames:classInstanceVariableNames |
|
6823 | 354 |
|
355 |
"Modified: / 15.6.1998 / 21:31:34 / cg" |
|
356 |
"Modified: / 18.3.1999 / 18:16:11 / stefan" |
|
357 |
! ! |
|
358 |
||
7261 | 359 |
!Class methodsFor:'Compatibility-ST/V and V''Age'! |
6225 | 360 |
|
361 |
defaultCategoryForSTVorVAGEClasses |
|
362 |
|cat app| |
|
363 |
||
364 |
DefaultApplicationQuerySignal isHandled ifTrue:[ |
|
7368 | 365 |
app := DefaultApplicationQuerySignal query. |
366 |
app notNil ifTrue:[ |
|
367 |
cat := 'Applications-' , app name. |
|
368 |
] ifFalse:[ |
|
369 |
cat := DefaultCategoryForVAGE ? 'V''Age classes'. |
|
370 |
]. |
|
6225 | 371 |
] ifFalse:[ |
7368 | 372 |
cat := DefaultCategoryForSTV ? 'ST/V classes'. |
6225 | 373 |
]. |
374 |
||
375 |
^ cat |
|
376 |
! |
|
377 |
||
378 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s |
|
379 |
"{ Pragma: +optSpace }" |
|
380 |
||
381 |
"this method allows fileIn of ST/V and V'Age classes |
|
382 |
(which seem to have no category)" |
|
383 |
||
384 |
^ self subclass:t |
|
7368 | 385 |
instanceVariableNames:f |
386 |
classVariableNames:d |
|
387 |
poolDictionaries:s |
|
388 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 389 |
|
390 |
"Modified: / 15.6.1998 / 21:31:34 / cg" |
|
391 |
"Modified: / 18.3.1999 / 18:16:11 / stefan" |
|
392 |
! |
|
393 |
||
394 |
variableByteSubclass:t classVariableNames:d poolDictionaries:s |
|
395 |
"{ Pragma: +optSpace }" |
|
396 |
||
397 |
"this method allows fileIn of ST/V and V'Age variable byte classes |
|
398 |
(which seem to have no category and no instvars)" |
|
399 |
||
400 |
^ self variableByteSubclass:t |
|
7368 | 401 |
instanceVariableNames:'' |
402 |
classVariableNames:d |
|
403 |
poolDictionaries:s |
|
404 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 405 |
|
406 |
"Modified: / 15.6.1998 / 21:31:38 / cg" |
|
407 |
"Modified: / 18.3.1999 / 18:16:21 / stefan" |
|
408 |
! |
|
409 |
||
410 |
variableLongSubclass:t classVariableNames:d poolDictionaries:s |
|
411 |
"{ Pragma: +optSpace }" |
|
412 |
||
413 |
"this method allows fileIn of ST/V and V'Age variable long (32bit integers) classes |
|
414 |
(which seem to have no category and no instvars)" |
|
415 |
||
416 |
^ self variableLongSubclass:t |
|
7368 | 417 |
instanceVariableNames:'' |
418 |
classVariableNames:d |
|
419 |
poolDictionaries:s |
|
420 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 421 |
! |
422 |
||
423 |
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s |
|
424 |
"{ Pragma: +optSpace }" |
|
425 |
||
426 |
"this method allows fileIn of ST/V and V'Age variable pointer classes |
|
427 |
(which seem to have no category)" |
|
428 |
||
429 |
^ self variableSubclass:t |
|
7368 | 430 |
instanceVariableNames:f |
431 |
classVariableNames:d |
|
432 |
poolDictionaries:s |
|
433 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 434 |
|
435 |
"Modified: / 15.6.1998 / 21:31:41 / cg" |
|
436 |
"Modified: / 18.3.1999 / 18:16:33 / stefan" |
|
437 |
! |
|
438 |
||
439 |
variableWordSubclass:t classVariableNames:d poolDictionaries:s |
|
440 |
"{ Pragma: +optSpace }" |
|
441 |
||
442 |
"this method allows fileIn of ST/V and V'Age variable word (16bit integers) classes |
|
443 |
(which seem to have no category and no instvars)" |
|
444 |
||
445 |
^ self variableWordSubclass:t |
|
7368 | 446 |
instanceVariableNames:'' |
447 |
classVariableNames:d |
|
448 |
poolDictionaries:s |
|
449 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 450 |
! ! |
451 |
||
7261 | 452 |
!Class methodsFor:'Compatibility-ST80'! |
5190 | 453 |
|
454 |
fileOutSourceOn:aStream |
|
455 |
self fileOutOn:aStream withTimeStamp:false |
|
456 |
||
457 |
"Created: 20.6.1997 / 17:18:14 / cg" |
|
458 |
"Modified: 20.6.1997 / 17:18:26 / cg" |
|
459 |
! |
|
460 |
||
6723 | 461 |
rename:newName |
462 |
"same as renameTo: - for ST80 compatibility" |
|
463 |
||
464 |
^ Smalltalk renameClass:self to:newName. |
|
465 |
"/ ^ self renameTo:newName |
|
466 |
||
467 |
"Created: / 18.6.1998 / 22:08:45 / cg" |
|
468 |
! ! |
|
469 |
||
7261 | 470 |
!Class methodsFor:'Compatibility-VW'! |
6136 | 471 |
|
5190 | 472 |
isVisualStartable |
473 |
"return true, if this is an application class, |
|
474 |
which can be started via #open" |
|
475 |
||
476 |
^ false |
|
477 |
||
478 |
"Created: / 27.10.1997 / 16:42:05 / cg" |
|
479 |
! ! |
|
480 |
||
1 | 481 |
!Class methodsFor:'accessing'! |
482 |
||
6731 | 483 |
addChangeRecordForClass:aClass andNotifyChangeOf:aspect |
484 |
"writes a change record and notifies dependents." |
|
485 |
||
486 |
|namespace| |
|
487 |
||
488 |
self addChangeRecordForClass:aClass. |
|
489 |
||
490 |
aClass changed:#definition. |
|
491 |
||
492 |
namespace := aClass nameSpace. |
|
493 |
namespace changed:#classDefinition with:aClass. |
|
494 |
namespace ~~ Smalltalk ifTrue:[ |
|
7368 | 495 |
Smalltalk changed:#classDefinition with:aClass. |
6731 | 496 |
]. |
497 |
namespace changed:aspect with:aClass. |
|
498 |
namespace ~~ Smalltalk ifTrue:[ |
|
7368 | 499 |
Smalltalk changed:aspect with:aClass. |
6731 | 500 |
]. |
501 |
! |
|
502 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
503 |
addClassVarName:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
504 |
"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
|
505 |
Also writes a change record and notifies dependents." |
555 | 506 |
|
507 |
(self classVarNames includes:aString) ifFalse:[ |
|
7368 | 508 |
self classVariableString:(self classVariableString , ' ' , aString). |
509 |
Class withoutUpdatingChangesDo:[ |
|
510 |
self withAllSubclasses do:[:cls| |
|
511 |
cls recompileMethodsAccessingAnyClassvarOrGlobal: |
|
512 |
(Array with:aString asSymbol) |
|
513 |
]. |
|
514 |
]. |
|
515 |
self addChangeRecordForClass:self andNotifyChangeOf:#classVariables. |
|
555 | 516 |
] |
517 |
||
3220
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
518 |
"Created: / 29.10.1995 / 19:40:51 / cg" |
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
519 |
"Modified: / 23.1.1998 / 15:46:23 / stefan" |
555 | 520 |
! |
521 |
||
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
522 |
allPrivateClasses |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
523 |
"{ Pragma: +optSpace }" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
524 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
525 |
"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
|
526 |
The classes are in any order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
527 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
528 |
^ self privateClassesOrAll:true |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
529 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
530 |
! |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
531 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
532 |
category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
533 |
"return the category of the class. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
534 |
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
|
535 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
536 |
|owner| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
537 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
538 |
(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
|
539 |
^ category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
540 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
541 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
542 |
Point category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
543 |
Dictionary category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
544 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
545 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
546 |
"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
|
547 |
"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
|
548 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
549 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
550 |
category:aStringOrSymbol |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
551 |
"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
|
552 |
|
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
553 |
self setCategory:aStringOrSymbol. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
554 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
555 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
556 |
classFilename |
4744 | 557 |
"return the name of the file from which the class was compiled." |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
558 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
559 |
|owner| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
560 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
561 |
(owner := self owningClass) notNil ifTrue:[^ owner classFilename]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
562 |
^ classFilename |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
563 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
564 |
"Modified: 15.10.1996 / 18:53:21 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
565 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
566 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
567 |
classVarAt:aSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
568 |
"return the value of a class variable. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
569 |
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
|
570 |
this may change." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
571 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
572 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
573 |
this hides the (current) implementation of classVariables |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
574 |
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
|
575 |
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
|
576 |
no classPools yet. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
577 |
" |
6731 | 578 |
^ Smalltalk at:(self globalKeyForClassVar:aSymbol) |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
579 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
580 |
|
5707
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
581 |
classVarAt:aSymbol ifAbsent:exceptionBlock |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
582 |
"return the value of a class variable. |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
583 |
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
|
584 |
this may change." |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
585 |
|
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
586 |
" |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
587 |
this hides the (current) implementation of classVariables |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
588 |
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
|
589 |
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
|
590 |
no classPools yet. |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
591 |
" |
6731 | 592 |
^ Smalltalk at:(self globalKeyForClassVar:aSymbol) ifAbsent:exceptionBlock |
5707
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
593 |
! |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
594 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
595 |
classVarAt:aSymbol put:something |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
596 |
"store something in a classvariable. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
597 |
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
|
598 |
classVar exists - this may change." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
599 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
600 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
601 |
this hides the (current) implementation of classVariables |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
602 |
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
|
603 |
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
|
604 |
no classPools yet. |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
605 |
" |
6731 | 606 |
Smalltalk at:(self globalKeyForClassVar:aSymbol) put:something. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
607 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
608 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
609 |
classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
610 |
"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
|
611 |
Only names of class variables defined in this class are included |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
612 |
in the returned collection - use allClassVarNames, to get all known names." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
613 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
614 |
classvars isNil ifTrue:[ |
7368 | 615 |
^ #() |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
616 |
]. |
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
617 |
classvars isString ifTrue:[ |
7368 | 618 |
classvars := classvars asCollectionOfWords asArray collect:[:varName| varName asSymbol]. |
619 |
^ classvars |
|
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
620 |
]. |
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
621 |
|
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
622 |
^ classvars |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
623 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
624 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
625 |
Object classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
626 |
Float classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
627 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
628 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
629 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
630 |
classVariableString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
631 |
"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
|
632 |
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
|
633 |
returned string." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
634 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
635 |
classvars isNil ifTrue:[^ '']. |
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
636 |
classvars isString ifTrue:[ |
7368 | 637 |
^ classvars |
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
638 |
]. |
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
639 |
|
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
640 |
^ classvars asStringWith:(Character space) |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
641 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
642 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
643 |
Object classVariableString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
644 |
Float classVariableString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
645 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
646 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
647 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
648 |
classVariableString:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
649 |
"set the classes classvarnames string; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
650 |
Initialize new class variables with nil, clear and remove old ones. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
651 |
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
|
652 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
653 |
|prevVarNames varNames any| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
654 |
|
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
655 |
(aString = self classVariableString) ifFalse:[ |
7368 | 656 |
prevVarNames := self classVarNames asOrderedCollection. |
657 |
classvars := aString. |
|
658 |
varNames := self classVarNames. |
|
659 |
||
660 |
"new ones get initialized to nil; |
|
661 |
- old ones are nilled and removed from Smalltalk" |
|
662 |
any := false. |
|
663 |
||
664 |
varNames do:[:aName | |
|
665 |
(prevVarNames includes:aName) ifFalse:[ |
|
666 |
"a new one" |
|
667 |
self classVarAt:aName put:nil. |
|
668 |
any := true. |
|
669 |
] ifTrue:[ |
|
670 |
prevVarNames remove:aName |
|
671 |
] |
|
672 |
]. |
|
673 |
"left overs are gone" |
|
674 |
prevVarNames do:[:aName | |
|
675 |
self classVarAt:aName put:nil. |
|
676 |
Smalltalk removeKey:(self name , ':' , aName) asSymbol. |
|
677 |
]. |
|
678 |
any ifTrue:[ |
|
679 |
Smalltalk changed:#classVariables with:self |
|
680 |
]. |
|
453 | 681 |
] |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
682 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
683 |
"Modified: 2.4.1997 / 00:16:05 / stefan" |
453 | 684 |
! |
685 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
686 |
comment |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
687 |
"return the comment (aString) of the class" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
688 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
689 |
|stream string| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
690 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
691 |
"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
|
692 |
position within the classes sourcefile ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
693 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
694 |
comment isNumber ifTrue:[ |
7368 | 695 |
classFilename notNil ifTrue:[ |
696 |
stream := self sourceStream. |
|
697 |
stream notNil ifTrue:[ |
|
698 |
stream position1Based:comment. |
|
699 |
string := String readFrom:stream onError:''. |
|
700 |
stream close. |
|
701 |
^ string |
|
702 |
]. |
|
703 |
^ nil |
|
704 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
705 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
706 |
^ comment |
555 | 707 |
|
708 |
" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
709 |
Object comment |
7054
685d359f9847
code rewritten to be independent of stream zero-base
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
710 |
RunArray comment |
555 | 711 |
" |
712 |
! |
|
713 |
||
7128 | 714 |
comment:aStringOrNil |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
715 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
716 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
717 |
"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
|
718 |
create a change record and notify dependents." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
719 |
|
865
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
720 |
|oldComment newComment| |
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
721 |
|
7128 | 722 |
newComment := aStringOrNil. |
723 |
(aStringOrNil notNil and:[aStringOrNil withoutSeparators isEmpty]) ifTrue:[ |
|
7368 | 724 |
newComment := nil |
865
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
725 |
]. |
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
726 |
comment ~= newComment ifTrue:[ |
7368 | 727 |
oldComment := self comment. |
728 |
comment := newComment. |
|
729 |
self addChangeRecordForClassComment:self. |
|
730 |
self changed:#comment with:oldComment. |
|
731 |
Smalltalk changed:#classComment with:self. |
|
555 | 732 |
] |
733 |
! |
|
734 |
||
2444 | 735 |
environment |
736 |
"return the namespace I am contained in; ST-80 compatible name" |
|
737 |
||
738 |
^ self nameSpace |
|
739 |
! |
|
740 |
||
6731 | 741 |
globalKeyForClassVar:aStringOrSymbol |
742 |
"this helps to encapsulate the (current) implementation of classVariables |
|
743 |
from the outside world. Currently, classvars are stored in |
|
744 |
the Smalltalk dictionary with a funny name, since there are |
|
745 |
no classPools yet. |
|
746 |
" |
|
747 |
^ (self name , ':' , aStringOrSymbol) asSymbol |
|
748 |
! |
|
749 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
750 |
name |
6657 | 751 |
"return the name of the class. |
752 |
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
|
753 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
754 |
^ name |
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 |
"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
|
757 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
758 |
|
1919 | 759 |
nameSpace |
2070
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
760 |
"return the namespace I am contained in; |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
761 |
For private or anonymous classes, nil is returned - |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
762 |
for public classes, Smalltalk is returned." |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
763 |
|
7321 | 764 |
|idx nsName e| |
765 |
||
766 |
"/ cached in environment |
|
767 |
environment isNil ifTrue:[ |
|
7368 | 768 |
e := Smalltalk. "/ default |
769 |
||
770 |
"/ due to the implementation, extract this from my name |
|
771 |
"/ (physically, all classes are found in Smalltalk) |
|
772 |
||
773 |
idx := name lastIndexOf:$:. |
|
774 |
idx ~~ 0 ifTrue:[ |
|
775 |
(name at:idx-1) == $: ifTrue:[ |
|
776 |
nsName := name copyTo:(idx - 2). |
|
777 |
e := Smalltalk at:nsName asSymbol. |
|
778 |
] |
|
779 |
]. |
|
780 |
environment := e. |
|
1919 | 781 |
]. |
2493
ba34c6aac597
cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents:
2491
diff
changeset
|
782 |
^ environment |
ba34c6aac597
cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents:
2491
diff
changeset
|
783 |
|
3661 | 784 |
"Modified: / 20.7.1998 / 14:21:36 / cg" |
1919 | 785 |
! |
786 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
787 |
package |
3165
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
788 |
"return the package-id of the class" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
789 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
790 |
|owner| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
791 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
792 |
(owner := self owningClass) notNil ifTrue:[^ owner package]. |
5562 | 793 |
^ package ? '' |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
794 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
795 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
796 |
Object package |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
797 |
" |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
798 |
|
3951 | 799 |
"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
|
800 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
801 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
802 |
package:aStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
803 |
"set the package of the class." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
804 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
805 |
package := aStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
806 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
807 |
|
4740 | 808 |
packageInfo |
809 |
"return the package-info of the class - or nil. |
|
810 |
The packageManager contains information relevant to the package, |
|
811 |
to which this class belongs - especially, things like pathes to |
|
812 |
resources, additional files etc. can be optioned this way. |
|
813 |
A packageInfo loosely relates to ehat a classLoader is in Java. |
|
814 |
Experimental." |
|
815 |
||
4742 | 816 |
|packageId prj handle t| |
4740 | 817 |
|
818 |
packageId := self package. |
|
819 |
packageId notNil ifTrue:[ |
|
7368 | 820 |
prj := Project projectWithId:packageId. |
821 |
prj notNil ifTrue:[^ prj]. |
|
822 |
||
823 |
"/ |
|
824 |
"/ intermediate kludge (will be removed) |
|
825 |
"/ search for a loaded class library and extract |
|
826 |
"/ information from it ... |
|
827 |
"/ |
|
828 |
handle := ObjectFileLoader loadedObjectHandles |
|
829 |
detect:[:h | |cls| |
|
830 |
cls := h classes firstIfEmpty:nil. |
|
831 |
cls notNil and:[cls package = packageId] |
|
832 |
] |
|
833 |
ifNone:nil. |
|
834 |
||
835 |
handle notNil ifTrue:[ |
|
836 |
prj := Project new. |
|
837 |
prj name:packageId. |
|
838 |
prj directory:(handle pathName asFilename directory pathName). |
|
839 |
prj package:packageId. |
|
840 |
t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'. |
|
841 |
prj repositoryModule:(t first). |
|
842 |
prj repositoryDirectory:(packageId copyFrom:t first size + 2). |
|
843 |
prj isLoaded:true. |
|
844 |
^ prj |
|
845 |
] |
|
4740 | 846 |
]. |
847 |
^ nil |
|
848 |
||
849 |
" |
|
850 |
Object packageInfo |
|
851 |
OSI::FTAMOperation packageInfo |
|
852 |
" |
|
853 |
! |
|
854 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
855 |
primitiveDefinitions:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
856 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
857 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
858 |
"set the primitiveDefinition string" |
555 | 859 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
860 |
(self isPrivate) ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
861 |
self error:'private classes cannot have their own primitiveDefinitions'. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
862 |
]. |
5800
a4386f928cf0
setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents:
5770
diff
changeset
|
863 |
self setPrimitiveDefinitions:aString. |
555 | 864 |
self addChangeRecordForPrimitiveDefinitions:self. |
865 |
||
866 |
"Created: 29.10.1995 / 19:41:39 / cg" |
|
867 |
! |
|
868 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
869 |
primitiveDefinitionsString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
870 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
871 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
872 |
"return the primitiveDefinition string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
873 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
874 |
|owner| |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
875 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
876 |
(owner := self owningClass) notNil ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
877 |
^ owner primitiveDefinitionsString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
878 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
879 |
^ self getSourceChunkAttribute:#primitiveDefinitions |
555 | 880 |
|
881 |
" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
882 |
Object primitiveDefinitionsString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
883 |
String primitiveDefinitionsString |
555 | 884 |
" |
885 |
! |
|
886 |
||
5875 | 887 |
primitiveDefinitionsStringOrDefault |
888 |
"return the primitiveDefinition string or a default" |
|
889 |
||
890 |
^ self primitiveDefinitionsString ? '%{ |
|
891 |
||
892 |
/* |
|
893 |
* includes, defines, structure definitions |
|
894 |
* and typedefs come here. |
|
895 |
*/ |
|
896 |
||
897 |
%}' |
|
898 |
||
899 |
" |
|
900 |
Object primitiveDefinitionsStringOrDefault |
|
901 |
String primitiveDefinitionsStringOrDefault |
|
902 |
ExternalStream primitiveDefinitionsStringOrDefault |
|
903 |
" |
|
904 |
! |
|
905 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
906 |
primitiveFunctions:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
907 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
908 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
909 |
"set the primitiveFunction string" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
910 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
911 |
(self isPrivate) ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
912 |
self error:'private classes cannot have their own primitiveFunctions'. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
913 |
]. |
5800
a4386f928cf0
setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents:
5770
diff
changeset
|
914 |
self setPrimitiveFunctions:aString. |
555 | 915 |
self addChangeRecordForPrimitiveFunctions:self. |
916 |
||
917 |
"Created: 29.10.1995 / 19:41:48 / cg" |
|
918 |
! |
|
919 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
920 |
primitiveFunctionsString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
921 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
922 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
923 |
"return the primitiveFunctions string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
924 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
925 |
|owner| |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
926 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
927 |
(owner := self owningClass) notNil ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
928 |
^ owner primitiveFunctionsString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
929 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
930 |
^ self getSourceChunkAttribute:#primitiveFunctions |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
931 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
932 |
|
5875 | 933 |
primitiveFunctionsStringOrDefault |
934 |
"return the primitiveFunction string or a default" |
|
935 |
||
936 |
^ self primitiveFunctionsString ? '%{ |
|
937 |
||
938 |
/* |
|
939 |
* any local C (helper) functions |
|
940 |
* come here (please, define as static) |
|
941 |
*/ |
|
942 |
||
943 |
%}' |
|
944 |
||
945 |
" |
|
946 |
Object primitiveFunctionsStringOrDefault |
|
947 |
String primitiveFunctionsStringOrDefault |
|
948 |
ExternalStream primitiveFunctionsStringOrDefault |
|
949 |
" |
|
950 |
! |
|
951 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
952 |
primitiveVariables:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
953 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
954 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
955 |
"set the primitiveVariable string" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
956 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
957 |
(self isPrivate) ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
958 |
self error:'private classes cannot have their own primitiveVariables'. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
959 |
]. |
5800
a4386f928cf0
setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents:
5770
diff
changeset
|
960 |
self setPrimitiveVariables:aString. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
961 |
self addChangeRecordForPrimitiveVariables:self. |
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 |
"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
|
964 |
! |
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 |
primitiveVariablesString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
967 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
968 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
969 |
"return the primitiveVariables string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
970 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
971 |
|owner| |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
972 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
973 |
(owner := self owningClass) notNil ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
974 |
^ owner primitiveVariablesString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
975 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
976 |
^ self getSourceChunkAttribute:#primitiveVariables |
555 | 977 |
! |
978 |
||
5875 | 979 |
primitiveVariablesStringOrDefault |
980 |
"return the primitiveVariable string or a default" |
|
981 |
||
982 |
^ self primitiveVariablesString ? '%{ |
|
983 |
||
984 |
/* |
|
985 |
* any local C variables |
|
986 |
* come here (please, define as static) |
|
987 |
*/ |
|
988 |
||
989 |
%}' |
|
990 |
||
991 |
" |
|
992 |
Object primitiveVariablesStringOrDefault |
|
993 |
String primitiveVariablesStringOrDefault |
|
994 |
ExternalStream primitiveVariablesStringOrDefault |
|
995 |
" |
|
996 |
! |
|
997 |
||
1739 | 998 |
privateClasses |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
999 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1000 |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1001 |
"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
|
1002 |
The classes are in any order." |
1739 | 1003 |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1004 |
^ self privateClassesOrAll:false |
1739 | 1005 |
|
1006 |
" |
|
1007 |
Object privateClasses |
|
2718
f7b5e3bffd78
sort privateClasses by name, to avoid undefined ordering
Claus Gittinger <cg@exept.de>
parents:
2712
diff
changeset
|
1008 |
ObjectMemory privateClasses |
f7b5e3bffd78
sort privateClasses by name, to avoid undefined ordering
Claus Gittinger <cg@exept.de>
parents:
2712
diff
changeset
|
1009 |
UILayoutTool privateClasses |
1739 | 1010 |
" |
1011 |
||
3495
31ae10035c74
skip obsolete leftover private classes when enumerating.
Claus Gittinger <cg@exept.de>
parents:
3494
diff
changeset
|
1012 |
"Modified: / 29.5.1998 / 23:23:18 / cg" |
1739 | 1013 |
! |
1014 |
||
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1015 |
privateClassesAt:aClassNameStringOrSymbol |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1016 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1017 |
|
1707 | 1018 |
"return a private class if present; nil otherwise" |
1019 |
||
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
1020 |
|nmSym| |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
1021 |
|
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1022 |
nmSym := (self name , '::' , aClassNameStringOrSymbol) asSymbolIfInterned. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
1023 |
nmSym isNil ifTrue:[ |
7368 | 1024 |
"/ no such symbol - there cannot be a corresponding private class |
1025 |
^ nil |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
1026 |
]. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
1027 |
|
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1028 |
^ Smalltalk at:nmSym. |
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1029 |
|
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1030 |
"Modified: 26.6.1997 / 11:44:04 / cg" |
1707 | 1031 |
! |
1032 |
||
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1033 |
privateClassesAt:aClassNameStringOrSymbol put:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1034 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1035 |
|
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1036 |
"add a private class" |
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1037 |
|
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1038 |
self classVarAt:(':' , aClassNameStringOrSymbol) put:aClass |
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1039 |
|
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
1040 |
"Modified: 26.6.1997 / 11:44:12 / cg" |
1707 | 1041 |
! |
1042 |
||
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1043 |
privateClassesOrAll:allOfThem |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1044 |
"{ Pragma: +optSpace }" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1045 |
|
4495
4804e3e33d76
tuned #privateClasses access
Claus Gittinger <cg@exept.de>
parents:
4400
diff
changeset
|
1046 |
"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
|
1047 |
or direct plus indirect private classes (if allOfThem). |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1048 |
An empty collection if there are none. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1049 |
The classes are in any order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1050 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1051 |
|classes myName myNamePrefix myNamePrefixLen| |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1052 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1053 |
myName := self name. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1054 |
myNamePrefix := myName , '::'. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1055 |
myNamePrefixLen := myNamePrefix size. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1056 |
|
4575 | 1057 |
Smalltalk keysDo:[:nm | |
7368 | 1058 |
|cls| |
1059 |
||
1060 |
(nm startsWith:myNamePrefix) ifTrue:[ |
|
1061 |
(allOfThem |
|
1062 |
or:[(nm indexOf:$: startingAt:myNamePrefixLen + 1) == 0]) ifTrue:[ |
|
1063 |
cls := Smalltalk at:nm. |
|
1064 |
||
1065 |
(cls isBehavior and:[cls isMeta not]) ifTrue:[ |
|
1066 |
classes isNil ifTrue:[ |
|
1067 |
classes := Set new:10. |
|
1068 |
]. |
|
1069 |
classes add:cls. |
|
1070 |
] |
|
1071 |
] |
|
1072 |
] |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1073 |
]. |
4575 | 1074 |
|
4578 | 1075 |
^ classes ? #() |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1076 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1077 |
" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1078 |
UILayoutTool privateClassesOrAll:true |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1079 |
UILayoutTool privateClassesOrAll:false |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1080 |
" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1081 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1082 |
"Modified: / 29.5.1998 / 23:23:18 / cg" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1083 |
! |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1084 |
|
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1085 |
privateClassesSorted |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1086 |
"{ Pragma: +optSpace }" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1087 |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1088 |
"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
|
1089 |
The classes are sorted by inheritance." |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1090 |
|
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1091 |
|classes| |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1092 |
|
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1093 |
classes := self privateClasses. |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1094 |
(classes size > 0) ifTrue:[ |
7368 | 1095 |
classes := classes asOrderedCollection. |
1096 |
classes sort:[:a :b | a name < b name]. |
|
1097 |
classes topologicalSort:[:a :b | |
|
1098 |
"/ a must come before b iff: |
|
1099 |
"/ b is a subclass of a |
|
1100 |
"/ b has a private class which is a subclass of a |
|
7084
e53302e0134b
oops - must also sort private classes according
Claus Gittinger <cg@exept.de>
parents:
7054
diff
changeset
|
1101 |
|
7368 | 1102 |
|mustComeBefore| |
1103 |
||
1104 |
mustComeBefore := false. |
|
1105 |
b withAllPrivateClassesDo:[:eachClassInB | |
|
1106 |
mustComeBefore := mustComeBefore or:[eachClassInB isSubclassOf:a] |
|
1107 |
]. |
|
1108 |
mustComeBefore |
|
1109 |
]. |
|
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1110 |
]. |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1111 |
^ classes. |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1112 |
|
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1113 |
" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1114 |
Object privateClassesSorted |
5731 | 1115 |
NewSystemBrowser privateClassesSorted |
1116 |
NewSystemBrowser privateClasses |
|
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1117 |
" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1118 |
|
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1119 |
"Created: 22.3.1997 / 16:10:42 / cg" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1120 |
"Modified: 22.3.1997 / 16:11:20 / cg" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1121 |
! |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1122 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1123 |
removeClassVarName:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1124 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1125 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1126 |
"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
|
1127 |
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
|
1128 |
|
6731 | 1129 |
|names newNames| |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1130 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1131 |
names := self classVarNames. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1132 |
(names includes:aString) ifTrue:[ |
7368 | 1133 |
newNames := ''. |
1134 |
names do:[:nm | nm ~= aString ifTrue:[newNames := newNames , nm , ' ']]. |
|
1135 |
self classVariableString:newNames withoutSpaces. |
|
1136 |
Class withoutUpdatingChangesDo:[ |
|
1137 |
self withAllSubclasses do:[:cls| |
|
1138 |
cls recompileMethodsAccessingAnyClassvarOrGlobal: |
|
1139 |
(Array with:aString asSymbol) |
|
1140 |
]. |
|
1141 |
]. |
|
1142 |
self addChangeRecordForClass:self andNotifyChangeOf:#classVariables. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1143 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1144 |
|
3220
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
1145 |
"Created: / 29.10.1995 / 19:42:08 / cg" |
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
1146 |
"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
|
1147 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1148 |
|
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1149 |
setCategory:aStringOrSymbol |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1150 |
"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
|
1151 |
|
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1152 |
aStringOrSymbol isNil ifTrue:[ |
7368 | 1153 |
category := aStringOrSymbol |
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1154 |
] ifFalse:[ |
7368 | 1155 |
category := aStringOrSymbol asSymbol |
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1156 |
] |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1157 |
|
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1158 |
"Created: 1.4.1997 / 15:24:04 / stefan" |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1159 |
! |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1160 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1161 |
setClassFilename:aFilename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1162 |
"set the classes filename. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1163 |
This is a dangerous (low level) operation, since the |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1164 |
comment and primitiveSpecs may no longer be accessable, if a wrong filename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1165 |
is set here." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1166 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1167 |
classFilename := aFilename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1168 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1169 |
"Modified: 8.9.1995 / 14:16:48 / claus" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1170 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1171 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1172 |
setClassVariableString:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1173 |
"set the classes classvarnames string. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1174 |
This is a dangerous (low level) operation, since the |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1175 |
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
|
1176 |
NO change record is written." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1177 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1178 |
classvars := aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1179 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1180 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1181 |
setComment:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1182 |
"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
|
1183 |
do NOT create a change record" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1184 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1185 |
comment := aString |
1 | 1186 |
! |
1187 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1188 |
setComment:com category:categoryStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1189 |
"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
|
1190 |
do NOT create a change record" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1191 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1192 |
|cat| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1193 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1194 |
comment := com. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1195 |
categoryStringOrSymbol isNil ifTrue:[ |
7368 | 1196 |
cat := '' |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1197 |
] ifFalse:[ |
7368 | 1198 |
cat := categoryStringOrSymbol |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1199 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1200 |
category := cat asSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1201 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1202 |
|
5248 | 1203 |
setEnvironment:aNamespace |
1204 |
"set the namespace I am contained in; ST-80 compatible name" |
|
1205 |
||
1206 |
environment := aNamespace |
|
1207 |
! |
|
1208 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1209 |
setPackage:aStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1210 |
"set the package of the class." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1211 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1212 |
package := aStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1213 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1214 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1215 |
source |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1216 |
"return the classes full source code" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1217 |
|
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
1218 |
|code aStream tmpFile| |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1219 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1220 |
" this is too slow for big classes ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1221 |
code := String new:1000. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1222 |
aStream := WriteStream on:code. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1223 |
self fileOutOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1224 |
" |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
1225 |
tmpFile := '__temp' asFilename. |
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
1226 |
[ |
7368 | 1227 |
aStream := tmpFile newReadWriteStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
1228 |
] on:FileStream openErrorSignal do:[:ex| |
7368 | 1229 |
self warn:'cannot create temporary file.'. |
1230 |
^ nil |
|
555 | 1231 |
]. |
1232 |
FileOutErrorSignal handle:[:ex | |
|
7368 | 1233 |
aStream nextPutAll:'"no source available"'. |
555 | 1234 |
] do:[ |
7368 | 1235 |
self fileOutOn:aStream. |
555 | 1236 |
]. |
1237 |
aStream close. |
|
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
1238 |
aStream := tmpFile readStreamOrNil. |
555 | 1239 |
aStream isNil ifTrue:[ |
7368 | 1240 |
self warn:'oops - cannot reopen temp file'. |
1241 |
^ nil |
|
555 | 1242 |
]. |
1243 |
code := aStream contents. |
|
1244 |
aStream close. |
|
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
1245 |
tmpFile remove. |
555 | 1246 |
^ code |
385 | 1247 |
! |
1248 |
||
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1249 |
sourceCodeManager |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1250 |
"return my source code manager. |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1251 |
For now, all classes return the same global manager. |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1252 |
But future versions may support mixed reporitories" |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1253 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1254 |
|owner| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1255 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1256 |
(owner := self owningClass) notNil ifTrue:[^ owner sourceCodeManager]. |
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1257 |
^ Smalltalk at:#SourceCodeManager |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1258 |
|
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1259 |
"Created: 7.12.1995 / 13:16:46 / cg" |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1260 |
"Modified: 15.10.1996 / 18:54:02 / cg" |
1 | 1261 |
! ! |
1262 |
||
5257 | 1263 |
!Class methodsFor:'adding & removing'! |
1 | 1264 |
|
2036
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1265 |
removeFromSystem |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1266 |
"ST-80 compatibility |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1267 |
remove myself from the system" |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1268 |
|
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1269 |
^ Smalltalk removeClass:self |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1270 |
|
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1271 |
"Created: 6.2.1996 / 11:32:58 / stefan" |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1272 |
! |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1273 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1274 |
unload |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1275 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1276 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1277 |
"if the receiver was autoloaded, unload and reinstall it as |
293 | 1278 |
autoloaded. Can be used to get rid of no longer needed autoloaded |
328 | 1279 |
classes. |
1280 |
(maybe, autoloaded classes should unload themselfes when no |
|
1281 |
longer needed - for example, after some delay when the last instance |
|
1282 |
is gone ...)" |
|
293 | 1283 |
|
4052 | 1284 |
|nm newClass| |
293 | 1285 |
|
216 | 1286 |
self wasAutoloaded ifFalse:[ |
7368 | 1287 |
" |
1288 |
can it be done ? |
|
1289 |
(all of my methods must have a source) |
|
1290 |
" |
|
1291 |
self instAndClassSelectorsAndMethodsDo:[:sel :aMethod | |
|
1292 |
aMethod source isNil ifTrue:[^false]. |
|
1293 |
aMethod hasPrimitiveCode ifTrue:[^ false]. |
|
1294 |
]. |
|
216 | 1295 |
]. |
1296 |
||
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1297 |
"/ cannot unload, if non-autoloaded subclasses exist ... |
283 | 1298 |
self allSubclassesDo:[:aClass | |
7368 | 1299 |
aClass wasAutoloaded ifFalse:[ |
1300 |
aClass isPrivate ifFalse:[ |
|
1301 |
self warn:('cannot unload ' , self name , ' (' , aClass name , ' requires it'). |
|
1302 |
^ self. |
|
1303 |
] |
|
1304 |
] |
|
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1305 |
]. |
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1306 |
|
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1307 |
self allSubclassesDo:[:aClass | |
7368 | 1308 |
aClass wasAutoloaded ifTrue:[ |
1309 |
aClass unload |
|
1310 |
] ifFalse:[ |
|
1311 |
aClass removeFromSystem. |
|
1312 |
] |
|
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1313 |
]. |
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1314 |
self privateClasses do:[:aClass | |
7368 | 1315 |
aClass removeFromSystem. |
283 | 1316 |
]. |
1415 | 1317 |
Transcript showCR:'unloading ' , name , ' ...'. |
283 | 1318 |
|
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1319 |
"/ reinstall as autoloaded |
359 | 1320 |
Autoload removeClass:self. |
293 | 1321 |
nm := name. |
1322 |
Smalltalk at:nm put:nil. |
|
288 | 1323 |
ObjectMemory flushInlineCaches. |
1324 |
ObjectMemory flushMethodCache. |
|
4052 | 1325 |
newClass := Autoload addClass:nm inCategory:category. |
1326 |
newClass notNil ifTrue:[ |
|
7368 | 1327 |
newClass package:package |
4052 | 1328 |
]. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1329 |
Smalltalk flushCachedClasses. |
216 | 1330 |
^ true |
1331 |
||
1332 |
" |
|
1333 |
Clock open. |
|
1334 |
Clock unload. |
|
1335 |
ClockView unload. |
|
1336 |
Clock open |
|
1337 |
" |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1338 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1339 |
"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
|
1340 |
"Modified: 4.6.1997 / 14:48:02 / cg" |
1 | 1341 |
! ! |
1342 |
||
453 | 1343 |
!Class methodsFor:'binary storage'! |
1344 |
||
2477 | 1345 |
addGlobalsForBinaryStorageTo:globalDictionary |
453 | 1346 |
" |
1347 |
classPool == nil ifFalse: [ |
|
7368 | 1348 |
classPool associationsDo: [:assoc| |
1349 |
globalDictionary at: assoc put: self |
|
1350 |
] |
|
453 | 1351 |
] |
1352 |
" |
|
2477 | 1353 |
|
1354 |
"Created: 21.3.1997 / 15:40:45 / cg" |
|
453 | 1355 |
! |
1356 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1357 |
binaryClassDefinitionFrom:stream manager:manager |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1358 |
"retrieve a class as stored previously with |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1359 |
#storeBinaryClassOn:manager: |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1360 |
The namespace, where the class is to be installed is queries via the |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1361 |
NameSpaceQuerySignal - it should answer with nil, to suppress installation." |
1699
42a53290bd5d
allow for a class to be loaded into another environment
Claus Gittinger <cg@exept.de>
parents:
1687
diff
changeset
|
1362 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1363 |
|superclassName name flags instvars classvars category classInstVars |
1756 | 1364 |
comment package superclassSig rev |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1365 |
newClass superClass methods cmethods formatID environment |
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1366 |
ownerName owner nPrivate privateClass cls| |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1367 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1368 |
"/ the following order must correlate to |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1369 |
"/ the storing in #storeBinaryClassOn:manager: |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1370 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1371 |
"/ retrieve |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1372 |
"/ formatID |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1373 |
"/ superclasses name, |
944
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1374 |
"/ superclasses signature |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1375 |
"/ name, |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1376 |
"/ typeSymbol, |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1377 |
"/ instVarNames |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1378 |
"/ classVarNames |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1379 |
"/ category |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1380 |
"/ classInstVarNames |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1381 |
"/ comment |
1756 | 1382 |
"/ revision |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1383 |
"/ package |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1384 |
"/ name of owner, or nil |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1385 |
"/ classes methodDictionary |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1386 |
"/ methodDictionary |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1387 |
"/ number of private classes |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1388 |
"/ private classes, if any |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1389 |
|
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1390 |
formatID := manager nextObject. |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1391 |
formatID isInteger ifFalse:[ "/ backward compatibilty |
7368 | 1392 |
formatID := nil. |
1393 |
superclassName := formatID |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1394 |
] ifTrue:[ |
7368 | 1395 |
superclassName := manager nextObject. |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1396 |
]. |
944
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1397 |
superclassSig := manager nextObject. |
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1398 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1399 |
superclassName notNil ifTrue:[ |
7368 | 1400 |
superClass := Smalltalk at:superclassName ifAbsent:nil. |
1401 |
||
1402 |
superClass isNil ifTrue:[ |
|
1403 |
BinaryIOManager nonexistingClassSignal |
|
1404 |
raiseRequestWith:'non existent superclass (in binaryLoad)'. |
|
1405 |
^ nil |
|
1406 |
]. |
|
1407 |
||
1408 |
"/ ('loading superclass: ' , superclassName ) printNL. |
|
1409 |
superClass autoload. |
|
1410 |
superClass := Smalltalk at:superclassName. |
|
1411 |
||
1412 |
superclassSig ~= superClass signature ifTrue:[ |
|
1413 |
BinaryIOManager changedInstLayoutSignal |
|
1414 |
raiseRequestWith:'incompatible superclass (in binaryLoad)'. |
|
1415 |
^ nil |
|
1416 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1417 |
]. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1418 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1419 |
name := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1420 |
flags := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1421 |
instvars := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1422 |
instvars isNil ifTrue:[instvars := '']. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1423 |
classvars := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1424 |
classvars isNil ifTrue:[classvars := '']. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1425 |
category := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1426 |
classInstVars := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1427 |
classInstVars isNil ifTrue:[classInstVars := '']. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1428 |
comment := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1429 |
package := manager nextObject. |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1430 |
formatID == 1 ifTrue:[ |
7368 | 1431 |
rev := manager nextObject. |
1432 |
ownerName := manager nextObject. |
|
1433 |
ownerName notNil ifTrue:[ |
|
1434 |
name := name copyFrom:(ownerName size + 2 + 1). |
|
1435 |
owner := Smalltalk at:ownerName. |
|
1436 |
] |
|
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1437 |
]. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1438 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1439 |
"/ 'got superName:' print. superclassName printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1440 |
"/ 'got name:' print. name printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1441 |
"/ 'got flags: ' print. flags printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1442 |
"/ 'got instvars: ' print. instvars printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1443 |
"/ 'got classvars: ' print. classvars printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1444 |
"/ 'got category: ' print. category printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1445 |
"/ 'got classInstvars: ' print. classInstVars printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1446 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1447 |
"/ ('create class: ' , name ) printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1448 |
|
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1449 |
owner notNil ifTrue:[ |
7368 | 1450 |
environment := owner |
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1451 |
] ifFalse:[ |
7368 | 1452 |
environment := Class nameSpaceQuerySignal query. |
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1453 |
]. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1454 |
|
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1455 |
cls := superClass. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1456 |
superClass isNil ifTrue:[ |
7368 | 1457 |
cls := Object |
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1458 |
]. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1459 |
|
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1460 |
newClass := cls class |
7368 | 1461 |
name:name asSymbol |
1462 |
inEnvironment:environment |
|
1463 |
subclassOf:cls |
|
1464 |
instanceVariableNames:instvars |
|
1465 |
variable:false |
|
1466 |
words:false |
|
1467 |
pointers:true |
|
1468 |
classVariableNames:classvars |
|
1469 |
poolDictionaries:'' |
|
1470 |
category:category |
|
1471 |
comment:comment |
|
1472 |
changed:false |
|
1473 |
classInstanceVariableNames:classInstVars. |
|
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1474 |
|
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1475 |
newClass isNil ifTrue:[ |
7368 | 1476 |
^ nil. |
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1477 |
]. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1478 |
|
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1479 |
superClass isNil ifTrue:[ |
7368 | 1480 |
newClass setSuperclass:nil. |
1481 |
newClass class setSuperclass:Class. |
|
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1482 |
]. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1483 |
|
1759 | 1484 |
"/ Transcript showCR:'loaded ' , name , ' in ' , environment name. |
1485 |
||
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1486 |
newClass flags:flags. |
453 | 1487 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1488 |
"/ retrieve class methods |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1489 |
cmethods := MethodDictionary binaryFullDefinitionFrom:stream manager:manager. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1490 |
"/ retrieve inst methods |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1491 |
methods := MethodDictionary binaryFullDefinitionFrom:stream manager:manager. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1492 |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1493 |
formatID == 1 ifTrue:[ |
7368 | 1494 |
"/ privateClasses |
1495 |
nPrivate := manager nextObject. |
|
1496 |
nPrivate timesRepeat:[ |
|
1497 |
Class nameSpaceQuerySignal |
|
1498 |
answer:newClass |
|
1499 |
do:[ |
|
1500 |
privateClass := manager nextObject |
|
1501 |
] |
|
1502 |
] |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1503 |
]. |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1504 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1505 |
(superClass isNil and:[superclassName notNil]) ifTrue:[^ nil]. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1506 |
newClass isNil ifTrue:[ |
7368 | 1507 |
^ nil |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1508 |
]. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1509 |
|
1756 | 1510 |
owner notNil ifTrue:[ |
7368 | 1511 |
newClass setCategory:nil. |
1756 | 1512 |
] ifFalse:[ |
7368 | 1513 |
newClass setPackage:package. |
1756 | 1514 |
]. |
6077
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
1515 |
newClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | mthd setPackage:package]. |
1756 | 1516 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1517 |
newClass methodDictionary:methods. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1518 |
newClass class methodDictionary:cmethods. |
3951 | 1519 |
|
1520 |
newClass initializeWithAllPrivateClasses. |
|
1521 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1522 |
^ newClass |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1523 |
|
3951 | 1524 |
"Created: / 8.10.1996 / 17:57:02 / cg" |
1525 |
"Modified: / 16.2.1999 / 10:09:22 / cg" |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1526 |
"Modified: / 18.3.1999 / 18:15:58 / stefan" |
872 | 1527 |
! |
1528 |
||
1529 |
storeBinaryClassOn:stream manager:manager |
|
1530 |
"store a classes complete description (i.e. including methods). |
|
1531 |
However, the superclass chain is not stored - at load time, that must |
|
1532 |
be either present or autoloadable." |
|
1533 |
||
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
1534 |
|s sig owner superclass privateClasses nPrivate| |
872 | 1535 |
|
1536 |
stream nextPut: manager codeForClass. |
|
1537 |
||
1538 |
"/ the following order must correlate to |
|
1539 |
"/ the storing in #binaryDefinitionFrom:manager: |
|
1540 |
||
1541 |
"/ store |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1542 |
"/ format ID |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1543 |
"/ superclasses name |
944
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1544 |
"/ superclasses signature |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1545 |
"/ name |
872 | 1546 |
"/ typeSymbol, |
1547 |
"/ instVarNames |
|
1548 |
"/ classVarNames |
|
1549 |
"/ category |
|
1550 |
"/ classInstVarNames |
|
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1551 |
"/ comment |
902
2e1c740a255f
also store the package in binaryClassStore
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1552 |
"/ package |
1756 | 1553 |
"/ revision |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1554 |
"/ name of owner, or nil |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1555 |
"/ classes methodDictionary |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1556 |
"/ methodDictionary |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1557 |
"/ # of privateClass names |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1558 |
"/ privateClasses, if any |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1559 |
|
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1560 |
1 storeBinaryOn:stream manager:manager. "/ formatID |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1561 |
|
1756 | 1562 |
owner := self owningClass. |
1563 |
||
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
1564 |
superclass := self superclass. |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1565 |
superclass isNil ifTrue:[ |
7368 | 1566 |
s := nil. |
1567 |
sig := 0. |
|
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1568 |
] ifFalse:[ |
7368 | 1569 |
s := superclass name. |
1570 |
sig := superclass signature. |
|
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1571 |
]. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1572 |
s storeBinaryOn:stream manager:manager. |
944
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1573 |
sig storeBinaryOn:stream manager:manager. |
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1574 |
|
872 | 1575 |
name storeBinaryOn:stream manager:manager. |
1576 |
flags storeBinaryOn:stream manager:manager. |
|
3951 | 1577 |
(instvars isNil or:[instvars isEmpty]) ifTrue:[ |
7368 | 1578 |
s := nil |
872 | 1579 |
] ifFalse:[ |
7368 | 1580 |
s := self instanceVariableString |
872 | 1581 |
]. |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1582 |
s storeBinaryOn:stream manager:manager. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1583 |
|
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
1584 |
(classvars isNil or:[classvars isEmpty]) ifTrue:[ |
7368 | 1585 |
s := nil |
872 | 1586 |
] ifFalse:[ |
7368 | 1587 |
s := self classVariableString |
872 | 1588 |
]. |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1589 |
s storeBinaryOn:stream manager:manager. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1590 |
|
1756 | 1591 |
"/ the category |
1592 |
owner notNil ifTrue:[ |
|
7368 | 1593 |
nil storeBinaryOn:stream manager:manager. |
1756 | 1594 |
] ifFalse:[ |
7368 | 1595 |
category storeBinaryOn:stream manager:manager. |
1759 | 1596 |
]. |
1597 |
||
1598 |
"/ the classInstVarString |
|
1599 |
s := self class instanceVariableString. |
|
1600 |
(s notNil and:[s isEmpty]) ifTrue:[ |
|
7368 | 1601 |
s := nil |
872 | 1602 |
]. |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1603 |
s storeBinaryOn:stream manager:manager. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1604 |
|
1756 | 1605 |
"/ the comment |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1606 |
s := comment. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1607 |
manager sourceMode == #discard ifTrue:[ |
7368 | 1608 |
s := nil |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1609 |
]. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1610 |
s storeBinaryOn:stream manager:manager. |
1756 | 1611 |
|
1612 |
"/ the revision, package & owner |
|
1613 |
owner notNil ifTrue:[ |
|
7368 | 1614 |
nil storeBinaryOn:stream manager:manager. |
1615 |
nil storeBinaryOn:stream manager:manager. |
|
1616 |
owner name storeBinaryOn:stream manager:manager. |
|
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1617 |
] ifFalse:[ |
7368 | 1618 |
package storeBinaryOn:stream manager:manager. |
1619 |
revision storeBinaryOn:stream manager:manager. |
|
1620 |
nil storeBinaryOn:stream manager:manager. |
|
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1621 |
]. |
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1622 |
|
944
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1623 |
"/ |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1624 |
"/ store class method dictionary and methods |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1625 |
"/ |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1626 |
self class methodDictionary storeFullBinaryDefinitionOn:stream manager:manager. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1627 |
"/ store inst method dictionary and methods |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1628 |
self methodDictionary storeFullBinaryDefinitionOn:stream manager:manager. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1629 |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1630 |
"/ |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1631 |
"/ names of private classes |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1632 |
"/ |
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1633 |
privateClasses := self privateClassesSorted. |
4022 | 1634 |
(nPrivate := privateClasses size) storeBinaryOn:stream manager:manager. |
1635 |
nPrivate > 0 ifTrue:[ |
|
7368 | 1636 |
privateClasses do:[:aClass | |
1637 |
aClass storeBinaryClassOn:stream manager:manager |
|
1638 |
] |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1639 |
]. |
872 | 1640 |
|
1641 |
" |
|
1642 |
|bos| |
|
1643 |
||
1644 |
bos := BinaryObjectStorage onNew: (Filename named: 'FBrowser.cls') writeStream. |
|
1645 |
bos nextPutClasses:(Array with:FileBrowser). |
|
1646 |
bos close. |
|
1647 |
" |
|
1648 |
" |
|
1649 |
|bos cls| |
|
1650 |
||
1651 |
bos := BinaryObjectStorage onOld: (Filename named: 'FBrowser.cls') readStream. |
|
1652 |
cls := bos next. |
|
1653 |
bos close. |
|
1654 |
cls open. |
|
1655 |
" |
|
1656 |
||
3788
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
1657 |
"Modified: / 7.6.1996 / 13:39:02 / stefan" |
3951 | 1658 |
"Modified: / 16.2.1999 / 07:07:00 / cg" |
872 | 1659 |
! |
1660 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1661 |
storeBinaryDefinitionOf: anAssociation on: stream manager: manager |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1662 |
"not usable at the moment - there are no classpools currently" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1663 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1664 |
| string | |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1665 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1666 |
string := self name, ' classPool at: ', anAssociation key storeString. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1667 |
stream nextNumber: 2 put: string size. |
2463
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1668 |
stream nextPutBytes:(string size) from:string startingAt:1. |
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1669 |
"/ string do: [:char| stream nextPut: char asciiValue] |
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1670 |
|
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1671 |
"Modified: 19.3.1997 / 18:49:54 / cg" |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1672 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1673 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1674 |
storeBinaryDefinitionOn: stream manager: manager |
1259 | 1675 |
"store the receiver in a binary format on stream. |
1676 |
This is an internal interface for binary storage mechanism. |
|
1677 |
classes only store the name, signature and instvar names. |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1678 |
They restore by looking for that name in the Smalltalk dictionary. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1679 |
However, using the signature, a check for being valid is made at |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1680 |
restore time. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1681 |
This avoids a full recursive store of a class in the normal binary |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1682 |
storage - however, it also means that a classes semantics cannot |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1683 |
be stored with the basic storeBinary operation |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1684 |
(we depend on the class being present at binaryLoad time. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1685 |
To store classes, use #storeBinaryClassOn:manager: or BOSS>>nextPutClasses:." |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1686 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1687 |
|varnames n sz| |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1688 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1689 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1690 |
output the signature |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1691 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1692 |
stream nextNumber:4 put:self signature. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1693 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1694 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1695 |
output the instance variable name string |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1696 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1697 |
varnames := self allInstVarNames. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1698 |
n := varnames size. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1699 |
n == 0 ifTrue:[ |
7368 | 1700 |
sz := 0 |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1701 |
] ifFalse:[ |
7368 | 1702 |
sz := varnames inject:0 into:[:sum :nm | sum + nm size]. |
1703 |
sz := sz + n - 1. |
|
877
63ebb325ed20
flush global-access cache (using snapshotID) when saving a methods binary code
Claus Gittinger <cg@exept.de>
parents:
872
diff
changeset
|
1704 |
]. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1705 |
stream nextNumber:2 put:sz. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1706 |
varnames keysAndValuesDo:[:i :nm | |
7368 | 1707 |
stream nextPutBytes:(nm size) from:nm startingAt:1. |
2463
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1708 |
"/ nm do:[:c | |
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1709 |
"/ stream nextPut:c asciiValue |
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1710 |
"/ ]. |
7368 | 1711 |
i ~~ n ifTrue:[stream nextPut:(Character space asciiValue)] |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1712 |
]. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1713 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1714 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1715 |
output my name |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1716 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1717 |
stream nextNumber:2 put:name size. |
2463
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1718 |
stream nextPutBytes:(name size) from:name startingAt:1. |
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1719 |
"/ name do:[:c| |
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1720 |
"/ stream nextPut:c asciiValue |
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1721 |
"/ ] |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1722 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1723 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1724 |
|s| |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1725 |
s := WriteStream on:ByteArray new. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1726 |
Rectangle storeBinaryOn:s. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1727 |
Object readBinaryFrom:(ReadStream on:s contents) |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1728 |
" |
1259 | 1729 |
|
2463
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1730 |
"Modified: 19.3.1997 / 18:47:10 / cg" |
453 | 1731 |
! ! |
1732 |
||
1 | 1733 |
!Class methodsFor:'changes management'! |
1734 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1735 |
addChangeRecordForChangeCategory |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1736 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1737 |
|
6097 | 1738 |
"add a category change" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1739 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1740 |
Class updateChangeFileQuerySignal query ifTrue:[ |
7368 | 1741 |
self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category. |
6097 | 1742 |
]. |
1743 |
||
1744 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1745 |
Project notNil ifTrue:[ |
|
7368 | 1746 |
UpdateChangeListQuerySignal query ifTrue:[ |
1747 |
Project addClassDefinitionChangeFor:self |
|
1748 |
] |
|
2256 | 1749 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1750 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1751 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1752 |
addChangeRecordForClass:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1753 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1754 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1755 |
"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
|
1756 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1757 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1758 |
self writingChangePerform:#addChangeRecordForClass:to: with:aClass. |
6166 | 1759 |
]. |
1760 |
||
1761 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1762 |
Project notNil ifTrue:[ |
|
7368 | 1763 |
UpdateChangeListQuerySignal query ifTrue:[ |
1764 |
Project addClassDefinitionChangeFor:aClass |
|
1765 |
] |
|
2256 | 1766 |
] |
1767 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1768 |
"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
|
1769 |
"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
|
1770 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1771 |
|
620 | 1772 |
addChangeRecordForClassCheckIn:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1773 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1774 |
|
620 | 1775 |
"append a class-was-checkedIn-record to the changes file" |
1776 |
||
1938 | 1777 |
|rv| |
1778 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1779 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1780 |
rv := aClass revision. |
1781 |
rv isNil ifTrue:[rv := '???']. |
|
1782 |
||
1783 |
self |
|
1784 |
writingChangeWithTimeStamp:false |
|
1785 |
perform:#addInfoRecord:to: |
|
1786 |
with:('checkin ' , aClass name , ' (' , rv , ')'). |
|
2256 | 1787 |
] |
620 | 1788 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1789 |
"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
|
1790 |
"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
|
1791 |
"Modified: / 18.3.1999 / 18:14:14 / stefan" |
620 | 1792 |
! |
1793 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1794 |
addChangeRecordForClassComment:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1795 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1796 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1797 |
"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
|
1798 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1799 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1800 |
self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass. |
6166 | 1801 |
]. |
1802 |
||
1803 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1804 |
Project notNil ifTrue:[ |
|
7368 | 1805 |
UpdateChangeListQuerySignal query ifTrue:[ |
1806 |
Project addClassCommentChangeFor:aClass |
|
1807 |
] |
|
2256 | 1808 |
] |
1809 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1810 |
"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
|
1811 |
"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
|
1812 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1813 |
|
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1814 |
addChangeRecordForClassContainerRemove:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1815 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1816 |
|
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1817 |
"append a container-was-removed-record to the changes file" |
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1818 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1819 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1820 |
self |
1821 |
writingChangeWithTimeStamp:false |
|
1822 |
perform:#addInfoRecord:to: |
|
1823 |
with:('removed source container of ' , aClass name). |
|
2256 | 1824 |
] |
1825 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1826 |
"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
|
1827 |
"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
|
1828 |
"Modified: / 18.3.1999 / 18:14:31 / stefan" |
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1829 |
! |
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1830 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1831 |
addChangeRecordForClassFileOut:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1832 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1833 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1834 |
"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
|
1835 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1836 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1837 |
self |
1838 |
writingChangeWithTimeStamp:false |
|
1839 |
perform:#addInfoRecord:to: |
|
1840 |
with:('fileOut ' , aClass name). |
|
2256 | 1841 |
] |
1842 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1843 |
"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
|
1844 |
"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
|
1845 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1846 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1847 |
addChangeRecordForClassInstvars:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1848 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1849 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1850 |
"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
|
1851 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1852 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1853 |
self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass. |
6166 | 1854 |
]. |
1855 |
||
1856 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1857 |
Project notNil ifTrue:[ |
|
7368 | 1858 |
UpdateChangeListQuerySignal query ifTrue:[ |
1859 |
Project addInstVarDefinitionChangeFor:aClass class |
|
1860 |
] |
|
2256 | 1861 |
] |
1862 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1863 |
"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
|
1864 |
"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
|
1865 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1866 |
|
7179 | 1867 |
addChangeRecordForClassRemove |
1868 |
"{ Pragma: +optSpace }" |
|
1869 |
||
1870 |
"add a class-remove-record to the changes file" |
|
1871 |
||
1872 |
UpdateChangeFileQuerySignal query ifTrue:[ |
|
7368 | 1873 |
self writingChangePerform:#addChangeRecordForClassRemove:to: with:self. |
7179 | 1874 |
]. |
1875 |
||
1876 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1877 |
Project notNil ifTrue:[ |
|
7368 | 1878 |
UpdateChangeListQuerySignal query ifTrue:[ |
1879 |
Project addClassRemoveChange:self |
|
1880 |
] |
|
7179 | 1881 |
] |
1882 |
||
1883 |
"Modified: / 24.1.1997 / 19:10:25 / cg" |
|
1884 |
"Modified: / 18.3.1999 / 18:14:53 / stefan" |
|
1885 |
! |
|
1886 |
||
6166 | 1887 |
addChangeRecordForClassRemove:oldClassName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1888 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1889 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1890 |
"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
|
1891 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1892 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1893 |
self writingChangePerform:#addChangeRecordForClassRemove:to: with:self. |
6166 | 1894 |
]. |
1895 |
||
1896 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1897 |
Project notNil ifTrue:[ |
|
7368 | 1898 |
UpdateChangeListQuerySignal query ifTrue:[ |
1899 |
Project addClassRemoveChange:self |
|
1900 |
] |
|
2256 | 1901 |
] |
1902 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1903 |
"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
|
1904 |
"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
|
1905 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1906 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1907 |
addChangeRecordForClassRename:oldName to:newName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1908 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1909 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1910 |
"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
|
1911 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1912 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1913 |
self writingChangeDo:[:aStream | |
1914 |
self addChangeRecordForClassRename:oldName to:newName to:aStream |
|
1915 |
] |
|
6166 | 1916 |
]. |
1917 |
||
1918 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1919 |
Project notNil ifTrue:[ |
|
7368 | 1920 |
UpdateChangeListQuerySignal query ifTrue:[ |
1921 |
Project addClassRenameChangeFrom:oldName to:newName |
|
1922 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1923 |
] |
1846 | 1924 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1925 |
"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
|
1926 |
"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
|
1927 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1928 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1929 |
addChangeRecordForPrimitiveDefinitions:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1930 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1931 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1932 |
"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
|
1933 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1934 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1935 |
self writingChangePerform:#addChangeRecordForPrimitiveDefinitions:to: with:aClass. |
6166 | 1936 |
]. |
1937 |
||
1938 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1939 |
Project notNil ifTrue:[ |
|
7368 | 1940 |
UpdateChangeListQuerySignal query ifTrue:[ |
1941 |
Project addPrimitiveDefinitionsChangeFor:aClass |
|
1942 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1943 |
] |
2206 | 1944 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1945 |
"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
|
1946 |
"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
|
1947 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1948 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1949 |
addChangeRecordForPrimitiveFunctions:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1950 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1951 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1952 |
"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
|
1953 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1954 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1955 |
self writingChangePerform:#addChangeRecordForPrimitiveFunctions:to: with:aClass. |
6166 | 1956 |
]. |
1957 |
||
1958 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1959 |
Project notNil ifTrue:[ |
|
7368 | 1960 |
UpdateChangeListQuerySignal query ifTrue:[ |
1961 |
Project addPrimitiveFunctionsChangeFor:aClass |
|
1962 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1963 |
] |
2206 | 1964 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1965 |
"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
|
1966 |
"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
|
1967 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1968 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1969 |
addChangeRecordForPrimitiveVariables:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1970 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1971 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1972 |
"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
|
1973 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1974 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1975 |
self writingChangePerform:#addChangeRecordForPrimitiveVariables:to: with:aClass. |
6166 | 1976 |
]. |
1977 |
||
1978 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1979 |
Project notNil ifTrue:[ |
|
7368 | 1980 |
UpdateChangeListQuerySignal query ifTrue:[ |
1981 |
Project addPrimitiveVariablesChangeFor:aClass |
|
1982 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1983 |
] |
2206 | 1984 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1985 |
"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
|
1986 |
"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
|
1987 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1988 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1989 |
addChangeRecordForSnapshot:aFileName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1990 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1991 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1992 |
"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
|
1993 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1994 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1995 |
self |
1996 |
writingChangeWithTimeStamp:false |
|
1997 |
perform:#addChangeRecordForSnapshot:to: |
|
1998 |
with:aFileName. |
|
2256 | 1999 |
] |
2000 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2001 |
"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
|
2002 |
"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
|
2003 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2004 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2005 |
addChangeRecordForSnapshot:aFileName to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2006 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
2007 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2008 |
"add a snapshot-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2009 |
|
6166 | 2010 |
self addInfoRecord:('snapshot ' , aFileName) to:aStream |
2256 | 2011 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2012 |
"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
|
2013 |
"Modified: / 18.3.1999 / 18:15:30 / stefan" |
2917 | 2014 |
! ! |
2015 |
||
1824 | 2016 |
!Class methodsFor:'enumerating'! |
2017 |
||
3997 | 2018 |
allPrivateClassesDo:aBlock |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
2019 |
"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
|
2020 |
Evaluation is in no particular order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
2021 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
2022 |
self allPrivateClasses do:aBlock |
3997 | 2023 |
! |
2024 |
||
1824 | 2025 |
privateClassesDo:aBlock |
5715
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2026 |
"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
|
2027 |
Evaluation is in no particular order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
2028 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
2029 |
self privateClasses do:aBlock |
5715
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2030 |
! |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2031 |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2032 |
subclassesDo:aBlock |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2033 |
"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
|
2034 |
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
|
2035 |
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
|
2036 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2037 |
|coll| |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2038 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2039 |
"/ use cached information (avoid class hierarchy search) |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2040 |
"/ if possible |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2041 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2042 |
SubclassInfo isNil ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2043 |
Class subclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2044 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2045 |
SubclassInfo notNil ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2046 |
coll := SubclassInfo at:self ifAbsent:nil. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2047 |
coll notNil ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2048 |
coll do:aBlock. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2049 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2050 |
^ self |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2051 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2052 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2053 |
Smalltalk allClassesDo:[:aClass | |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2054 |
(aClass superclass == self) ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2055 |
aBlock value:aClass |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2056 |
] |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2057 |
] |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2058 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2059 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2060 |
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
|
2061 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2062 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2063 |
"Modified: 22.1.1997 / 18:44:01 / cg" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2064 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2065 |
|
5715
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2066 |
withAllPrivateClassesDo:aBlock |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2067 |
"evaluate aBlock on myself and all of my private classes (if any). |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2068 |
This recurses into private classes of private classes. |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2069 |
Evaluation is in no particular order." |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2070 |
|
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2071 |
aBlock value:self. |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2072 |
self allPrivateClasses do:aBlock |
1824 | 2073 |
! ! |
2074 |
||
1 | 2075 |
!Class methodsFor:'fileIn interface'! |
2076 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2077 |
primitiveDefinitions |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2078 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2079 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2080 |
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
|
2081 |
unprocessed contents in the classes primitiveDefinitions section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2082 |
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
|
2083 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2084 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2085 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2086 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2087 |
"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
|
2088 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2089 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2090 |
primitiveFunctions |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2091 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2092 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2093 |
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
|
2094 |
unprocessed contents in the classes primitiveFunctions section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2095 |
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
|
2096 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2097 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2098 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2099 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2100 |
"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
|
2101 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2102 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2103 |
primitiveVariables |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2104 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2105 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2106 |
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
|
2107 |
unprocessed contents in the classes primitiveVariables section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2108 |
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
|
2109 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2110 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2111 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2112 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2113 |
"Modified: 10.2.1996 / 12:47:28 / cg" |
1 | 2114 |
! ! |
2115 |
||
2116 |
!Class methodsFor:'fileOut'! |
|
2117 |
||
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2118 |
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2119 |
"append an expression on aStream, which defines myself." |
238 | 2120 |
|
5344
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2121 |
self |
7368 | 2122 |
basicFileOutDefinitionOn:aStream |
2123 |
withNameSpace:forceNameSpace |
|
2124 |
withPackage:true |
|
5344
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2125 |
|
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2126 |
! |
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2127 |
|
6520
430a6d467003
fileout private classes (no namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
6409
diff
changeset
|
2128 |
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
|
2129 |
"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
|
2130 |
|
6520
430a6d467003
fileout private classes (no namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
6409
diff
changeset
|
2131 |
|s owner ns nsName fullName forceNoNameSpace superNameWithoutNameSpacePrefix cls topOwner |
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2132 |
syntaxHilighting superclass superclassNamespace| |
2843
ccf00b7b1c8f
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2835
diff
changeset
|
2133 |
|
4629 | 2134 |
UserPreferences isNil ifTrue:[ |
7368 | 2135 |
syntaxHilighting := false |
4629 | 2136 |
] ifFalse:[ |
7368 | 2137 |
syntaxHilighting := UserPreferences current syntaxColoring. |
4629 | 2138 |
]. |
1 | 2139 |
|
6077
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
2140 |
fullName := FileOutNameSpaceQuerySignal query == true. |
1741 | 2141 |
owner := self owningClass. |
6731 | 2142 |
ns := self topNameSpace. |
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2143 |
|
5344
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2144 |
(showPackage and:[owner isNil]) ifTrue:[ |
7368 | 2145 |
aStream nextPutAll:'"{ Package: '''. |
2146 |
aStream nextPutAll:self package asString. |
|
2147 |
aStream nextPutAll:''' }"'; cr; cr. |
|
5340
cdc42cba8f01
add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents:
5296
diff
changeset
|
2148 |
]. |
cdc42cba8f01
add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents:
5296
diff
changeset
|
2149 |
|
6077
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
2150 |
"/ the backward compatible namespace directive is only used |
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
2151 |
"/ for non-private classes. |
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
2152 |
"/ Private classes cannot be filed into another smalltalk anyway, |
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
2153 |
"/ and there is no need to complicate global lookup in stc... |
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
2154 |
|
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
2155 |
owner notNil ifTrue:[ |
7368 | 2156 |
forceNoNameSpace := ForceNoNameSpaceQuerySignal query == true. |
2157 |
forceNoNameSpace ifFalse:[ |
|
2158 |
fullName := true. |
|
2159 |
] |
|
6077
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
2160 |
]. |
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
2161 |
|
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
2162 |
fullName ifFalse:[ |
7368 | 2163 |
(owner isNil or:[forceNameSpace]) ifTrue:[ |
2164 |
(ns notNil and:[ns ~~ Smalltalk]) ifTrue:[ |
|
2165 |
nsName := ns name. |
|
2166 |
(nsName includes:$:) ifTrue:[ |
|
2167 |
nsName := '''' , nsName , '''' |
|
2168 |
]. |
|
2169 |
aStream nextPutAll:'"{ NameSpace: '. |
|
2170 |
syntaxHilighting ifTrue:[aStream bold]. |
|
2171 |
aStream nextPutAll:nsName. |
|
2172 |
syntaxHilighting ifTrue:[aStream normal]. |
|
2173 |
aStream nextPutAll:' }"'; cr; cr. |
|
2174 |
] |
|
2175 |
]. |
|
1930
6a8b95d5f108
fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents:
1928
diff
changeset
|
2176 |
]. |
1741 | 2177 |
|
68 | 2178 |
"take care of nil-superclass" |
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2179 |
superclass := self superclass. |
1 | 2180 |
superclass isNil ifTrue:[ |
7368 | 2181 |
s := 'nil' |
1 | 2182 |
] ifFalse:[ |
7368 | 2183 |
superclassNamespace := superclass nameSpace. |
2184 |
||
2185 |
fullName ifTrue:[ |
|
2186 |
s := superclass name. |
|
6077
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
2187 |
"/ superclass == owner ifTrue:[ |
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
2188 |
"/ s := superclass nameWithoutNameSpacePrefix |
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
2189 |
"/ ] |
7368 | 2190 |
] ifFalse:[ |
2191 |
(ns == superclassNamespace |
|
2192 |
and:[superclass owningClass isNil]) ifTrue:[ |
|
2193 |
"/ superclass is in the same namespace and not private; |
|
2194 |
"/ still prepend namespace prefix for private classes, |
|
2195 |
"/ to avoid confusing stc, which needs that information. |
|
2196 |
"/ LATE note (AUG2002) - no longer; stc was fixed. |
|
6701 | 2197 |
"/ owner notNil ifTrue:[ |
2198 |
"/ s := superclass name |
|
2199 |
"/ ] ifFalse:[ |
|
7368 | 2200 |
s := superclass nameWithoutPrefix |
6701 | 2201 |
"/ ] |
7368 | 2202 |
] ifFalse:[ |
2203 |
"/ a very special (rare) situation: |
|
2204 |
"/ my superclass resides in another nameSpace, |
|
2205 |
"/ but there is something else named like this |
|
2206 |
"/ to be found in my nameSpace (or a private class) |
|
2207 |
||
2208 |
superNameWithoutNameSpacePrefix := superclass nameWithoutNameSpacePrefix asSymbol. |
|
2209 |
cls := self privateClassesAt:superNameWithoutNameSpacePrefix. |
|
2210 |
cls isNil ifTrue:[ |
|
2211 |
(topOwner := self topOwningClass) isNil ifTrue:[ |
|
2212 |
ns := self nameSpace. |
|
2213 |
ns notNil ifTrue:[ |
|
2214 |
cls := ns privateClassesAt:superNameWithoutNameSpacePrefix |
|
2215 |
] ifFalse:[ |
|
2216 |
"/ self error:'unexpected nil namespace' |
|
2217 |
] |
|
2218 |
] ifFalse:[ |
|
2219 |
cls := topOwner nameSpace at:superNameWithoutNameSpacePrefix. |
|
2220 |
] |
|
2221 |
]. |
|
2222 |
(cls notNil and:[cls ~~ superclass]) ifTrue:[ |
|
2223 |
s := superclassNamespace name , '::' , superNameWithoutNameSpacePrefix |
|
2224 |
] ifFalse:[ |
|
2225 |
"/ no class with that name found in my namespace ... |
|
2226 |
"/ if the superclass resides in Smalltalk, |
|
2227 |
"/ suppress prefix; otherwise, use full prefix. |
|
2228 |
(superclassNamespace notNil |
|
2229 |
and:[superclassNamespace ~~ Smalltalk]) ifTrue:[ |
|
2230 |
(owner notNil |
|
2231 |
and:[(topOwner := owner topOwningClass) notNil |
|
2232 |
and:[topOwner nameSpace == superclass topOwningClass "owningClass" nameSpace |
|
2233 |
]]) ifTrue:[ |
|
2234 |
s := superNameWithoutNameSpacePrefix |
|
2235 |
] ifFalse:[ |
|
2236 |
s := superclass name |
|
2237 |
] |
|
2238 |
] ifFalse:[ |
|
2239 |
s := superNameWithoutNameSpacePrefix |
|
2240 |
] |
|
2241 |
] |
|
2242 |
] |
|
2243 |
] |
|
1 | 2244 |
]. |
293 | 2245 |
|
2843
ccf00b7b1c8f
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2835
diff
changeset
|
2246 |
syntaxHilighting ifTrue:[aStream bold]. |
ccf00b7b1c8f
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2835
diff
changeset
|
2247 |
aStream nextPutAll:s. "/ superclass |
ccf00b7b1c8f
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2835
diff
changeset
|
2248 |
syntaxHilighting ifTrue:[aStream normal]. |
1707 | 2249 |
aStream space. |
2250 |
self basicFileOutInstvarTypeKeywordOn:aStream. |
|
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2251 |
|
2843
ccf00b7b1c8f
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2835
diff
changeset
|
2252 |
(fullName and:[owner isNil]) ifTrue:[ |
7368 | 2253 |
aStream nextPutAll:'#'''. |
2254 |
syntaxHilighting ifTrue:[aStream bold]. |
|
2255 |
aStream nextPutAll:(self name). |
|
2256 |
syntaxHilighting ifTrue:[aStream normal]. |
|
2257 |
aStream nextPutAll:''''. |
|
1741 | 2258 |
] ifFalse:[ |
7368 | 2259 |
aStream nextPut:$#. |
2260 |
syntaxHilighting ifTrue:[aStream bold]. |
|
2261 |
aStream nextPutAll:(self nameWithoutPrefix). |
|
2262 |
syntaxHilighting ifTrue:[aStream normal]. |
|
1741 | 2263 |
]. |
1 | 2264 |
|
345 | 2265 |
aStream crtab. |
738 | 2266 |
aStream nextPutAll:'instanceVariableNames:'''. |
2843
ccf00b7b1c8f
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2835
diff
changeset
|
2267 |
syntaxHilighting ifTrue:[aStream bold]. |
1 | 2268 |
self printInstVarNamesOn:aStream indent:16. |
2843
ccf00b7b1c8f
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2835
diff
changeset
|
2269 |
syntaxHilighting ifTrue:[aStream normal]. |
1 | 2270 |
aStream nextPutAll:''''. |
2271 |
||
345 | 2272 |
aStream crtab. |
738 | 2273 |
aStream nextPutAll:'classVariableNames:'''. |
2843
ccf00b7b1c8f
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2835
diff
changeset
|
2274 |
syntaxHilighting ifTrue:[aStream bold]. |
1 | 2275 |
self printClassVarNamesOn:aStream indent:16. |
2843
ccf00b7b1c8f
preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents:
2835
diff
changeset
|
2276 |
syntaxHilighting ifTrue:[aStream normal]. |
1 | 2277 |
aStream nextPutAll:''''. |
2278 |
||
345 | 2279 |
aStream crtab. |
738 | 2280 |
aStream nextPutAll:'poolDictionaries:'''''. |
1 | 2281 |
|
345 | 2282 |
aStream crtab. |
1741 | 2283 |
owner isNil ifTrue:[ |
7368 | 2284 |
"/ a public class |
2285 |
aStream nextPutAll:'category:'. |
|
2286 |
category isNil ifTrue:[ |
|
2287 |
s := '''''' |
|
2288 |
] ifFalse:[ |
|
2289 |
s := category asString storeString |
|
2290 |
]. |
|
2291 |
aStream nextPutAll:s. |
|
1 | 2292 |
] ifFalse:[ |
7368 | 2293 |
"/ a private class |
2294 |
aStream nextPutAll:'privateIn:'. |
|
2295 |
syntaxHilighting ifTrue:[aStream bold]. |
|
2296 |
fullName ifTrue:[ |
|
2297 |
s := owner name. |
|
2298 |
] ifFalse:[ |
|
2299 |
s := owner nameWithoutNameSpacePrefix. |
|
2300 |
]. |
|
2301 |
aStream nextPutAll:s. |
|
2302 |
syntaxHilighting ifTrue:[aStream normal]. |
|
1 | 2303 |
]. |
2304 |
aStream 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
|
2305 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2306 |
"Created: / 4.1.1997 / 20:38:16 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2307 |
"Modified: / 8.8.1997 / 10:59:50 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
2308 |
"Modified: / 18.3.1999 / 18:15:46 / stefan" |
1707 | 2309 |
! |
2310 |
||
2311 |
basicFileOutInstvarTypeKeywordOn:aStream |
|
2312 |
"a helper for fileOutDefinition" |
|
2313 |
||
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2314 |
|isVar superclass| |
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2315 |
|
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2316 |
superclass := self superclass. |
1707 | 2317 |
superclass isNil ifTrue:[ |
7368 | 2318 |
isVar := self isVariable |
1707 | 2319 |
] ifFalse:[ |
7368 | 2320 |
"I cant remember what this is for ?" |
2321 |
isVar := (self isVariable and:[superclass isVariable not]) |
|
1707 | 2322 |
]. |
2323 |
||
3920
0c1b9b2fa23b
added longlong indexed instvars;
Claus Gittinger <cg@exept.de>
parents:
3788
diff
changeset
|
2324 |
aStream nextPutAll:(self firstDefinitionSelectorPart). |
1707 | 2325 |
|
2326 |
"Created: 11.10.1996 / 18:57:29 / cg" |
|
1 | 2327 |
! |
2328 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2329 |
fileOut |
894
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2330 |
"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
|
2331 |
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
|
2332 |
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
|
2333 |
directory. Care is taken, to not clobber any existing file in |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2334 |
case of errors (for example: disk full). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2335 |
Also, since the classes methods need a valid sourcefile, the current |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2336 |
sourceFile may not be rewritten." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2337 |
|
3788
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2338 |
|baseName dirName nm fileName| |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2339 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2340 |
baseName := (Smalltalk fileNameForClass:self name). |
3788
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2341 |
nm := baseName asFilename withSuffix:'st'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2342 |
|
139 | 2343 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2344 |
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
|
2345 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2346 |
Project notNil ifTrue:[ |
7368 | 2347 |
dirName := Project currentProjectDirectory |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2348 |
] ifFalse:[ |
7368 | 2349 |
dirName := Filename currentDirectory |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2350 |
]. |
3788
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2351 |
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
|
2352 |
fileName makeLegalFilename. |
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2353 |
|
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2354 |
self fileOutAs:fileName name. |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2355 |
|
2771 | 2356 |
"/ " |
2357 |
"/ add a change record; that way, administration is much easier, |
|
2358 |
"/ since we can see in that changeBrowser, which changes have |
|
2359 |
"/ already found their way into a sourceFile and which must be |
|
2360 |
"/ applied again |
|
2361 |
"/ " |
|
2362 |
"/ self addChangeRecordForClassFileOut:self |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2363 |
|
3788
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2364 |
"Modified: / 7.6.1996 / 09:14:43 / stefan" |
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2365 |
"Modified: / 27.8.1998 / 02:02:57 / cg" |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2366 |
! |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2367 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2368 |
fileOutAllDefinitionsOn:aStream |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2369 |
"append expressions on aStream, which defines myself and all of my private classes." |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2370 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2371 |
self fileOutDefinitionOn:aStream. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2372 |
aStream nextPutChunkSeparator. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2373 |
aStream cr; cr. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2374 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2375 |
"/ |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2376 |
"/ optional classInstanceVariables |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2377 |
"/ |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2378 |
self class instanceVariableString isBlank ifFalse:[ |
7368 | 2379 |
self fileOutClassInstVarDefinitionOn:aStream. |
2380 |
aStream nextPutChunkSeparator. |
|
2381 |
aStream cr; cr |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2382 |
]. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2383 |
|
4288
51f416d3f15b
care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents:
4116
diff
changeset
|
2384 |
"/ here, the full nameSpace prefixes are output, |
51f416d3f15b
care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents:
4116
diff
changeset
|
2385 |
"/ to avoid confusing stc |
51f416d3f15b
care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents:
4116
diff
changeset
|
2386 |
"/ (which otherwise could not find the correct superclass) |
51f416d3f15b
care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents:
4116
diff
changeset
|
2387 |
"/ |
6520
430a6d467003
fileout private classes (no namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
6409
diff
changeset
|
2388 |
FileOutNameSpaceQuerySignal answer:false do:[ |
7368 | 2389 |
ForceNoNameSpaceQuerySignal answer:true do:[ |
2390 |
self privateClassesSorted do:[:aClass | |
|
2391 |
aClass fileOutAllDefinitionsOn:aStream |
|
2392 |
] |
|
2393 |
] |
|
4288
51f416d3f15b
care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents:
4116
diff
changeset
|
2394 |
]. |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2395 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2396 |
"Created: 15.10.1996 / 11:15:19 / cg" |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2397 |
"Modified: 22.3.1997 / 16:11:56 / cg" |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2398 |
! |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2399 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2400 |
fileOutAllMethodsOn:aStream |
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2401 |
self fileOutAllMethodsOn:aStream methodFilter:nil |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2402 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2403 |
"Created: 15.10.1996 / 11:13:00 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2404 |
"Modified: 22.3.1997 / 16:12:17 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2405 |
! |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2406 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2407 |
fileOutAllMethodsOn:aStream methodFilter:methodFilter |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2408 |
|collectionOfCategories| |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2409 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2410 |
collectionOfCategories := self class categories asSortedCollection. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2411 |
collectionOfCategories notNil ifTrue:[ |
7368 | 2412 |
collectionOfCategories do:[:aCategory | |
2413 |
self class fileOutCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2414 |
aStream cr |
|
2415 |
] |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2416 |
]. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2417 |
collectionOfCategories := self categories asSortedCollection. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2418 |
collectionOfCategories notNil ifTrue:[ |
7368 | 2419 |
collectionOfCategories do:[:aCategory | |
2420 |
self fileOutCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2421 |
aStream cr |
|
2422 |
] |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2423 |
]. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2424 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2425 |
self privateClassesSorted do:[:aClass | |
7368 | 2426 |
aClass fileOutAllMethodsOn:aStream methodFilter:methodFilter |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2427 |
]. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2428 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2429 |
"Created: 15.10.1996 / 11:13:00 / cg" |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2430 |
"Modified: 22.3.1997 / 16:12:17 / cg" |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2431 |
! |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2432 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2433 |
fileOutAs:fileNameString |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2434 |
"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
|
2435 |
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
|
2436 |
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
|
2437 |
Care is taken, to not clobber any existing file in |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2438 |
case of errors (for example: disk full). |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2439 |
Also, since the classes methods need a valid sourcefile, the current |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2440 |
sourceFile may not be rewritten." |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2441 |
|
2958
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
2442 |
|aStream fileName newFileName savFilename needRename |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2443 |
mySourceFileName sameFile s mySourceFileID anySourceRef| |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2444 |
|
3750
d544994a1c3e
in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents:
3702
diff
changeset
|
2445 |
self isLoaded ifFalse:[ |
7368 | 2446 |
^ FileOutErrorSignal |
2447 |
raiseRequestWith:self |
|
2448 |
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
|
2449 |
]. |
d544994a1c3e
in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents:
3702
diff
changeset
|
2450 |
|
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2451 |
fileName := fileNameString asFilename. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2452 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2453 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2454 |
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
|
2455 |
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
|
2456 |
and, if that worked rename afterwards ... |
153 | 2457 |
" |
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2458 |
(fileName exists) ifTrue:[ |
7368 | 2459 |
sameFile := false. |
2460 |
||
2461 |
"/ check carefully - maybe, my source does not really come from that |
|
2462 |
"/ file (i.e. all of my methods have their source as string) |
|
2463 |
||
2464 |
anySourceRef := false. |
|
2465 |
self instAndClassMethodsDo:[:m | |
|
2466 |
m sourcePosition notNil ifTrue:[ |
|
2467 |
anySourceRef := true |
|
2468 |
] |
|
2469 |
]. |
|
2470 |
||
2471 |
anySourceRef ifTrue:[ |
|
2472 |
s := self sourceStream. |
|
2473 |
s notNil ifTrue:[ |
|
2474 |
mySourceFileID := s pathName asFilename info id. |
|
2475 |
sameFile := (fileName info id) == mySourceFileID. |
|
2476 |
s close. |
|
2477 |
] ifFalse:[ |
|
2478 |
classFilename notNil ifTrue:[ |
|
2479 |
" |
|
2480 |
check for overwriting my current source file |
|
2481 |
this is not allowed, since it would clobber my methods source |
|
2482 |
file ... you have to save it to some other place. |
|
2483 |
This happens if you ask for a fileOut into the source-directory |
|
2484 |
(from which my methods get their source) |
|
2485 |
" |
|
2486 |
mySourceFileName := Smalltalk getSourceFileName:classFilename. |
|
2487 |
sameFile := (fileNameString = mySourceFileName). |
|
2488 |
sameFile ifFalse:[ |
|
2489 |
mySourceFileName notNil ifTrue:[ |
|
2490 |
sameFile := (fileName info id) == (mySourceFileName asFilename info id) |
|
2491 |
] |
|
2492 |
]. |
|
2493 |
] |
|
2494 |
]. |
|
2495 |
]. |
|
2496 |
||
2497 |
sameFile ifTrue:[ |
|
2498 |
^ FileOutErrorSignal |
|
2499 |
raiseRequestWith:fileNameString |
|
2500 |
errorString:(' - may not overwrite sourcefile:', fileNameString) |
|
2501 |
]. |
|
2502 |
||
2503 |
savFilename := Filename newTemporary. |
|
2504 |
fileName copyTo:savFilename. |
|
2505 |
newFileName := fileName withSuffix:'new'. |
|
2506 |
needRename := true |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2507 |
] ifFalse:[ |
7368 | 2508 |
"/ another possible trap: if my sourceFileName is |
2509 |
"/ the same as the written one AND the new files directory |
|
2510 |
"/ is along the sourcePath, we also need a temporary file |
|
2511 |
"/ first, to avoid accessing the newly written file. |
|
2512 |
||
2513 |
anySourceRef := false. |
|
2514 |
self instAndClassMethodsDo:[:m | |
|
2515 |
|mSrc| |
|
2516 |
||
2517 |
(mSrc := m sourceFilename) notNil ifTrue:[ |
|
2518 |
mSrc asFilename baseName = fileName baseName ifTrue:[ |
|
2519 |
anySourceRef := true |
|
2520 |
] |
|
2521 |
] |
|
2522 |
]. |
|
2523 |
anySourceRef ifTrue:[ |
|
2524 |
newFileName := fileName withSuffix:'new'. |
|
2525 |
needRename := true |
|
2526 |
] ifFalse:[ |
|
2527 |
newFileName := fileName. |
|
2528 |
needRename := false |
|
2529 |
] |
|
1 | 2530 |
]. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2531 |
[ |
7368 | 2532 |
aStream := newFileName writeStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2533 |
] on:FileStream openErrorSignal do:[:ex| |
7368 | 2534 |
savFilename notNil ifTrue:[ |
2535 |
savFilename delete |
|
2536 |
]. |
|
2537 |
^ FileOutErrorSignal |
|
2538 |
raiseRequestWith:newFileName |
|
2539 |
errorString:(' - cannot create file:', newFileName name) |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2540 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2541 |
self fileOutOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2542 |
aStream close. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2543 |
|
199 | 2544 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2545 |
finally, replace the old-file |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2546 |
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
|
2547 |
we have to do a copy ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2548 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2549 |
needRename ifTrue:[ |
7368 | 2550 |
newFileName copyTo:fileName. |
2551 |
newFileName delete |
|
2958
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
2552 |
]. |
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
2553 |
savFilename notNil ifTrue:[ |
7368 | 2554 |
savFilename delete |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2555 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2556 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2557 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2558 |
add a change record; that way, administration is much easier, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2559 |
since we can see in that changeBrowser, which changes have |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2560 |
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
|
2561 |
applied again |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2562 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2563 |
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
|
2564 |
|
3180
1c225dd8c5b2
care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2565 |
"Modified: / 7.6.1996 / 09:14:43 / stefan" |
1c225dd8c5b2
care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2566 |
"Created: / 16.4.1997 / 20:44:05 / cg" |
3750
d544994a1c3e
in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents:
3702
diff
changeset
|
2567 |
"Modified: / 12.8.1998 / 11:14:56 / cg" |
1753
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2568 |
! |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2569 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2570 |
fileOutClassInstVarDefinitionOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2571 |
"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
|
2572 |
|
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2573 |
self |
7368 | 2574 |
fileOutClassInstVarDefinitionOn:aStream |
2575 |
withNameSpace:false |
|
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2576 |
! |
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2577 |
|
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2578 |
fileOutClassInstVarDefinitionOn:aStream withNameSpace:withNameSpace |
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2579 |
"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
|
2580 |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2581 |
|anySuperClassInstVar| |
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2582 |
|
5296
12a5de62fef7
class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents:
5257
diff
changeset
|
2583 |
self isLoaded ifFalse:[ |
7368 | 2584 |
^ self basicFileOutDefinitionOn:aStream withNameSpace:withNameSpace |
5296
12a5de62fef7
class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents:
5257
diff
changeset
|
2585 |
]. |
12a5de62fef7
class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents:
5257
diff
changeset
|
2586 |
|
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2587 |
withNameSpace ifTrue:[ |
7368 | 2588 |
self name printOn:aStream. |
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2589 |
] ifFalse:[ |
7368 | 2590 |
self printClassNameOn:aStream. |
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2591 |
]. |
3338
0423dac35a45
dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
2592 |
aStream nextPutAll:' class instanceVariableNames:'''. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2593 |
self class printInstVarNamesOn:aStream indent:8. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2594 |
aStream nextPutAll:''''. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2595 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2596 |
"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
|
2597 |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2598 |
anySuperClassInstVar := false. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2599 |
self allSuperclassesDo:[:aSuperClass | |
7368 | 2600 |
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
|
2601 |
]. |
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2602 |
|
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2603 |
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
|
2604 |
anySuperClassInstVar ifFalse:[ |
7368 | 2605 |
aStream |
2606 |
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
|
2607 |
] ifTrue:[ |
7368 | 2608 |
aStream |
2609 |
nextPutLine:'The following class instance variables are inherited by this class:'. |
|
2610 |
aStream cr. |
|
2611 |
self allSuperclassesDo:[:aSuperClass | |
|
2612 |
aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '. |
|
2613 |
aStream nextPutLine:(aSuperClass class instanceVariableString). |
|
2614 |
]. |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2615 |
|
556 | 2616 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2617 |
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
|
2618 |
|
3338
0423dac35a45
dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
2619 |
"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
|
2620 |
"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
|
2621 |
"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
|
2622 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2623 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2624 |
fileOutCommentOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2625 |
"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
|
2626 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2627 |
|comment s| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2628 |
|
2011
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
2629 |
self printClassNameOn:aStream. |
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
2630 |
aStream nextPutAll:' comment:'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2631 |
(comment := self comment) isNil ifTrue:[ |
7368 | 2632 |
s := '''''' |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2633 |
] ifFalse:[ |
7368 | 2634 |
s := comment storeString |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2635 |
]. |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2636 |
aStream nextPutAllAsChunk:s. |
1063
b45a722a10c3
oops - forgot excla after comment-chunk
Claus Gittinger <cg@exept.de>
parents:
989
diff
changeset
|
2637 |
aStream nextPutChunkSeparator. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2638 |
aStream cr |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2639 |
|
2011
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
2640 |
"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
|
2641 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2642 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2643 |
fileOutDefinitionOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2644 |
"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
|
2645 |
|
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2646 |
^ self basicFileOutDefinitionOn:aStream withNameSpace:false |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2647 |
|
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2648 |
"Modified: 4.1.1997 / 20:55:18 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2649 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2650 |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2651 |
fileOutIn:aDirectoryName |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2652 |
"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
|
2653 |
directory aDirectoryName (ignoring any directory setting in |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2654 |
the current project). |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2655 |
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
|
2656 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2657 |
|aStream fileName| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2658 |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2659 |
fileName := (Smalltalk fileNameForClass:self name), '.st'. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2660 |
[ |
7368 | 2661 |
aStream := (aDirectoryName asFilename construct:fileName) writeStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2662 |
] on:FileStream openErrorSignal do:[:ex| |
7368 | 2663 |
^ FileOutErrorSignal |
2664 |
raiseRequestWith:fileName |
|
2665 |
errorString:(' - cannot create file:', fileName) |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2666 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2667 |
self fileOutOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2668 |
aStream close |
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2669 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2670 |
" |
7368 | 2671 |
self fileOutIn:'/tmp' |
2672 |
self fileOutIn:'/tmp/doesNotExistBla' |
|
2673 |
self fileOutIn:'/tmp' asFilename |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2674 |
" |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2675 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2676 |
"Modified: 19.9.1997 / 00:03:53 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2677 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2678 |
|
555 | 2679 |
fileOutOn:aStream |
2680 |
"file out my definition and all methods onto aStream" |
|
2681 |
||
2682 |
^ self fileOutOn:aStream withTimeStamp:true |
|
2683 |
||
2684 |
"Created: 15.11.1995 / 12:53:32 / cg" |
|
2046 | 2685 |
"Modified: 3.1.1997 / 17:50:28 / cg" |
555 | 2686 |
! |
2687 |
||
2688 |
fileOutOn:aStream withTimeStamp:stampIt |
|
3339
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2689 |
"file out my definition and all methods onto aStream. |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2690 |
If stampIt is true, a timeStamp comment is prepended." |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2691 |
|
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2692 |
self fileOutOn:aStream withTimeStamp:stampIt withInitialize:true |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2693 |
|
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2694 |
"Modified: / 13.3.1998 / 12:23:02 / cg" |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2695 |
! |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2696 |
|
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2697 |
fileOutOn:aStream withTimeStamp:stampIt withInitialize:initIt |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2698 |
"file out my definition and all methods onto aStream. |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2699 |
If stampIt is true, a timeStamp comment is prepended. |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2700 |
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
|
2701 |
append a corresponding doIt expression for initialization." |
555 | 2702 |
|
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2703 |
self |
7368 | 2704 |
fileOutOn:aStream |
2705 |
withTimeStamp:stampIt |
|
2706 |
withInitialize:initIt |
|
2707 |
withDefinition:true |
|
2708 |
methodFilter:nil |
|
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2709 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2710 |
"Created: / 15.11.1995 / 12:53:06 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2711 |
"Modified: / 1.4.1997 / 16:01:05 / stefan" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2712 |
"Modified: / 13.3.1998 / 12:23:59 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2713 |
! |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2714 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2715 |
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
|
2716 |
"file out my definition and all methods onto aStream. |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2717 |
If stampIt is true, a timeStamp comment is prepended. |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2718 |
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
|
2719 |
append a corresponding doIt expression for initialization. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2720 |
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
|
2721 |
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
|
2722 |
|
989 | 2723 |
|collectionOfCategories copyrightMethod copyrightText comment versionMethod skippedMethods |
6759
ef9508cda247
add doIt to #initialize for private classes
Claus Gittinger <cg@exept.de>
parents:
6731
diff
changeset
|
2724 |
meta classesImplementingInitialize| |
555 | 2725 |
|
2726 |
self isLoaded ifFalse:[ |
|
7368 | 2727 |
^ FileOutErrorSignal |
2728 |
raiseRequestWith:self |
|
2729 |
errorString:' - will not fileOut unloaded class: ', self name |
|
555 | 2730 |
]. |
2731 |
||
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2732 |
meta := self theMetaclass. |
989 | 2733 |
|
555 | 2734 |
" |
2735 |
if there is a copyright method, add a copyright comment |
|
2736 |
at the beginning, taking the string from the copyright method. |
|
2737 |
We cannot do this unconditionally - that would lead to my copyrights |
|
2738 |
being put on your code ;-). |
|
2739 |
On the other hand: I want every file created by myself to have the |
|
2740 |
copyright string at the beginning be preserved .... even if the |
|
2741 |
code was edited in the browser and filedOut. |
|
2742 |
" |
|
989 | 2743 |
(copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[ |
7368 | 2744 |
" |
2745 |
get the copyright methods source, |
|
2746 |
and insert at beginning. |
|
2747 |
" |
|
2748 |
copyrightText := copyrightMethod source. |
|
2749 |
copyrightText isNil ifTrue:[ |
|
2750 |
" |
|
2751 |
no source available - trigger an error |
|
2752 |
" |
|
2753 |
FileOutErrorSignal |
|
2754 |
raiseRequestWith:'no source for class ' , self name , ' available. Cannot fileOut'. |
|
2755 |
^ self |
|
2756 |
]. |
|
2757 |
" |
|
2758 |
strip off the selector-line |
|
2759 |
" |
|
2760 |
copyrightText := copyrightText asCollectionOfLines asStringCollection. |
|
2761 |
copyrightText := copyrightText copyFrom:2 to:(copyrightText size). |
|
717
a9d03e3c21cf
handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents:
708
diff
changeset
|
2762 |
"/ copyrightText do:[:line | aStream nextPutAll:line. aStream cr.]. |
7368 | 2763 |
copyrightText := copyrightText asString. |
2764 |
aStream nextPutAllAsChunk:copyrightText. |
|
555 | 2765 |
]. |
2766 |
||
2767 |
stampIt ifTrue:[ |
|
7368 | 2768 |
"/ |
2769 |
"/ first, a timestamp |
|
2770 |
"/ |
|
2771 |
aStream nextPutAll:(Smalltalk timeStamp). |
|
2772 |
aStream nextPutChunkSeparator. |
|
2773 |
aStream cr; cr. |
|
555 | 2774 |
]. |
2775 |
||
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2776 |
withDefinition ifTrue:[ |
7368 | 2777 |
"/ |
2778 |
"/ then the definition(s) |
|
2779 |
"/ |
|
2780 |
self fileOutAllDefinitionsOn:aStream. |
|
2781 |
"/ |
|
2782 |
"/ a comment - if any |
|
2783 |
"/ |
|
2784 |
(comment := self comment) notNil ifTrue:[ |
|
2785 |
self fileOutCommentOn:aStream. |
|
2786 |
aStream cr. |
|
2787 |
]. |
|
2788 |
"/ |
|
2789 |
"/ primitive definitions - if any |
|
2790 |
"/ |
|
2791 |
self fileOutPrimitiveSpecsOn:aStream. |
|
555 | 2792 |
]. |
2793 |
||
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2794 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2795 |
"/ methods from all categories in metaclass (i.e. class methods) |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2796 |
"/ EXCEPT: the version method is placed at the very end, to |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2797 |
"/ avoid sourcePosition-shifts when checked out later. |
1930
6a8b95d5f108
fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents:
1928
diff
changeset
|
2798 |
"/ (RCS expands this string, so its size is not constant) |
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2799 |
"/ |
989 | 2800 |
collectionOfCategories := meta categories asSortedCollection. |
555 | 2801 |
collectionOfCategories notNil ifTrue:[ |
7368 | 2802 |
"/ |
2803 |
"/ documentation first (if any), but not the version method |
|
2804 |
"/ |
|
2805 |
(collectionOfCategories includes:'documentation') ifTrue:[ |
|
2806 |
versionMethod := meta compiledMethodAt:(self nameOfVersionMethod). |
|
2807 |
versionMethod notNil ifTrue:[ |
|
2808 |
skippedMethods := Array with:versionMethod |
|
2809 |
]. |
|
2810 |
meta fileOutCategory:'documentation' except:skippedMethods only:nil methodFilter:methodFilter on:aStream. |
|
2811 |
aStream cr. |
|
2812 |
]. |
|
2813 |
||
2814 |
"/ |
|
2815 |
"/ initialization next (if any) |
|
2816 |
"/ |
|
2817 |
(collectionOfCategories includes:'initialization') ifTrue:[ |
|
2818 |
meta fileOutCategory:'initialization' methodFilter:methodFilter on:aStream. |
|
2819 |
aStream cr. |
|
2820 |
]. |
|
2821 |
||
2822 |
"/ |
|
2823 |
"/ instance creation next (if any) |
|
2824 |
"/ |
|
2825 |
(collectionOfCategories includes:'instance creation') ifTrue:[ |
|
2826 |
meta fileOutCategory:'instance creation' methodFilter:methodFilter on:aStream. |
|
2827 |
aStream cr. |
|
2828 |
]. |
|
2829 |
collectionOfCategories do:[:aCategory | |
|
2830 |
((aCategory ~= 'documentation') |
|
2831 |
and:[(aCategory ~= 'initialization') |
|
2832 |
and:[aCategory ~= 'instance creation']]) ifTrue:[ |
|
2833 |
meta fileOutCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2834 |
aStream cr |
|
2835 |
] |
|
2836 |
] |
|
555 | 2837 |
]. |
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2838 |
|
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2839 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2840 |
"/ methods from all categories in myself |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2841 |
"/ |
555 | 2842 |
collectionOfCategories := self categories asSortedCollection. |
2843 |
collectionOfCategories notNil ifTrue:[ |
|
7368 | 2844 |
collectionOfCategories do:[:aCategory | |
2845 |
self fileOutCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2846 |
aStream cr |
|
2847 |
] |
|
555 | 2848 |
]. |
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2849 |
|
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2850 |
"/ |
1743
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
2851 |
"/ any private classes' methods |
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
2852 |
"/ |
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
2853 |
self privateClassesSorted do:[:aClass | |
7368 | 2854 |
aClass fileOutAllMethodsOn:aStream methodFilter:methodFilter |
1743
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
2855 |
]. |
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
2856 |
|
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
2857 |
|
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
2858 |
"/ |
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2859 |
"/ finally, the previously skipped version method |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2860 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2861 |
versionMethod notNil ifTrue:[ |
7368 | 2862 |
meta fileOutCategory:'documentation' except:nil only:skippedMethods methodFilter:methodFilter on:aStream. |
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2863 |
]. |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2864 |
|
3339
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2865 |
initIt ifTrue:[ |
7368 | 2866 |
"/ |
2867 |
"/ optionally an initialize message |
|
2868 |
"/ |
|
2869 |
classesImplementingInitialize := OrderedCollection new. |
|
2870 |
||
2871 |
(meta includesSelector:#initialize) ifTrue:[ |
|
2872 |
classesImplementingInitialize add:self |
|
2873 |
]. |
|
2874 |
self privateClassesSorted do:[:aPrivateClass | |
|
2875 |
(aPrivateClass theMetaclass includesSelector:#initialize) ifTrue:[ |
|
2876 |
classesImplementingInitialize add:aPrivateClass |
|
2877 |
] |
|
2878 |
]. |
|
2879 |
classesImplementingInitialize size ~~ 0 ifTrue:[ |
|
2880 |
classesImplementingInitialize topologicalSort:[:a :b | b isSubclassOf:a]. |
|
2881 |
aStream cr. |
|
2882 |
classesImplementingInitialize do:[:eachClass | |
|
2883 |
eachClass printClassNameOn:aStream. aStream nextPutAll:' initialize'. |
|
2884 |
aStream nextPutChunkSeparator. |
|
2885 |
aStream cr. |
|
2886 |
]. |
|
2887 |
]. |
|
555 | 2888 |
] |
2889 |
||
3339
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2890 |
"Created: / 15.11.1995 / 12:53:06 / cg" |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2891 |
"Modified: / 1.4.1997 / 16:01:05 / stefan" |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2892 |
"Modified: / 13.3.1998 / 12:23:59 / cg" |
555 | 2893 |
! |
2894 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2895 |
fileOutPrimitiveDefinitionsOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2896 |
"append primitive defs (if any) to aStream." |
555 | 2897 |
|
2898 |
|s| |
|
2899 |
||
2900 |
" |
|
2901 |
primitive definitions - if any |
|
2902 |
" |
|
2903 |
(s := self primitiveDefinitionsString) notNil ifTrue:[ |
|
7368 | 2904 |
aStream nextPutChunkSeparator. |
2905 |
self printClassNameOn:aStream. |
|
2906 |
aStream nextPutAll:' primitiveDefinitions'; |
|
2907 |
nextPutChunkSeparator; |
|
2908 |
cr. |
|
2909 |
aStream nextPutAll:s. |
|
2910 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
555 | 2911 |
]. |
2912 |
(s := self primitiveVariablesString) notNil ifTrue:[ |
|
7368 | 2913 |
aStream nextPutChunkSeparator. |
2914 |
self printClassNameOn:aStream. |
|
2915 |
aStream nextPutAll:' primitiveVariables'; |
|
2916 |
nextPutChunkSeparator; |
|
2917 |
cr. |
|
2918 |
aStream nextPutAll:s. |
|
2919 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
555 | 2920 |
]. |
2088
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
2921 |
|
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
2922 |
"Modified: 8.1.1997 / 17:45:40 / cg" |
555 | 2923 |
! |
2924 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2925 |
fileOutPrimitiveSpecsOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2926 |
"append primitive defs (if any) to aStream." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2927 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2928 |
|s| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2929 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2930 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2931 |
primitive definitions - if any |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2932 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2933 |
self fileOutPrimitiveDefinitionsOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2934 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2935 |
primitive functions - if any |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2936 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2937 |
(s := self primitiveFunctionsString) notNil ifTrue:[ |
7368 | 2938 |
aStream nextPutChunkSeparator. |
2939 |
self printClassNameOn:aStream. |
|
2940 |
aStream nextPutAll:' primitiveFunctions'; |
|
2941 |
nextPutChunkSeparator; |
|
2942 |
cr. |
|
2943 |
aStream nextPutAll:s. |
|
2944 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2945 |
]. |
2088
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
2946 |
|
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
2947 |
"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
|
2948 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2949 |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2950 |
!Class methodsFor:'fileOut-binary'! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2951 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2952 |
binaryFileOut |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2953 |
"create a file 'class.cls' (in the current projects fileOut-directory), |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2954 |
consisting of all methods in myself in a portable binary format. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2955 |
The methods source is saved by reference |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2956 |
to the classes sourceFile if there is any. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2957 |
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
|
2958 |
browsable." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2959 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2960 |
self binaryFileOutWithSourceMode:#reference |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2961 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2962 |
"Modified: 5.1.1997 / 15:40:05 / cg" |
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 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2965 |
binaryFileOutOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2966 |
"append a binary representation of myself to aStream" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2967 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2968 |
self binaryFileOutOn:aStream sourceMode:#reference |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2969 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2970 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2971 |
binaryFileOutOn:aStream sourceMode:sourceMode |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2972 |
"append a binary representation of myself to aStream in |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2973 |
a portable binary format. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2974 |
The argument controls how sources are to be saved: |
7368 | 2975 |
#keep - include the source |
2976 |
#reference - include a reference to the sourceFile |
|
2977 |
#discard - dont save sources. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2978 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2979 |
With #reference, the sourceFile needs to be present after reload |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2980 |
in order to be browsable." |
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 |
|bos| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2983 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2984 |
bos := BinaryObjectStorage onNew:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2985 |
bos sourceMode:sourceMode. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2986 |
bos nextPutClasses:(Array with:self). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2987 |
bos close. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2988 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2989 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2990 |
binaryFileOutWithSourceMode:sourceMode |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2991 |
"create a file 'class.cls' (in the current projects fileOut-directory), |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2992 |
consisting of all methods in myself in a portable binary format. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2993 |
The argument controls how sources are to be saved: |
7368 | 2994 |
#keep - include the source |
2995 |
#reference - include a reference to the sourceFile |
|
2996 |
#discard - dont save sources. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2997 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2998 |
With #reference, the sourceFile needs to be present after reload |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2999 |
in order to be browsable." |
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 |
|baseName fileName dirName| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3002 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3003 |
baseName := (Smalltalk fileNameForClass:self name). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3004 |
fileName := baseName , '.cls'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3005 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3006 |
Project notNil ifTrue:[ |
7368 | 3007 |
dirName := Project currentProjectDirectory |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3008 |
] ifFalse:[ |
7368 | 3009 |
dirName := '.' |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3010 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3011 |
fileName := dirName asFilename construct:fileName. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3012 |
fileName makeLegalFilename. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3013 |
fileName := fileName name. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3014 |
self binaryFileOutWithSourceMode:sourceMode as:fileName. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3015 |
|
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 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3018 |
binaryFileOutWithSourceMode:sourceMode as:fileNameString |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3019 |
"create a file fileNameString, |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3020 |
consisting of all methods in myself in a portable binary format. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3021 |
The argument controls how sources are to be saved: |
7368 | 3022 |
#keep - include the source |
3023 |
#reference - include a reference to the sourceFile |
|
3024 |
#discard - dont save sources. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3025 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3026 |
With #reference, the sourceFile needs to be present after reload |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3027 |
in order to be browsable." |
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 |
|fileName aStream| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3030 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3031 |
fileName := fileNameString asFilename. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3032 |
fileName makeLegalFilename. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
3033 |
|
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
3034 |
[ |
7368 | 3035 |
aStream := fileName newReadWriteStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
3036 |
] on:FileStream openErrorSignal do:[:ex| |
7368 | 3037 |
^ FileOutErrorSignal |
3038 |
raiseRequestWith:fileName name |
|
3039 |
errorString:(' - cannot create file:', fileName name) |
|
5374
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 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3042 |
aStream binary. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3043 |
self binaryFileOutOn:aStream sourceMode:sourceMode. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3044 |
aStream close. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3045 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3046 |
"Created: / 29.12.1998 / 21:38:38 / cg" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3047 |
! ! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3048 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3049 |
!Class methodsFor:'fileOut-xml'! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3050 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3051 |
fileOutXML |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3052 |
"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
|
3053 |
XML sourceForm. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3054 |
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
|
3055 |
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
|
3056 |
case of errors (for example: disk full)" |
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 |
|baseName dirName nm fileName| |
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 |
baseName := (Smalltalk fileNameForClass:self name). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3061 |
nm := baseName asFilename withSuffix:'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 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3064 |
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
|
3065 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3066 |
Project notNil ifTrue:[ |
7368 | 3067 |
dirName := Project currentProjectDirectory |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3068 |
] ifFalse:[ |
7368 | 3069 |
dirName := Filename currentDirectory |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3070 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3071 |
fileName := (dirName asFilename construct:nm). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3072 |
fileName makeLegalFilename. |
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 |
self fileOutXMLAs:fileName. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3075 |
|
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 |
Class fileOutXML |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3078 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3079 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3080 |
|
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 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3083 |
fileOutXMLAllDefinitionsOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3084 |
"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
|
3085 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3086 |
self fileOutXMLDefinitionOn:aStream. |
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 |
"/ here, the full nameSpace prefixes are output, |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3089 |
"/ to avoid confusing stc |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3090 |
"/ (which otherwise could not find the correct superclass) |
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 |
FileOutNameSpaceQuerySignal answer:true do:[ |
7368 | 3093 |
self privateClassesSorted do:[:aClass | |
3094 |
aClass fileOutXMLAllDefinitionsOn:aStream |
|
3095 |
] |
|
5374
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 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3098 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3099 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3100 |
|
5464 | 3101 |
fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter |
3102 |
|collectionOfCategories| |
|
3103 |
||
3104 |
collectionOfCategories := self class categories asSortedCollection. |
|
3105 |
collectionOfCategories notNil ifTrue:[ |
|
7368 | 3106 |
collectionOfCategories do:[:aCategory | |
3107 |
self class fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
3108 |
aStream cr |
|
3109 |
] |
|
5464 | 3110 |
]. |
3111 |
collectionOfCategories := self categories asSortedCollection. |
|
3112 |
collectionOfCategories notNil ifTrue:[ |
|
7368 | 3113 |
collectionOfCategories do:[:aCategory | |
3114 |
self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
3115 |
aStream cr |
|
3116 |
] |
|
5464 | 3117 |
]. |
3118 |
||
3119 |
self privateClassesSorted do:[:aClass | |
|
7368 | 3120 |
aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter |
5464 | 3121 |
]. |
3122 |
||
3123 |
! |
|
3124 |
||
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3125 |
fileOutXMLAs:fileNameOrString |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3126 |
"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
|
3127 |
XML sourceForm. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3128 |
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
|
3129 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3130 |
|aStream fileName| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3131 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3132 |
self isLoaded ifFalse:[ |
7368 | 3133 |
^ FileOutErrorSignal |
3134 |
raiseRequestWith:self |
|
3135 |
errorString:' - will not fileOut unloaded class: ', self name |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3136 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3137 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3138 |
fileName := fileNameOrString asFilename. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
3139 |
[ |
7368 | 3140 |
aStream := fileName writeStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
3141 |
] on:FileStream openErrorSignal do:[:ex| |
7368 | 3142 |
^ FileOutErrorSignal |
3143 |
raiseRequestWith:fileName |
|
3144 |
errorString:(' - cannot create file: ', fileName 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 |
self fileOutXMLOn:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3147 |
aStream close. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3148 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3149 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3150 |
Class fileOutXMLAs:'test.xml' |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
3151 |
Class fileOutXMLAs:'/blaDoesNotExist/test.xml' |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3152 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3153 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3154 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3155 |
fileOutXMLDefinitionOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3156 |
"append an xml expression on aStream, which defines myself." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3157 |
|
6703 | 3158 |
|varNames| |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3159 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3160 |
aStream nextPutLine:'<class>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3161 |
|
5464 | 3162 |
aStream nextPutAll:' <name>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3163 |
aStream nextPutAll:(self nameWithoutPrefix). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3164 |
aStream nextPutLine:'</name>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3165 |
|
5464 | 3166 |
aStream nextPutAll:' <environment>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3167 |
aStream nextPutAll:(self nameSpace name). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3168 |
aStream nextPutLine:'</environment>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3169 |
|
5464 | 3170 |
aStream nextPutAll:' <super>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3171 |
aStream nextPutAll:(self theNonMetaclass superclass name). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3172 |
aStream nextPutLine:'</super>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3173 |
|
5464 | 3174 |
aStream nextPutAll:' <private>'. |
3175 |
aStream nextPutAll:(self isPrivate printString). |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3176 |
aStream nextPutLine:'</private>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3177 |
|
5464 | 3178 |
aStream nextPutAll:' <indexed-type>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3179 |
aStream nextPutAll:'none'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3180 |
aStream nextPutLine:'</indexed-type>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3181 |
|
5464 | 3182 |
aStream nextPutAll:' <inst-vars>'. |
3183 |
varNames := self instVarNames. |
|
3184 |
varNames size > 0 ifTrue:[ |
|
7368 | 3185 |
aStream cr. |
3186 |
varNames do:[:nm | |
|
3187 |
aStream nextPutAll:' <name>'. |
|
3188 |
aStream nextPutAll:nm. |
|
3189 |
aStream nextPutLine:'</name>'. |
|
3190 |
]. |
|
3191 |
aStream nextPutAll:' '. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3192 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3193 |
aStream nextPutLine:'</inst-vars>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3194 |
|
5464 | 3195 |
aStream nextPutAll:' <class-inst-vars>'. |
3196 |
varNames := self class instVarNames. |
|
3197 |
varNames size > 0 ifTrue:[ |
|
7368 | 3198 |
aStream cr. |
3199 |
varNames do:[:nm | |
|
3200 |
aStream nextPutAll:' <name>'. |
|
3201 |
aStream nextPutAll:nm. |
|
3202 |
aStream nextPutLine:'</name>'. |
|
3203 |
]. |
|
3204 |
aStream nextPutAll:' '. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3205 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3206 |
aStream nextPutLine:'</class-inst-vars>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3207 |
|
5464 | 3208 |
aStream nextPutAll:' <imports>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3209 |
aStream nextPutAll:''. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3210 |
aStream nextPutLine:'</imports>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3211 |
|
5464 | 3212 |
aStream nextPutAll:' <category>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3213 |
aStream nextPutAll:self category. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3214 |
aStream nextPutLine:'</category>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3215 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3216 |
aStream nextPutLine:'</class>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3217 |
|
5464 | 3218 |
varNames := self classVarNames. |
3219 |
varNames size > 0 ifTrue:[ |
|
7368 | 3220 |
varNames do:[:nm | |
3221 |
aStream nextPutLine:'<static>'. |
|
3222 |
aStream nextPutAll:' <name>'. |
|
3223 |
aStream nextPutAll:nm. |
|
3224 |
aStream nextPutLine:'</name>'. |
|
3225 |
aStream nextPutAll:' <environment>'. |
|
3226 |
aStream nextPutAll:self name. |
|
3227 |
aStream nextPutLine:'</environment>'. |
|
3228 |
aStream nextPutLine:'</static>'. |
|
3229 |
]. |
|
5464 | 3230 |
]. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3231 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3232 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3233 |
fileOutXMLOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3234 |
"WARNING: untested first version. Not for general use (yet) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3235 |
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
|
3236 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3237 |
self |
7368 | 3238 |
fileOutXMLOn:aStream |
3239 |
withTimeStamp:true |
|
3240 |
withInitialize:true |
|
3241 |
withDefinition:true |
|
3242 |
methodFilter:nil |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3243 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3244 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3245 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3246 |
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
|
3247 |
"WARNING: untested first version. Not for general use (yet) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3248 |
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
|
3249 |
If stampIt is true, a timeStamp comment is prepended. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3250 |
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
|
3251 |
append a corresponding doIt expression for initialization. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3252 |
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
|
3253 |
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
|
3254 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3255 |
|collectionOfCategories copyrightMethod copyrightText comment meta| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3256 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3257 |
self isLoaded ifFalse:[ |
7368 | 3258 |
^ FileOutErrorSignal |
3259 |
raiseRequestWith:self |
|
3260 |
errorString:' - will not fileOut unloaded class: ', self name |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3261 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3262 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3263 |
meta := self class. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3264 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3265 |
aStream nextPutLine:'<?xml version="1.0"?>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3266 |
aStream nextPutLine:'<st-source>'. |
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 |
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
|
3270 |
taking the string from the copyright method. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3271 |
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
|
3272 |
being put on your code ;-). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3273 |
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
|
3274 |
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
|
3275 |
code was edited in the browser and filedOut. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3276 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3277 |
(copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[ |
7368 | 3278 |
" |
3279 |
get the copyright methods source, |
|
3280 |
and insert at beginning. |
|
3281 |
" |
|
3282 |
copyrightText := copyrightMethod source. |
|
3283 |
copyrightText isNil ifTrue:[ |
|
3284 |
" |
|
3285 |
no source available - trigger an error |
|
3286 |
" |
|
3287 |
FileOutErrorSignal |
|
3288 |
raiseRequestWith:' - no source for class: '. |
|
3289 |
^ self |
|
3290 |
]. |
|
3291 |
" |
|
3292 |
strip off the selector-line |
|
3293 |
" |
|
3294 |
copyrightText := copyrightText asCollectionOfLines asStringCollection. |
|
3295 |
copyrightText := copyrightText copyFrom:2 to:(copyrightText size). |
|
3296 |
[copyrightText last isEmpty] whileTrue:[ |
|
3297 |
copyrightText := copyrightText copyWithoutLast:1. |
|
3298 |
]. |
|
3299 |
(copyrightText first = '"') ifTrue:[ |
|
3300 |
(copyrightText last = '"') ifTrue:[ |
|
3301 |
copyrightText := copyrightText copyFrom:2 to:(copyrightText size - 1). |
|
3302 |
] |
|
3303 |
]. |
|
3304 |
copyrightText := copyrightText asString. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3305 |
|
7368 | 3306 |
aStream nextPutAll:'<copyright>'. |
3307 |
self fileOutXMLString:copyrightText on:aStream. |
|
3308 |
aStream nextPutLine:'</copyright>'. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3309 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3310 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3311 |
stampIt ifTrue:[ |
7368 | 3312 |
"/ |
3313 |
"/ first, a timestamp |
|
3314 |
"/ |
|
3315 |
aStream nextPutAll:'<time-stamp>'. |
|
3316 |
self fileOutXMLString:(Smalltalk timeStampString) on:aStream. |
|
3317 |
aStream nextPutLine:'</time-stamp>'. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3318 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3319 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3320 |
withDefinition ifTrue:[ |
7368 | 3321 |
"/ |
3322 |
"/ then the definition |
|
3323 |
"/ |
|
3324 |
self fileOutXMLAllDefinitionsOn:aStream. |
|
3325 |
"/ |
|
3326 |
"/ a comment - if any |
|
3327 |
"/ |
|
3328 |
(comment := self comment) notNil ifTrue:[ |
|
3329 |
aStream nextPutLine:'<comment>'. |
|
3330 |
aStream nextPutAll:'<class-id>'. |
|
3331 |
aStream nextPutAll:(self name). |
|
3332 |
aStream nextPutLine:'</class-id>'. |
|
3333 |
aStream nextPutLine:'</comment>'. |
|
3334 |
]. |
|
3335 |
"/ |
|
3336 |
"/ primitive definitions - if any |
|
3337 |
"/ |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3338 |
"/ self fileOutPrimitiveSpecsOn:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3339 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3340 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3341 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3342 |
"/ 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
|
3343 |
"/ 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
|
3344 |
"/ avoid sourcePosition-shifts when checked out later. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3345 |
"/ (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
|
3346 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3347 |
collectionOfCategories := meta categories asSortedCollection. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3348 |
collectionOfCategories notNil ifTrue:[ |
7368 | 3349 |
collectionOfCategories do:[:aCategory | |
3350 |
meta fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
3351 |
] |
|
5374
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 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3354 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3355 |
"/ methods from all categories in myself |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3356 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3357 |
collectionOfCategories := self categories asSortedCollection. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3358 |
collectionOfCategories notNil ifTrue:[ |
7368 | 3359 |
collectionOfCategories do:[:aCategory | |
3360 |
self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
3361 |
] |
|
5374
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 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3364 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3365 |
"/ any private classes' methods |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3366 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3367 |
self privateClassesSorted do:[:aClass | |
7368 | 3368 |
aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter |
5374
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 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3372 |
initIt ifTrue:[ |
7368 | 3373 |
"/ |
3374 |
"/ optionally an initialize message |
|
3375 |
"/ |
|
3376 |
(meta includesSelector:#initialize) ifTrue:[ |
|
3377 |
aStream nextPutLine:'<initialize>'. |
|
3378 |
aStream nextPutAll:'<class-id>'. |
|
3379 |
aStream nextPutAll:(self name). |
|
3380 |
aStream nextPutLine:'</class-id>'. |
|
3381 |
aStream nextPutLine:'</initialize>'. |
|
3382 |
] |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3383 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3384 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3385 |
aStream nextPutLine:'</st-source>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3386 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3387 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3388 |
Class |
7368 | 3389 |
fileOutXMLOn:'test.xml' asFilename writeStream |
3390 |
withTimeStamp:true |
|
3391 |
withInitialize:true |
|
3392 |
withDefinition:true |
|
3393 |
methodFilter:nil |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3394 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3395 |
! ! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3396 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3397 |
!Class methodsFor:'printOut'! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3398 |
|
2482 | 3399 |
htmlDocumentation |
7227
5df22f2ffebc
htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents:
7222
diff
changeset
|
3400 |
self obsoleteMethodWarning:'use HTMLDocGenerator htmlDocOf:'. |
5df22f2ffebc
htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents:
7222
diff
changeset
|
3401 |
|
2482 | 3402 |
^ HTMLDocGenerator htmlDocOf:self |
3403 |
||
3404 |
"Created: 22.3.1997 / 14:18:23 / cg" |
|
3405 |
! |
|
3406 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3407 |
printClassVarNamesOn:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3408 |
"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
|
3409 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3410 |
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
|
3411 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3412 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3413 |
printFullHierarchyOn:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3414 |
"print myself and all subclasses on aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3415 |
recursively calls itself to print subclasses. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3416 |
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
|
3417 |
|
1996
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3418 |
|nm| |
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3419 |
|
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3420 |
nm := self name. |
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3421 |
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
|
3422 |
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
|
3423 |
aStream nextPutLine:')'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3424 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3425 |
(self subclasses sort:[:a :b | a name < b name]) do:[:aSubclass | |
7368 | 3426 |
aSubclass printFullHierarchyOn:aStream indent:(indent + 2) |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3427 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3428 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3429 |
"|printStream| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3430 |
printStream := Printer new. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3431 |
Object printFullHierarchyOn:printStream indent:0. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3432 |
printStream close" |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3433 |
|
1996
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3434 |
"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
|
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 |
printOutDefinitionOn:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3438 |
"print out my definition" |
1 | 3439 |
|
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
3440 |
|comment s superclass| |
333 | 3441 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3442 |
aPrintStream nextPutAll:'class '; bold; nextPutLine:self name; normal. |
1 | 3443 |
aPrintStream nextPutAll:'superclass '. |
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
3444 |
superclass := self superclass. |
1 | 3445 |
superclass isNil ifTrue:[ |
7368 | 3446 |
s := 'Object' |
1 | 3447 |
] ifFalse:[ |
7368 | 3448 |
s := superclass name |
1 | 3449 |
]. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3450 |
aPrintStream nextPutLine:s. |
1 | 3451 |
|
3452 |
aPrintStream nextPutAll:'instance Variables '. |
|
3453 |
self printInstVarNamesOn:aPrintStream indent:21. |
|
3454 |
aPrintStream cr. |
|
3455 |
||
3456 |
aPrintStream nextPutAll:'class Variables '. |
|
3457 |
self printClassVarNamesOn:aPrintStream indent:21. |
|
3458 |
aPrintStream cr. |
|
3459 |
||
3460 |
category notNil ifTrue:[ |
|
7368 | 3461 |
aPrintStream nextPutAll:'category '; |
3462 |
nextPutLine:(category printString). |
|
1 | 3463 |
]. |
3464 |
||
193 | 3465 |
(comment := self comment) notNil ifTrue:[ |
7368 | 3466 |
aPrintStream cr; nextPutLine:'comment:'; italic; nextPutLine:comment; normal |
1 | 3467 |
] |
733
983d045c17f5
make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
3468 |
|
983d045c17f5
make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
3469 |
"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
|
3470 |
"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
|
3471 |
"Modified: 1.4.1997 / 16:01:26 / stefan" |
1 | 3472 |
! |
3473 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3474 |
printOutOn:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3475 |
"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
|
3476 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3477 |
|collectionOfCategories| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3478 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3479 |
self printOutDefinitionOn:aPrintStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3480 |
aPrintStream cr. |
3937 | 3481 |
collectionOfCategories := self class categories asSortedCollection. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3482 |
collectionOfCategories notNil ifTrue:[ |
7368 | 3483 |
aPrintStream nextPutLine:'class protocol'. |
3484 |
aPrintStream cr. |
|
3485 |
collectionOfCategories do:[:aCategory | |
|
3486 |
self class printOutCategory:aCategory on:aPrintStream |
|
3487 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3488 |
]. |
3937 | 3489 |
collectionOfCategories := self categories asSortedCollection. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3490 |
collectionOfCategories notNil ifTrue:[ |
7368 | 3491 |
aPrintStream nextPutLine:'instance protocol'. |
3492 |
aPrintStream cr. |
|
3493 |
collectionOfCategories do:[:aCategory | |
|
3494 |
self printOutCategory:aCategory on:aPrintStream |
|
3495 |
] |
|
555 | 3496 |
] |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3497 |
|
3937 | 3498 |
"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
|
3499 |
! |
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3500 |
|
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3501 |
storeOn:aStream |
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3502 |
"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
|
3503 |
|
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3504 |
aStream nextPutAll:self name |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3505 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3506 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3507 |
!Class methodsFor:'private-accessing'! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3508 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3509 |
attributes |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3510 |
"return the extra class attributes or nil" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3511 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3512 |
attributes isArray ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3513 |
attributes := ClassAttributes new fromSTCPrimitiveArray:attributes. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3514 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3515 |
^ attributes |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3516 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3517 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3518 |
attributes:aClassAttributesObject |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3519 |
"set the extra class attributes" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3520 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3521 |
attributes := aClassAttributesObject |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3522 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3523 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3524 |
getAttribute:aKey |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3525 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3526 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3527 |
"get an attribute (by symbolic key)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3528 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3529 |
attributes isNil ifTrue:[ ^ nil]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3530 |
^ self attributes perform:aKey asSymbol |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3531 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3532 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3533 |
getSourceChunkAttribute:aKey |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3534 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3535 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3536 |
|pos classFilename stream string| |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3537 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3538 |
pos := self getAttribute:aKey. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3539 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3540 |
"the attribute is either a string, or an integer specifying the |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3541 |
position within the classes sourcefile ... |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3542 |
" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3543 |
pos isNumber ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3544 |
"/ classFilename notNil ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3545 |
stream := self sourceStream. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3546 |
stream notNil ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3547 |
stream position0Based:pos. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3548 |
string := stream nextChunk. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3549 |
stream close. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3550 |
^ string |
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 |
"/ ]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3553 |
^ nil |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3554 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3555 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3556 |
^ pos |
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 |
setAttribute:key to:aValue |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3560 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3561 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3562 |
attributes isNil ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3563 |
attributes := ClassAttributes new. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3564 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3565 |
self attributes perform:(key , ':') asSymbol with:aValue |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3566 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3567 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3568 |
setPrimitiveDefinitions:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3569 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3570 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3571 |
"set the primitiveDefinition string (no change notifications)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3572 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3573 |
^ self setAttribute:#primitiveDefinitions to:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3574 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3575 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3576 |
setPrimitiveFunctions:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3577 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3578 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3579 |
"set the primitiveFunction string (no change notifications)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3580 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3581 |
^ self setAttribute:#primitiveFunctions to:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3582 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3583 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3584 |
setPrimitiveVariables:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3585 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3586 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3587 |
"set the primitiveVariable string (no change notifications)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3588 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3589 |
^ 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
|
3590 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3591 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3592 |
setSuperclass:aClass |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3593 |
"set the superclass of the receiver. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3594 |
this method is for special uses only - there will be no recompilation |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3595 |
and no change record written here. Also, if the receiver class has |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3596 |
already been in use, future operation of the system is not guaranteed to |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3597 |
be correct, since no caches are flushed. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3598 |
Therefore: do NOT use it; use Behavior>>superclass: (or flush the caches, at least). |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3599 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3600 |
Redefined here to take care of subclass caching" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3601 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3602 |
|info| |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3603 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3604 |
SubclassInfo notNil ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3605 |
"/ flush/update the subclass information |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3606 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3607 |
"/ if my class is already contained |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3608 |
(info := SubclassInfo at:aClass ifAbsent:nil) notNil ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3609 |
info add:self |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3610 |
] ifFalse:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3611 |
SubclassInfo := nil. "/ flush it |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3612 |
] |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3613 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3614 |
super setSuperclass:aClass |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3615 |
! ! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3616 |
|
7258 | 3617 |
!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
|
3618 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3619 |
addChangeRecordForChangeCategory:category to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3620 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3621 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3622 |
"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
|
3623 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3624 |
self printClassNameOn:aStream. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3625 |
aStream nextPutAll:(' category:' , category storeString). |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3626 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3627 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3628 |
"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
|
3629 |
"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
|
3630 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3631 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3632 |
addChangeRecordForClass:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3633 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3634 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3635 |
"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
|
3636 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3637 |
aClass isLoaded ifTrue:[ |
7368 | 3638 |
aClass basicFileOutDefinitionOn:aStream withNameSpace:true. |
3639 |
aStream nextPutChunkSeparator. |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3640 |
] |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3641 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3642 |
"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
|
3643 |
"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
|
3644 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3645 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3646 |
addChangeRecordForClassComment:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3647 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3648 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3649 |
"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
|
3650 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3651 |
aClass fileOutCommentOn:aStream. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3652 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3653 |
"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
|
3654 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3655 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3656 |
addChangeRecordForClassInstvars:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3657 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3658 |
|
5225
d74b4c895376
comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents:
5190
diff
changeset
|
3659 |
"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
|
3660 |
|
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
3661 |
aClass 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
|
3662 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3663 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3664 |
|
7179 | 3665 |
addChangeRecordForClassRemove:oldClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3666 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3667 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3668 |
"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
|
3669 |
|
7179 | 3670 |
aStream nextPutAll:('Smalltalk removeClass:' , oldClass name). |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3671 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3672 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3673 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3674 |
addChangeRecordForClassRename:oldName to:newName to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3675 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3676 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3677 |
"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
|
3678 |
|
1846 | 3679 |
aStream nextPutAll:('Smalltalk renameClass:' , oldName, ' to:''' , newName , ''''). |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3680 |
aStream nextPutChunkSeparator. |
1846 | 3681 |
|
3682 |
"Modified: 30.10.1996 / 20:27:02 / cg" |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3683 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3684 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3685 |
addChangeRecordForPrimitiveDefinitions:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3686 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3687 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3688 |
"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
|
3689 |
|
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3690 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveDefinitions:'''; |
7368 | 3691 |
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
|
3692 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3693 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3694 |
"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
|
3695 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3696 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3697 |
addChangeRecordForPrimitiveFunctions:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3698 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3699 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3700 |
"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
|
3701 |
|
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3702 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveFunctions:'''; |
7368 | 3703 |
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
|
3704 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3705 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3706 |
"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
|
3707 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3708 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3709 |
addChangeRecordForPrimitiveVariables:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3710 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3711 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3712 |
"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
|
3713 |
|
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3714 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveVariables:'''; |
7368 | 3715 |
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
|
3716 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3717 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3718 |
"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
|
3719 |
! ! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3720 |
|
1237 | 3721 |
!Class methodsFor:'protocol printOut'! |
3722 |
||
3723 |
printOutProtocolOn:aPrintStream |
|
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3724 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3725 |
|
1237 | 3726 |
|collectionOfCategories| |
3727 |
||
3728 |
self printOutDefinitionOn:aPrintStream. |
|
3729 |
aPrintStream cr. |
|
3937 | 3730 |
collectionOfCategories := self class categories asSortedCollection. |
1237 | 3731 |
collectionOfCategories notNil ifTrue:[ |
7368 | 3732 |
aPrintStream nextPutLine:'class protocol'. |
3733 |
aPrintStream cr. |
|
3734 |
collectionOfCategories do:[:aCategory | |
|
3735 |
self class printOutCategoryProtocol:aCategory on:aPrintStream |
|
3736 |
] |
|
1237 | 3737 |
]. |
3937 | 3738 |
collectionOfCategories := self categories asSortedCollection. |
1237 | 3739 |
collectionOfCategories notNil ifTrue:[ |
7368 | 3740 |
aPrintStream nextPutLine:'instance protocol'. |
3741 |
aPrintStream cr. |
|
3742 |
collectionOfCategories do:[:aCategory | |
|
3743 |
self printOutCategoryProtocol:aCategory on:aPrintStream |
|
3744 |
] |
|
1237 | 3745 |
] |
3746 |
||
3937 | 3747 |
"Modified: / 25.11.1998 / 12:40:38 / cg" |
1237 | 3748 |
! ! |
3749 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3750 |
!Class methodsFor:'queries'! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3751 |
|
5545 | 3752 |
hasExtensions |
3753 |
"return true, if there are methods in the receiver, which belong to |
|
3754 |
a different package (i.e. package of class ~= package of method). |
|
3755 |
Those are class extensions, which must be treated specially when checking classes |
|
3756 |
into the sourceCode repository. (extensions are stored separate)" |
|
3757 |
||
6166 | 3758 |
|clsPkg defaultPkg| |
3759 |
||
3760 |
defaultPkg := Project defaultProject package. |
|
3761 |
clsPkg := self package. |
|
6077
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
3762 |
self instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
7368 | 3763 |
|mthdPkg| |
3764 |
||
3765 |
mthdPkg := mthd package. |
|
3766 |
mthdPkg ~= clsPkg ifTrue:[ |
|
3767 |
mthdPkg ~= defaultPkg ifTrue:[ |
|
3768 |
^ true |
|
3769 |
] |
|
3770 |
]. |
|
5545 | 3771 |
]. |
3772 |
^ false |
|
3773 |
||
3774 |
" |
|
3775 |
Smalltalk allClasses select:[:each | each hasExtensions] |
|
3776 |
" |
|
3777 |
! |
|
3778 |
||
5659 | 3779 |
hasExtensionsFrom:aPackageID |
3780 |
"return true, if there are methods in the receiver, which belong to |
|
3781 |
the package with aPackageID (i.e. package of class ~= package of method). |
|
3782 |
Those are class extensions, which must be treated specially when checking classes |
|
3783 |
into the sourceCode repository. (extensions are stored separate)" |
|
3784 |
||
6077
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
3785 |
self instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
7368 | 3786 |
mthd package = aPackageID ifTrue:[^ true]. |
5659 | 3787 |
]. |
3788 |
^ false |
|
3789 |
||
3790 |
" |
|
3791 |
Smalltalk allClasses select:[:each | each hasExtensionsFrom:'stx:goodies/refactyBrowser'] |
|
3792 |
" |
|
3793 |
! |
|
3794 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3795 |
isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3796 |
"return true, if the receiver is some kind of class |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3797 |
(a real class, not just behavior); |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3798 |
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
|
3799 |
See also Behavior>>isBehavior." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3800 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3801 |
^ true |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3802 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3803 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3804 |
Point isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3805 |
1 isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3806 |
Behavior new isBehavior |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3807 |
Behavior new isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3808 |
Class new isBehavior |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3809 |
Class new isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3810 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3811 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3812 |
|
6723 | 3813 |
isStartableWithMain |
3814 |
"return true, if this is an application class, |
|
3815 |
which can be started via #main" |
|
3816 |
||
3817 |
^ self theMetaclass includesSelector:#main |
|
3818 |
||
3819 |
"Created: / 2.11.2001 / 09:37:01 / cg" |
|
3820 |
"Modified: / 2.11.2001 / 09:48:05 / cg" |
|
3821 |
! |
|
3822 |
||
2568
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3823 |
rootsOfTheWorld |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3824 |
"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
|
3825 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3826 |
|set| |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3827 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3828 |
set := IdentitySet new. |
5581 | 3829 |
Smalltalk allClassesDo:[:aClass | |
7368 | 3830 |
aClass superclass isNil ifTrue:[set add:aClass] |
2568
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3831 |
]. |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3832 |
^ set asOrderedCollection |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3833 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3834 |
" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3835 |
Class rootsOfTheWorld |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3836 |
" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3837 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3838 |
"Modified: 18.4.1997 / 20:55:34 / cg" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3839 |
! |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3840 |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3841 |
subclasses |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3842 |
"return a collection of the direct subclasses of the receiver" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3843 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3844 |
|newColl| |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3845 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3846 |
"/ use cached information (avoid class hierarchy search) |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3847 |
"/ if possible |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3848 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3849 |
SubclassInfo notNil ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3850 |
newColl := SubclassInfo at:self ifAbsent:nil. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3851 |
newColl notNil ifTrue:[^ newColl asOrderedCollection] |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3852 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3853 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3854 |
newColl := OrderedCollection new. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3855 |
self subclassesDo:[:aClass | |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3856 |
newColl add:aClass |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3857 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3858 |
SubclassInfo notNil ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3859 |
SubclassInfo at:self put:newColl. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3860 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3861 |
^ newColl |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3862 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3863 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3864 |
Class flushSubclassInfo. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3865 |
Collection subclasses |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3866 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3867 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3868 |
"Modified: 22.1.1997 / 18:43:52 / cg" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3869 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3870 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3871 |
wasAutoloaded |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3872 |
"return true, if this class came into the system via an |
555 | 3873 |
autoload; false otherwise. |
3874 |
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
|
3875 |
Autoload. The interface here is for your convenience." |
555 | 3876 |
|
3877 |
^ 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
|
3878 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3879 |
"Modified: 21.3.1996 / 16:27:09 / cg" |
555 | 3880 |
! |
3881 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3882 |
whichClassDefinesClassVar:aVariableName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3883 |
"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
|
3884 |
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
|
3885 |
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
|
3886 |
many throw away intermediate objects." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3887 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3888 |
|cls| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3889 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3890 |
cls := self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3891 |
[cls notNil] whileTrue:[ |
7368 | 3892 |
(cls classVarNames includes:aVariableName) ifTrue:[ ^ cls]. |
3893 |
cls := cls superclass |
|
556 | 3894 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3895 |
^ nil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3896 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3897 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3898 |
StandardSystemView whichClassDefinesClassVar:'ErrorSignal' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3899 |
StandardSystemView whichClassDefinesClassVar:'Foo' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3900 |
" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3901 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3902 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3903 |
!Class methodsFor:'renaming'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3904 |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3905 |
makePrivateIn:newOwner |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3906 |
"make a private class of newOwner from the receiver; |
5612 | 3907 |
the receiver must be a public class. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3908 |
Returns the new private class." |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3909 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3910 |
|sel newClass| |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3911 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3912 |
self owningClass notNil ifTrue:[ |
7368 | 3913 |
^ self |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3914 |
]. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3915 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3916 |
sel := self definitionSelectorPrivate. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3917 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3918 |
newClass := self superclass |
7368 | 3919 |
perform:sel |
3920 |
withArguments:(Array |
|
3921 |
with:(self nameWithoutPrefix asSymbol) |
|
3922 |
with:(self instanceVariableString) |
|
3923 |
with:(self classVariableString) |
|
3924 |
with:'' |
|
3925 |
with:newOwner). |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3926 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3927 |
"/ copy over methods ... |
6023 | 3928 |
ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class. |
3929 |
ClassBuilder copyInvalidatedMethodsFrom:self for:newClass. |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3930 |
newClass class recompileInvalidatedMethods. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3931 |
newClass recompileInvalidatedMethods. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3932 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3933 |
newOwner changed:#newClass with:newClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3934 |
Smalltalk changed:#newClass with:newClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3935 |
|
2835 | 3936 |
self removeFromSystem. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3937 |
^ newClass |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3938 |
|
3494
23a6cf28b3a6
fixed makePrivate, if newOwner is in a nameSpace
Claus Gittinger <cg@exept.de>
parents:
3407
diff
changeset
|
3939 |
"Modified: / 29.5.1998 / 19:03:49 / cg" |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3940 |
! |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3941 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3942 |
makePublic |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3943 |
"make a public class from the receiver. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3944 |
The receiver must be a private class. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3945 |
Returns the new public class." |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3946 |
|
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3947 |
^ self makePublicIn:Smalltalk |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3948 |
! |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3949 |
|
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3950 |
makePublicIn:aNameSpace |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3951 |
"make a public class from the receiver. |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3952 |
The receiver must be a private class. |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3953 |
Returns the new public class." |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3954 |
|
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3955 |
|sel owner newName newClass| |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3956 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3957 |
owner := self topOwningClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3958 |
owner isNil ifTrue:[^ self]. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3959 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3960 |
"/ first, create the public class ... |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3961 |
sel := self definitionSelector. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3962 |
|
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3963 |
Class nameSpaceQuerySignal answer:aNameSpace |
3044 | 3964 |
do:[ |
7368 | 3965 |
(aNameSpace isNil or:[aNameSpace == Smalltalk]) ifTrue:[ |
3966 |
newName := self nameWithoutPrefix |
|
3967 |
] ifFalse:[ |
|
3968 |
newName := aNameSpace name , '::' , self nameWithoutPrefix |
|
3969 |
]. |
|
3970 |
newClass := self superclass |
|
3971 |
perform:sel |
|
3972 |
withArguments:(Array |
|
3973 |
with:(newName asSymbol) |
|
3974 |
with:(self instanceVariableString) |
|
3975 |
with:(self classVariableString) |
|
3976 |
with:'' |
|
3977 |
with:(owner category)). |
|
3978 |
||
3979 |
"/ copy over methods ... |
|
3980 |
ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class. |
|
3981 |
ClassBuilder copyInvalidatedMethodsFrom:self for:newClass. |
|
3982 |
newClass class recompileInvalidatedMethods. |
|
3983 |
newClass recompileInvalidatedMethods. |
|
3044 | 3984 |
]. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3985 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3986 |
owner changed:#newClass with:newClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3987 |
Smalltalk changed:#newClass with:newClass. |
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3988 |
(aNameSpace notNil and:[aNameSpace ~~ Smalltalk]) ifTrue:[ |
7368 | 3989 |
aNameSpace changed:#newClass with:newClass. |
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3990 |
]. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3991 |
|
2835 | 3992 |
self removeFromSystem. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3993 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3994 |
^ newClass |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3995 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3996 |
"Created: 23.6.1997 / 13:28:52 / cg" |
3044 | 3997 |
"Modified: 20.10.1997 / 21:43:38 / cg" |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3998 |
! |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3999 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4000 |
renameTo:newName |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4001 |
"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
|
4002 |
|
5863 | 4003 |
<resource:#obsolete> |
4004 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4005 |
|oldSym newSym| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4006 |
|
2835 | 4007 |
"/ the code below is obsolete - it does not deal with |
4008 |
"/ classVariables, private classes and does not |
|
5863 | 4009 |
"/ recompile other classes in order to care for namespace |
2835 | 4010 |
"/ changes. |
3702 | 4011 |
"/ Please use Smalltalk>>renameClass:to:, |
4012 |
"/ which deals with all of that. |
|
4013 |
self obsoleteMethodWarning:'use Smalltalk>>renameClass:to:'. |
|
2835 | 4014 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4015 |
oldSym := name asSymbol. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4016 |
newSym := newName asSymbol. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4017 |
self setName:newSym. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4018 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4019 |
Smalltalk at:oldSym put:nil. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4020 |
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
|
4021 |
Smalltalk at:newSym put:self. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4022 |
|
3702 | 4023 |
"Created: / 1.4.1997 / 15:27:53 / stefan" |
4024 |
"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
|
4025 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4026 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4027 |
!Class methodsFor:'signature checking'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4028 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4029 |
classinstSizeFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4030 |
"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
|
4031 |
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
|
4032 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4033 |
^ (aSignature bitShift:-7) bitAnd:7 |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4034 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4035 |
"Created: 1.4.1997 / 15:23:01 / stefan" |
556 | 4036 |
! |
4037 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4038 |
instNameKeyFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4039 |
"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
|
4040 |
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
|
4041 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4042 |
^ (aSignature bitShift:-14) bitAnd:16rFFFF |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4043 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4044 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4045 |
Point instNameKeyFromSignature:Point signature. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4046 |
Association instNameKeyFromSignature:Association signature. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4047 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4048 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4049 |
"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
|
4050 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4051 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4052 |
instSizeFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4053 |
"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
|
4054 |
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
|
4055 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4056 |
^ aSignature bitAnd:16r7F |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4057 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4058 |
" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4059 |
Class instSizeFromSignature:Point signature. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4060 |
Class instSizeFromSignature:Association signature. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4061 |
Class instSizeFromSignature:Dictionary signature. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4062 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4063 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4064 |
"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
|
4065 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4066 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4067 |
instTypeFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4068 |
"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
|
4069 |
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
|
4070 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4071 |
^ (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
|
4072 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4073 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4074 |
Class instTypeFromSignature:Object signature. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4075 |
Class instTypeFromSignature:Array signature. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4076 |
Class instTypeFromSignature:String signature. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4077 |
Class instTypeFromSignature:OrderedCollection signature. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4078 |
" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4079 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4080 |
"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
|
4081 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4082 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4083 |
signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4084 |
"return a signature number - this number is useful for a quick |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4085 |
check for changed classes, and is done in the binary-object loader, |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4086 |
and the dynamic class loader. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4087 |
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
|
4088 |
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
|
4089 |
(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
|
4090 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4091 |
|value "{ Class: SmallInteger }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4092 |
nameKey "{ Class: SmallInteger }" | |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4093 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4094 |
signature notNil ifTrue:[^ signature]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4095 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4096 |
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
|
4097 |
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
|
4098 |
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
|
4099 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4100 |
nameKey := 0. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4101 |
self allInstVarNames do:[:name | |
7368 | 4102 |
nameKey := nameKey bitShift:1. |
4103 |
(nameKey bitAnd:16r10000) ~~ 0 ifTrue:[ |
|
4104 |
nameKey := nameKey bitXor:1. |
|
4105 |
nameKey := nameKey bitAnd:16rFFFF. |
|
4106 |
]. |
|
4107 |
nameKey := (nameKey + (name at:1) asciiValue) bitAnd:16rFFFF. |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4108 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4109 |
value := value + (nameKey bitShift:14). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4110 |
signature := value. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4111 |
^ value |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4112 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4113 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4114 |
Array signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4115 |
ByteArray signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4116 |
View signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4117 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4118 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4119 |
"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
|
4120 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4121 |
|
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
|
4122 |
!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
|
4123 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4124 |
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
|
4125 |
"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
|
4126 |
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
|
4127 |
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
|
4128 |
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
|
4129 |
|
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4130 |
|owner info c| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4131 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4132 |
(owner := self owningClass) notNil ifTrue:[^ owner binaryRevision]. |
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4133 |
revision notNil ifTrue:[ |
7368 | 4134 |
c := revision first. |
4135 |
c == $$ ifTrue:[ |
|
4136 |
info := Class revisionInfoFromString:revision. |
|
4137 |
info isNil ifTrue:[^ '0']. |
|
4138 |
^ info at:#revision ifAbsent:'0'. |
|
4139 |
]. |
|
4140 |
c isDigit ifFalse:[ |
|
4141 |
^ '0' |
|
4142 |
]. |
|
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4143 |
]. |
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4144 |
|
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
|
4145 |
^ 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
|
4146 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4147 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4148 |
Object binaryRevision |
953
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4149 |
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
|
4150 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4151 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4152 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4153 |
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
|
4154 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4155 |
|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
|
4156 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4157 |
classes := Smalltalk allClasses |
7368 | 4158 |
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
|
4159 |
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
|
4160 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4161 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4162 |
"Created: 7.12.1995 / 10:58:47 / cg" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4163 |
"Modified: 1.4.1997 / 23:33:01 / stefan" |
2909 | 4164 |
"Modified: 9.9.1997 / 12:05:41 / 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
|
4165 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4166 |
|
5183 | 4167 |
currentSourceStream |
4168 |
"return an open stream on the current source of the receiver" |
|
4169 |
||
4170 |
|theWriteStream theCurrentSource| |
|
4171 |
||
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
4172 |
theWriteStream := '' writeStream. |
5183 | 4173 |
Method flushSourceStreamCache. |
4174 |
self fileOutOn:theWriteStream withTimeStamp:false. |
|
4175 |
theCurrentSource := theWriteStream contents asString. |
|
4176 |
theWriteStream close. |
|
4177 |
^ theCurrentSource |
|
4178 |
||
4179 |
"Modified: 15.10.1996 / 18:59:40 / cg" |
|
4180 |
"Modified: 1.4.1997 / 14:33:12 / stefan" |
|
4181 |
! |
|
4182 |
||
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4183 |
localSourceStreamFor:sourceFile |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4184 |
"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
|
4185 |
|
5073 | 4186 |
|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
|
4187 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4188 |
"/ |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4189 |
"/ old: look in 'source/<filename>' |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4190 |
"/ 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
|
4191 |
"/ classes in her currentDirectory. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4192 |
"/ |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4193 |
fileName := Smalltalk getSourceFileName:sourceFile. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4194 |
fileName notNil ifTrue:[ |
7368 | 4195 |
^ fileName asFilename readStreamOrNil. |
3165
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
4196 |
]. |
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
4197 |
|
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
4198 |
(package := self package) notNil ifTrue:[ |
7368 | 4199 |
"/ newest sceme ... |
4200 |
packageDir := package copyReplaceAll:$: with:$/. |
|
4201 |
packageDir := Smalltalk getPackageFileName:packageDir. |
|
4202 |
packageDir notNil ifTrue:[ |
|
4203 |
"/ present there ? |
|
4204 |
packageDir := packageDir asFilename. |
|
4205 |
(fn := packageDir construct:sourceFile) exists ifTrue:[ |
|
4206 |
^ fn readStreamOrNil. |
|
4207 |
]. |
|
5073 | 4208 |
|
7368 | 4209 |
"/ a source subdirectory ? |
4210 |
fn := (packageDir construct:'source') construct:sourceFile. |
|
4211 |
fn exists ifTrue:[ |
|
4212 |
^ fn readStreamOrNil. |
|
4213 |
]. |
|
4214 |
||
4215 |
"/ a zip-file ? |
|
4216 |
fn := (packageDir construct:'source.zip'). |
|
4217 |
fn exists ifTrue:[ |
|
4218 |
zar := ZipArchive oldFileNamed:fn. |
|
4219 |
zar notNil ifTrue:[ |
|
4220 |
entry := zar extract:sourceFile. |
|
4221 |
entry notNil ifTrue:[ |
|
4222 |
^ entry asString readStream |
|
4223 |
] |
|
4224 |
] |
|
4225 |
] |
|
4226 |
]. |
|
4227 |
||
4228 |
"/ will vanish ... |
|
4229 |
(package includes:$:) ifTrue:[ |
|
4230 |
package := package asString copyReplaceAll:$: with:$/ |
|
4231 |
] ifFalse:[ |
|
4232 |
package := 'stx/' , package |
|
4233 |
]. |
|
4234 |
fileName := Smalltalk getSourceFileName:(package , '/' , sourceFile). |
|
4235 |
fileName notNil ifTrue:[ |
|
4236 |
^ fileName asFilename readStreamOrNil. |
|
4237 |
]. |
|
4238 |
(package startsWith:'stx/') ifTrue:[ |
|
4239 |
fileName := Smalltalk getSourceFileName:((package copyFrom:5) , '/' , sourceFile). |
|
4240 |
fileName notNil ifTrue:[ |
|
4241 |
^ fileName asFilename readStreamOrNil. |
|
4242 |
] |
|
4243 |
] |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4244 |
]. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4245 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4246 |
"/ |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4247 |
"/ new: look in 'source/<module>/<package>/<filename> |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4248 |
"/ 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
|
4249 |
"/ obsolete. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4250 |
info := self packageSourceCodeInfo. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4251 |
info notNil ifTrue:[ |
7368 | 4252 |
module := info at:#module ifAbsent:nil. |
4253 |
module notNil ifTrue:[ |
|
4254 |
dir := info at:#directory ifAbsent:nil. |
|
4255 |
dir notNil ifTrue:[ |
|
4256 |
fn := (module asFilename construct:dir) construct:sourceFile. |
|
4257 |
fileName := Smalltalk getSourceFileName:(fn name). |
|
4258 |
fileName notNil ifTrue:[ |
|
4259 |
^ fileName asFilename readStreamOrNil. |
|
4260 |
]. |
|
4261 |
||
4262 |
"/ brand new: look for source/<module>/package.zip |
|
4263 |
"/ containing an entry for <filename> |
|
4264 |
||
4265 |
fn := (module asFilename construct:dir) withSuffix:'zip'. |
|
4266 |
fileName := Smalltalk getSourceFileName:(fn name). |
|
4267 |
fileName notNil ifTrue:[ |
|
4268 |
zar := ZipArchive oldFileNamed:fileName. |
|
4269 |
zar notNil ifTrue:[ |
|
4270 |
entry := zar extract:sourceFile. |
|
4271 |
entry notNil ifTrue:[ |
|
4272 |
^ entry asString readStream |
|
4273 |
] |
|
4274 |
] |
|
4275 |
]. |
|
4276 |
||
4277 |
"/ and also in source/source.zip ... |
|
4278 |
||
4279 |
fileName := Smalltalk getSourceFileName:'source.zip'. |
|
4280 |
fileName notNil ifTrue:[ |
|
4281 |
zar := ZipArchive oldFileNamed:fileName. |
|
4282 |
zar notNil ifTrue:[ |
|
4283 |
entry := zar extract:sourceFile. |
|
4284 |
entry notNil ifTrue:[ |
|
4285 |
^ entry asString readStream |
|
4286 |
] |
|
4287 |
] |
|
4288 |
]. |
|
4289 |
] |
|
4290 |
] |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4291 |
]. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4292 |
^ nil |
3165
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
4293 |
|
3657 | 4294 |
"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
|
4295 |
! |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
4296 |
|
7174
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4297 |
nameOfVersionMethod |
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4298 |
^ #version |
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4299 |
! |
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4300 |
|
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
|
4301 |
packageSourceCodeInfo |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4302 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4303 |
|
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
|
4304 |
"return the sourceCodeInfo, which defines the module and the subdirectory |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4305 |
in which the receiver class was built. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4306 |
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
|
4307 |
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
|
4308 |
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
|
4309 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4310 |
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
|
4311 |
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
|
4312 |
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
|
4313 |
(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
|
4314 |
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
|
4315 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4316 |
By convention, this info is encoded in the classes package |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4317 |
string (which is given as argument to stc) as the last word in parenthesis. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4318 |
The info consists of 1 to 3 subcomponents, separated by colons. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4319 |
The first defines the classes module (i.e. some application identifier), |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4320 |
the second defines the subdirectory within that module, the third |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4321 |
defines the name of the class 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
|
4322 |
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
|
4323 |
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
|
4324 |
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
|
4325 |
(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
|
4326 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4327 |
For example: |
7368 | 4328 |
'....(libbasic)' -> module: stx directory: libbasic library: libbasic |
4329 |
'....(stx:libbasic)' -> module: stx directory: libbasic library: libbasic |
|
4330 |
'....(stx:foo:libbfoo)' -> module: stx directory: foo library: libfoo |
|
4331 |
'....(aeg:libIECInterface)' -> module: aeg directory: libIECInterface library:libIECInterface |
|
4332 |
'....(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
|
4333 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4334 |
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
|
4335 |
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
|
4336 |
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
|
4337 |
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
|
4338 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4339 |
Caveat: |
7368 | 4340 |
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
|
4341 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4342 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4343 |
|owner sourceInfo packageString idx1 idx2 |
4116 | 4344 |
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
|
4345 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4346 |
(owner := self owningClass) notNil ifTrue:[^ owner packageSourceCodeInfo]. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4347 |
|
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
|
4348 |
package 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
|
4349 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4350 |
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
|
4351 |
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
|
4352 |
idx1 ~~ 0 ifTrue:[ |
7368 | 4353 |
idx2 := packageString indexOf:$) startingAt:idx1+1. |
4354 |
idx2 ~~ 0 ifTrue:[ |
|
4355 |
sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1 |
|
4356 |
] |
|
2453
603af5a4e0fc
handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents:
2444
diff
changeset
|
4357 |
] ifFalse:[ |
7368 | 4358 |
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
|
4359 |
]. |
2453
603af5a4e0fc
handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents:
2444
diff
changeset
|
4360 |
|
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
|
4361 |
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
|
4362 |
components := sourceInfo asCollectionOfSubstringsSeparatedBy:$:. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4363 |
components size == 0 ifTrue:[ |
2958
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
4364 |
"/ moduleString := 'stx'. |
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
4365 |
"/ directoryString := libraryString := ''. |
7368 | 4366 |
^ nil |
2454 | 4367 |
]. |
4116 | 4368 |
|
4369 |
component1 := components at:1. |
|
2454 | 4370 |
components size == 1 ifTrue:[ |
7368 | 4371 |
"/ a single name given - the module becomes 'stx' or |
4372 |
"/ the very first directory component (if such a module exists). |
|
4373 |
"/ If the component includes slashes, its the directory |
|
4374 |
"/ otherwise the library. |
|
4375 |
"/ |
|
4376 |
dirComponents := Filename concreteClass components:component1. |
|
4377 |
(dirComponents size > 1 |
|
4378 |
and:[(mgr := self sourceCodeManager) notNil |
|
4379 |
and:[mgr checkForExistingModule:dirComponents first]]) ifTrue:[ |
|
4380 |
moduleString := dirComponents first. |
|
4381 |
directoryString := libraryString := (Filename fromComponents:(dirComponents copyFrom:2)) asString. |
|
4382 |
] ifFalse:[ |
|
4383 |
"/ non-existing; assume directory under the stx package. |
|
4384 |
moduleString := 'stx'. |
|
4385 |
(component1 startsWith:'stx/') ifTrue:[ |
|
4386 |
component1 := component1 copyFrom:5 |
|
4387 |
]. |
|
4388 |
directoryString := libraryString := component1. |
|
4389 |
]. |
|
4390 |
||
4391 |
(libraryString includes:$/) ifTrue:[ |
|
4392 |
libraryString := libraryString asFilename baseName |
|
4393 |
] |
|
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
|
4394 |
] ifFalse:[ |
7368 | 4395 |
component2 := components at:2. |
4396 |
components size == 2 ifTrue:[ |
|
4397 |
"/ two components - assume its the module and the directory; |
|
4398 |
"/ the library is assumed to be named after the directory |
|
4399 |
"/ except, if slashes are in the name; then the libraryname |
|
4400 |
"/ is the last component. |
|
4401 |
"/ |
|
4402 |
moduleString := component1. |
|
4403 |
directoryString := libraryString := component2. |
|
4404 |
(libraryString includes:$/) ifTrue:[ |
|
4405 |
libraryString := libraryString asFilename baseName |
|
4406 |
] |
|
4407 |
] ifFalse:[ |
|
4408 |
"/ all components given |
|
4409 |
moduleString := component1. |
|
4410 |
directoryString := component2. |
|
4411 |
libraryString := components at:3. |
|
4412 |
] |
|
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
|
4413 |
]. |
2454 | 4414 |
|
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
|
4415 |
libraryString isEmpty ifTrue:[ |
7368 | 4416 |
directoryString notEmpty ifTrue:[ |
4417 |
libraryString := directoryString asFilename baseName |
|
4418 |
]. |
|
4419 |
libraryString isEmpty ifTrue:[ |
|
4420 |
"/ lets extract the library from the liblist file ... |
|
4421 |
libraryString := Smalltalk libraryFileNameOfClass:self. |
|
4422 |
libraryString isNil ifTrue:[^ nil]. |
|
4423 |
] |
|
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
|
4424 |
]. |
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 |
|
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 |
moduleString isEmpty ifTrue:[ |
7368 | 4427 |
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
|
4428 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4429 |
directoryString isEmpty ifTrue:[ |
7368 | 4430 |
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
|
4431 |
]. |
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 |
^ IdentityDictionary |
7368 | 4434 |
with:(#module->moduleString) |
4435 |
with:(#directory->directoryString) |
|
4436 |
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
|
4437 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4438 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4439 |
Object packageSourceCodeInfo |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4440 |
View packageSourceCodeInfo |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4441 |
Model packageSourceCodeInfo |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4442 |
BinaryObjectStorage packageSourceCodeInfo |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4443 |
MemoryMonitor packageSourceCodeInfo |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4444 |
ClockView packageSourceCodeInfo |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4445 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4446 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4447 |
"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
|
4448 |
"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
|
4449 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4450 |
|
3248
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4451 |
resourcePackName |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4452 |
"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
|
4453 |
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
|
4454 |
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
|
4455 |
The default here is the classes name - this can be redefined in classes |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4456 |
which want use another classes resources (NewLauncher -> Launcher)." |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4457 |
|
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4458 |
^ self name |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4459 |
|
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4460 |
"Created: / 29.1.1998 / 22:20:12 / cg" |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4461 |
! |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4462 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4463 |
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
|
4464 |
"return the revision-ID of the class which corresponds to 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
|
4465 |
rcs-id of the source to which this class is equivalent. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4466 |
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
|
4467 |
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
|
4468 |
the old revision, while logically, the class has the new (checked-in) 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
|
4469 |
To check if a source corresponds to a compiled binary, compare this |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4470 |
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
|
4471 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4472 |
|info| |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4473 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4474 |
info := self revisionInfo. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4475 |
info notNil ifTrue:[ |
7368 | 4476 |
^ info at:#revision ifAbsent: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
|
4477 |
]. |
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4478 |
^ self binaryRevision |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4479 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4480 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4481 |
Object 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
|
4482 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4483 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4484 |
"Created: 11.11.1995 / 14:27:20 / 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
|
4485 |
"Modified: 12.12.1995 / 20:30:20 / cg" |
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4486 |
"Modified: 26.3.1997 / 00:14:00 / stefan" |
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
|
4487 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4488 |
|
2582 | 4489 |
revisionDateString |
4490 |
"return the revision-Date of the class as a string. |
|
4491 |
This is extracted from the version string." |
|
4492 |
||
4493 |
|info| |
|
4494 |
||
4495 |
info := self revisionInfo. |
|
4496 |
info notNil ifTrue:[ |
|
7368 | 4497 |
^ info at:#date ifAbsent:'??/??/??' |
2582 | 4498 |
]. |
4499 |
^ '??/??/??' |
|
4500 |
||
4501 |
" |
|
4502 |
Object revisionDateString |
|
4503 |
" |
|
4504 |
||
4505 |
"Created: 23.4.1997 / 12:29:21 / cg" |
|
4506 |
! |
|
4507 |
||
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
|
4508 |
revisionInfo |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4509 |
"return a dictionary filled with revision info. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4510 |
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
|
4511 |
The revisionInfo contains all or a subset of: |
7368 | 4512 |
#binaryRevision - the revision upon which the binary of this class is based |
4513 |
#revision - the revision upon which the class is based logically |
|
4514 |
(different, if a changed class was checked in, but not yet recompiled) |
|
4515 |
#user - the user who checked in the logical revision |
|
4516 |
#date - the date when the logical revision was checked in |
|
4517 |
#time - the time when the logical revision was checked in |
|
4518 |
#fileName - the classes source file name |
|
4519 |
#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
|
4520 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4521 |
|
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
4522 |
|vsnString info mgr| |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4523 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4524 |
vsnString := self revisionString. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4525 |
vsnString notNil ifTrue:[ |
7368 | 4526 |
mgr := self sourceCodeManager. |
4527 |
mgr notNil ifTrue:[ |
|
4528 |
info := mgr revisionInfoFromString:vsnString |
|
4529 |
] ifFalse:[ |
|
4530 |
info := Class revisionInfoFromString:vsnString. |
|
4531 |
]. |
|
4532 |
info notNil ifTrue:[ |
|
4533 |
info at:#binaryRevision put:self binaryRevision. |
|
4534 |
] |
|
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
|
4535 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4536 |
^ info |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4537 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4538 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4539 |
Object 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
|
4540 |
Object revisionInfo |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4541 |
Image revisionInfo |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4542 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4543 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4544 |
"Created: 11.11.1995 / 14:27:20 / cg" |
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
4545 |
"Modified: 29.1.1997 / 18:59:12 / cg" |
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4546 |
"Modified: 26.3.1997 / 00:13:17 / stefan" |
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
|
4547 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4548 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4549 |
revisionString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4550 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4551 |
|
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
|
4552 |
"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
|
4553 |
classes #version method. Either this is a method returning that string, |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4554 |
or its a comment-only method and the comment defines the version. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4555 |
If the source is not accessable or no such method exists, |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4556 |
nil is returned." |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4557 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4558 |
|owner cls meta m src val| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4559 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4560 |
(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
|
4561 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4562 |
thisContext isRecursive ifTrue:[^ nil ]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4563 |
|
6150
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4564 |
meta := self theMetaclass. |
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4565 |
cls := self theNonMetaclass. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4566 |
|
7174
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4567 |
m := meta compiledMethodAt:(self nameOfVersionMethod). |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4568 |
m isNil ifTrue:[ |
7368 | 4569 |
"/ no - do NEVER care for a version method on the instance side |
4570 |
"/ m := cls compiledMethodAt:(self nameOfVersionMethod). |
|
4571 |
m isNil 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
|
4572 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4573 |
|
1102
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4574 |
m isExecutable ifTrue:[ |
7368 | 4575 |
"/ |
4576 |
"/ if its a method returning the string, |
|
4577 |
"/ thats the returned value |
|
4578 |
"/ |
|
4579 |
val := cls perform:(self nameOfVersionMethod). |
|
4580 |
val isString ifTrue:[^ val]. |
|
1102
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4581 |
]. |
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
|
4582 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4583 |
"/ |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4584 |
"/ if its a method consisting of a comment only |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4585 |
"/ extract it - this may lead to a recursive call |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4586 |
"/ to myself (thats what the #isRecursive is for) |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4587 |
"/ in case we need to access the source code manager |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4588 |
"/ for the source ... |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4589 |
"/ |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4590 |
src := m source. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4591 |
src isNil ifTrue:[^ nil]. |
1811 | 4592 |
^ Class revisionStringFromSource:src |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4593 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4594 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4595 |
Smalltalk allClassesDo:[:cls | |
7368 | 4596 |
Transcript 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
|
4597 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4598 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4599 |
Number revisionString |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4600 |
FileDirectory revisionString |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4601 |
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
|
4602 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4603 |
|
5801 | 4604 |
"Created: / 29.10.1995 / 19:28:03 / cg" |
4605 |
"Modified: / 1.4.1997 / 23:37:25 / stefan" |
|
4606 |
"Modified: / 7.2.2001 / 18:03:39 / ps" |
|
6150
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4607 |
"Modified: / 5.11.2001 / 16:35:56 / cg" |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4608 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4609 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4610 |
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
|
4611 |
"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
|
4612 |
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
|
4613 |
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
|
4614 |
(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
|
4615 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4616 |
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
|
4617 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4618 |
"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
|
4619 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4620 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4621 |
setPackageFromRevision |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4622 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4623 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4624 |
"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
|
4625 |
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
|
4626 |
(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
|
4627 |
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
|
4628 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4629 |
|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
|
4630 |
|
1756 | 4631 |
self owningClass notNil ifTrue:[^ self]. |
4632 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4633 |
mgr := self sourceCodeManager. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4634 |
mgr notNil ifTrue:[ |
7368 | 4635 |
info := mgr sourceInfoOfClass:self |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4636 |
]. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4637 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4638 |
info notNil ifTrue:[ |
7368 | 4639 |
mod := info at:#module ifAbsent:nil. "/ stx, aeg, <your-organization> |
4640 |
dir := info at:#directory ifAbsent:nil. "/ libbasic, libtool ... |
|
4641 |
lib := info at:#library ifAbsent:dir. |
|
4642 |
||
4643 |
p := ''. |
|
4644 |
mod notNil ifTrue:[ |
|
4012
e87e53bc45a6
when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents:
3997
diff
changeset
|
4645 |
"/ mod ~= 'stx' ifTrue:[ |
7368 | 4646 |
p := p , mod |
4012
e87e53bc45a6
when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents:
3997
diff
changeset
|
4647 |
"/ ] |
7368 | 4648 |
]. |
4649 |
dir notNil ifTrue:[ |
|
4650 |
p notEmpty ifTrue:[p := p , ':']. |
|
4651 |
p := p , dir. |
|
4652 |
] ifFalse:[ |
|
4653 |
lib notNil ifTrue:[ |
|
4654 |
p notEmpty ifTrue:[p := p , ':']. |
|
4655 |
p := p , lib. |
|
4656 |
]. |
|
4657 |
]. |
|
4658 |
(p notEmpty and:[p ~= package]) ifTrue:[ |
|
2072
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4659 |
"/ package notNil ifTrue:[ |
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4660 |
"/ (name , ': changing packageID from ''' , package , ''' to ''' , p , '''') infoPrintCR. |
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4661 |
"/ ]. |
7368 | 4662 |
package := p. |
4663 |
||
4664 |
self methodDictionary do:[:aMethod | |
|
4665 |
aMethod package isNil ifTrue:[ |
|
4666 |
aMethod setPackage:p |
|
4667 |
] |
|
4668 |
] |
|
4669 |
]. |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4670 |
]. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4671 |
^ self |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4672 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4673 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4674 |
MemoryMonitor autoload. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4675 |
MemoryMonitor setPackageFromRevision |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4676 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4677 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
4678 |
"Modified: 12.6.1996 / 11:49:31 / stefan" |
2072
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4679 |
"Modified: 7.1.1997 / 12:01:08 / cg" |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4680 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4681 |
|
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
|
4682 |
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
|
4683 |
"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
|
4684 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4685 |
|owner source| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4686 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4687 |
(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
|
4688 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4689 |
classFilename notNil ifTrue:[ |
7368 | 4690 |
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
|
4691 |
] ifFalse:[ |
7368 | 4692 |
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
|
4693 |
]. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4694 |
^ self sourceStreamFor:source |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4695 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4696 |
"Modified: 15.10.1996 / 18:59:40 / cg" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4697 |
"Modified: 1.4.1997 / 14:33:12 / stefan" |
953
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4698 |
! |
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4699 |
|
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4700 |
sourceStreamFor:source |
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4701 |
"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
|
4702 |
|
6703 | 4703 |
|owner aStream mgr validated guessedFileName sep mod dir| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4704 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4705 |
(owner := self owningClass) notNil ifTrue:[^ owner sourceStreamFor:source]. |
1909 | 4706 |
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
|
4707 |
|
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 |
"/ |
892
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4709 |
"/ if there is no SourceCodeManager, |
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4710 |
"/ or TryLocalSourceFirst is true, |
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4711 |
"/ 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
|
4712 |
"/ |
892
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4713 |
((mgr := self sourceCodeManager) isNil |
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4714 |
or:[TryLocalSourceFirst == true]) ifTrue:[ |
7368 | 4715 |
aStream := self localSourceStreamFor:source. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
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 |
|
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 |
aStream isNil ifTrue:[ |
7368 | 4719 |
"/ mhmh - still no source file. |
4720 |
"/ If there is a SourceCodeManager, ask it to aquire the |
|
4721 |
"/ the source for my class, and return an open stream on it. |
|
4722 |
"/ if that one does not know about the source, look in |
|
4723 |
"/ standard places |
|
4724 |
||
4725 |
mgr notNil ifTrue:[ |
|
4726 |
classFilename ~= source ifTrue:[ |
|
4727 |
sep := self package indexOfAny:'/\:'. |
|
4728 |
sep ~~ 0 ifTrue:[ |
|
4729 |
mod := package copyTo:sep - 1. |
|
4730 |
dir := package copyFrom:sep + 1. |
|
4731 |
aStream := mgr streamForClass:nil fileName:source revision:nil directory:dir module:mod cache:true. |
|
4732 |
]. |
|
4733 |
]. |
|
4734 |
aStream isNil ifTrue:[ |
|
4735 |
classFilename isNil ifTrue:[ |
|
4736 |
guessedFileName := (Smalltalk fileNameForClass:self) , '.st'. |
|
4737 |
self setClassFilename:guessedFileName. |
|
4738 |
]. |
|
4739 |
source asFilename baseName = classFilename asFilename baseName ifTrue:[ |
|
4740 |
aStream := mgr getSourceStreamFor:self. |
|
4741 |
] |
|
4742 |
]. |
|
4743 |
aStream notNil ifTrue:[ |
|
4744 |
(self validateSourceStream:aStream) ifFalse:[ |
|
4745 |
('Class [info]: repositories source for `' |
|
4746 |
, (self theNonMetaclass name) |
|
4747 |
, ''' is invalid.') infoPrintCR. |
|
4748 |
aStream close. |
|
4749 |
aStream := nil |
|
4750 |
] ifTrue:[ |
|
4751 |
validated := true. |
|
4752 |
]. |
|
4753 |
]. |
|
4754 |
] |
|
5116
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4755 |
]. |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4756 |
|
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4757 |
aStream isNil ifTrue:[ |
7368 | 4758 |
"/ |
4759 |
"/ hard case - there is no source file for this class |
|
4760 |
"/ (in the source-dir-path). |
|
4761 |
"/ |
|
4762 |
||
4763 |
"/ |
|
4764 |
"/ look if my binary is from a dynamically loaded module, |
|
4765 |
"/ and, if so, look in the modules directory for the |
|
4766 |
"/ source file. |
|
4767 |
"/ |
|
4768 |
ObjectFileLoader notNil ifTrue:[ |
|
4769 |
ObjectFileLoader loadedObjectHandlesDo:[:h | |
|
4770 |
|f classes| |
|
4771 |
||
4772 |
aStream isNil ifTrue:[ |
|
4773 |
(classes := h classes) size > 0 ifTrue:[ |
|
4774 |
(classes includes:self) ifTrue:[ |
|
4775 |
f := h pathName. |
|
4776 |
f := f asFilename directory. |
|
4777 |
f := f construct:source. |
|
4778 |
f exists ifTrue:[ |
|
4779 |
aStream := f readStreamOrNil. |
|
4780 |
]. |
|
4781 |
]. |
|
4782 |
]. |
|
4783 |
] |
|
4784 |
]. |
|
4785 |
]. |
|
5116
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4786 |
]. |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4787 |
|
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4788 |
"/ |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4789 |
"/ try along sourcePath |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4790 |
"/ |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4791 |
aStream isNil ifTrue:[ |
7368 | 4792 |
aStream := self localSourceStreamFor:source. |
5116
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4793 |
]. |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4794 |
|
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4795 |
"/ |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4796 |
"/ final chance: try current directory |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4797 |
"/ |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4798 |
aStream isNil ifTrue:[ |
7368 | 4799 |
aStream := source asFilename readStreamOrNil. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4800 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4801 |
|
1909 | 4802 |
(aStream notNil and:[validated not]) ifTrue:[ |
7368 | 4803 |
(self validateSourceStream:aStream) ifFalse:[ |
4804 |
(Smalltalk releaseIdentification = 'ST/X_free_demo_vsn') ifTrue:[ |
|
3401 | 4805 |
"/ ('Class [info]: source for ''' , self name , ''' is not available in the demo version.') infoPrintCR |
7368 | 4806 |
] ifFalse:[ |
4807 |
('Class [warning]: source for ''' , self name , ''' is invalid or stripped. Take care.') errorPrintCR |
|
4808 |
] |
|
4809 |
]. |
|
1909 | 4810 |
]. |
4744 | 4811 |
(aStream notNil and:[aStream isFileStream]) ifTrue:[ |
7368 | 4812 |
guessedFileName notNil ifTrue:[ |
4813 |
self setClassFilename:(aStream pathName asFilename baseName). |
|
4814 |
] |
|
4744 | 4815 |
]. |
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
|
4816 |
^ aStream |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4817 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4818 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4819 |
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
|
4820 |
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
|
4821 |
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
|
4822 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4823 |
|
3391 | 4824 |
"Created: / 10.11.1995 / 21:05:13 / cg" |
4825 |
"Modified: / 22.4.1998 / 19:20:50 / ca" |
|
6150
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4826 |
"Modified: / 5.11.2001 / 16:36:30 / cg" |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4827 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4828 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4829 |
updateVersionMethodFor:newRevisionString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4830 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4831 |
|
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
|
4832 |
"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
|
4833 |
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
|
4834 |
|
4667 | 4835 |
|cls mthd "vs m mgr"| |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4836 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4837 |
cls := self. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4838 |
self isMeta ifFalse:[ |
7368 | 4839 |
cls := self class |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4840 |
]. |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4841 |
|
7174
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4842 |
"/ m := cls compiledMethodAt:(self nameOfVersionMethod). |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4843 |
"/ m isNil ifTrue:[^ false]. |
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 |
"/ vs := self revisionString. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4845 |
"/ vs isNil ifTrue:[^ false]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4846 |
"/ |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4847 |
"/ (mgr := self sourceCodeManager) isNil ifTrue:[^ false]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4848 |
"/ newString := mgr updatedRevisionStringOf:cls forRevision:newRevision with:vs. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4849 |
"/ newString isNil ifTrue:[^ false]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4850 |
|
4606 | 4851 |
Class methodRedefinitionSignal answer:#keep do:[ |
7368 | 4852 |
Class withoutUpdatingChangesDo:[ |
4853 |
mthd := Compiler compile:(self nameOfVersionMethod) , ' |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4854 |
^ ''' , 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
|
4855 |
' |
7368 | 4856 |
forClass:cls |
4857 |
inCategory:#documentation |
|
4858 |
notifying:nil |
|
4859 |
install:true |
|
4860 |
skipIfSame:false |
|
4861 |
silent:true. |
|
4862 |
mthd notNil ifTrue:[ |
|
4863 |
mthd setPackage:self package |
|
4864 |
] |
|
4865 |
] |
|
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
|
4866 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4867 |
"/ ('updated to :' , newRevisionString) printNL. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4868 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4869 |
^ true |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4870 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4871 |
"Created: 7.12.1995 / 20:42:22 / cg" |
1928 | 4872 |
"Modified: 7.11.1996 / 21:02:09 / cg" |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4873 |
! |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4874 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4875 |
validateSourceStream:aStream |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4876 |
"check if aStream really contains my source. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4877 |
This is done by checking the version methods return value |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4878 |
against the version string as contained in the version method" |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4879 |
|
1766 | 4880 |
|cls meta cannotCheckReason versionMethod info |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4881 |
versionFromCode versionFromSource oldPos pos src rev| |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4882 |
|
6150
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4883 |
meta := self theMetaclass. |
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4884 |
cls := self theNonMetaclass. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4885 |
|
1766 | 4886 |
cannotCheckReason := nil. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4887 |
|
7174
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4888 |
versionMethod := meta compiledMethodAt:(self nameOfVersionMethod). |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4889 |
(versionMethod isNil |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4890 |
or:[versionMethod isExecutable not]) ifTrue:[ |
7368 | 4891 |
versionMethod := cls compiledMethodAt:(self nameOfVersionMethod). |
4892 |
(versionMethod isNil |
|
4893 |
or:[versionMethod isExecutable not]) ifTrue:[ |
|
4894 |
cannotCheckReason := 'no valid version method'. |
|
4895 |
] |
|
2544
c3a2791de289
care for unloaded methods, when validating the source revision
Claus Gittinger <cg@exept.de>
parents:
2516
diff
changeset
|
4896 |
] ifFalse:[ |
7368 | 4897 |
"/ |
4898 |
"/ if its a method returning the string, |
|
4899 |
"/ thats the returned value |
|
4900 |
"/ |
|
4901 |
versionFromCode := cls perform:(self nameOfVersionMethod). |
|
4902 |
versionFromCode isString ifFalse:[ |
|
4903 |
cannotCheckReason := 'version method does not return a string' |
|
4904 |
]. |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4905 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4906 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4907 |
"/ |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4908 |
"/ if its a method consisting of a comment only |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4909 |
"/ extract it - this may lead to a recursive call |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4910 |
"/ to myself (thats what the #isRecursive is for) |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4911 |
"/ in case we need to access the source code manager |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4912 |
"/ for the source ... |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4913 |
"/ |
1942 | 4914 |
versionMethod notNil ifTrue:[ |
7368 | 4915 |
pos := versionMethod sourcePosition. |
4916 |
pos isInteger ifFalse:[ |
|
4917 |
"/ mhmh - either no version method, |
|
4918 |
"/ or updated due to a checkin. |
|
4919 |
"/ in any case, this should be a good source. |
|
4920 |
||
4921 |
^ true. |
|
4922 |
"/ cannotCheckReason := 'no source position for version-method' |
|
4923 |
] |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4924 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4925 |
|
1766 | 4926 |
cannotCheckReason notNil ifTrue:[ |
7368 | 4927 |
('Class [warning]: ' , cannotCheckReason , ' in ' , self name) infoPrintCR. |
4928 |
'Class [info]: cannot validate source; trusting source' infoPrintCR. |
|
4929 |
^ true |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4930 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4931 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4932 |
oldPos := aStream position. |
3371
1d8aa07c4b7f
care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents:
3365
diff
changeset
|
4933 |
Stream positionErrorSignal handle:[:ex | |
7368 | 4934 |
'Class [info]: position error when accessing source' infoPrintCR. |
4935 |
^ false |
|
3371
1d8aa07c4b7f
care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents:
3365
diff
changeset
|
4936 |
] do:[ |
7368 | 4937 |
aStream position1Based:pos. |
3371
1d8aa07c4b7f
care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents:
3365
diff
changeset
|
4938 |
]. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4939 |
src := aStream nextChunk. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4940 |
aStream position:oldPos. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4941 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4942 |
(src isNil or:[src isEmpty]) ifTrue:[ |
7368 | 4943 |
'Class [info]: empty source for version-method' infoPrintCR. |
4944 |
^ false |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4945 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4946 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4947 |
versionFromSource := Class revisionStringFromSource:src. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4948 |
versionFromSource = versionFromCode ifTrue:[^ true]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4949 |
|
4784 | 4950 |
versionFromSource isNil ifTrue:[ |
7368 | 4951 |
'Class [info]: version-from source is nil' infoPrintCR. |
4952 |
^ false |
|
4784 | 4953 |
]. |
1786 | 4954 |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4955 |
"/ mhmh - check my binary version ... |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4956 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4957 |
info := Class revisionInfoFromString:versionFromSource. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4958 |
info notNil ifTrue:[ |
7368 | 4959 |
rev := info at:#revision. |
4960 |
rev = self binaryRevision ifTrue:[^ true]. |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4961 |
]. |
4784 | 4962 |
'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
|
4963 |
^ false |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4964 |
|
6150
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4965 |
"Modified: / 5.11.2001 / 16:36:54 / 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
|
4966 |
! ! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4967 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4968 |
!Class methodsFor:'special accessing'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4969 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4970 |
setName:aString |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4971 |
"set the classes name - be careful, it will be still |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4972 |
in the Smalltalk dictionary - under another key. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4973 |
This is NOT for general use - see renameTo:" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4974 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4975 |
environment := nil. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4976 |
name := aString |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4977 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4978 |
"Created: 1.4.1997 / 15:46:01 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4979 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4980 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4981 |
!Class::ClassAttributes methodsFor:'accessing'! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4982 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4983 |
primitiveDefinitions |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4984 |
"return the value of the instance variable 'primitiveDefinitions' (automatically generated)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4985 |
|
7371
e6fccc3b935c
kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents:
7369
diff
changeset
|
4986 |
^ primDefinitions |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4987 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4988 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4989 |
primitiveDefinitions:something |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4990 |
"set the value of the instance variable 'primitiveDefinitions' (automatically generated)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4991 |
|
7371
e6fccc3b935c
kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents:
7369
diff
changeset
|
4992 |
primDefinitions := something. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4993 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4994 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4995 |
primitiveFunctions |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4996 |
"return the value of the instance variable 'primitiveFunctions' (automatically generated)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4997 |
|
7371
e6fccc3b935c
kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents:
7369
diff
changeset
|
4998 |
^ primFunctions |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4999 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5000 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5001 |
primitiveFunctions:something |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5002 |
"set the value of the instance variable 'primitiveFunctions' (automatically generated)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5003 |
|
7371
e6fccc3b935c
kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents:
7369
diff
changeset
|
5004 |
primFunctions := something. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5005 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5006 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5007 |
primitiveVariables |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5008 |
"return the value of the instance variable 'primitiveVariables' (automatically generated)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5009 |
|
7371
e6fccc3b935c
kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents:
7369
diff
changeset
|
5010 |
^ primVariables |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5011 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5012 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5013 |
primitiveVariables:something |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5014 |
"set the value of the instance variable 'primitiveVariables' (automatically generated)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5015 |
|
7371
e6fccc3b935c
kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents:
7369
diff
changeset
|
5016 |
primVariables := something. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5017 |
! ! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5018 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5019 |
!Class::ClassAttributes methodsFor:'conversion'! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5020 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5021 |
fromSTCPrimitiveArray:anArray |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5022 |
"for now, the stc compiler generates a 3-element primitive spec array |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5023 |
(it does not know anything about me). |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5024 |
This method is invoked to convert." |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5025 |
|
7371
e6fccc3b935c
kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents:
7369
diff
changeset
|
5026 |
primDefinitions := anArray at:1. |
e6fccc3b935c
kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents:
7369
diff
changeset
|
5027 |
primVariables := anArray at:2. |
e6fccc3b935c
kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents:
7369
diff
changeset
|
5028 |
primFunctions := anArray at:3. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5029 |
! ! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
5030 |
|
1739 | 5031 |
!Class class methodsFor:'documentation'! |
662 | 5032 |
|
5033 |
version |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
5034 |
^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.438 2003-06-20 07:32:25 stefan Exp $' |
708
ba92b2a8477d
include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents:
707
diff
changeset
|
5035 |
! ! |