author | Claus Gittinger <cg@exept.de> |
Sat, 22 Mar 1997 14:14:21 +0100 | |
changeset 2481 | bb9bc51ce5f6 |
parent 2477 | 3fb0bf03bb5a |
child 2482 | a13e40246125 |
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 |
153 | 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 |
||
719
c557a530f971
dont appending a chunk-separator to the initial copyright
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
13 |
ClassDescription subclass:#Class |
1714
35b39ee74145
moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents:
1712
diff
changeset
|
14 |
instanceVariableNames:'classvars comment subclasses classFilename package revision hook' |
741
c6b4e7f026be
dont crash in #revision if info is there, but has no revision field
Claus Gittinger <cg@exept.de>
parents:
740
diff
changeset
|
15 |
classVariableNames:'UpdatingChanges LockChangesFile FileOutErrorSignal |
733
983d045c17f5
make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
16 |
CatchMethodRedefinitions MethodRedefinitionSignal |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
17 |
UpdateChangeFileQuerySignal TryLocalSourceFirst |
1915
c3ca595d0846
added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
18 |
ChangeFileAccessLock NameSpaceQuerySignal PackageQuerySignal |
2036
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
19 |
UsedNameSpaceQuerySignal CreateNameSpaceQuerySignal OldMethods |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
20 |
FileOutNameSpaceQuerySignal' |
741
c6b4e7f026be
dont crash in #revision if info is there, but has no revision field
Claus Gittinger <cg@exept.de>
parents:
740
diff
changeset
|
21 |
poolDictionaries:'' |
c6b4e7f026be
dont crash in #revision if info is there, but has no revision field
Claus Gittinger <cg@exept.de>
parents:
740
diff
changeset
|
22 |
category:'Kernel-Classes' |
1 | 23 |
! |
24 |
||
1739 | 25 |
!Class class methodsFor:'documentation'! |
68 | 26 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
27 |
copyright |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
28 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
29 |
COPYRIGHT (c) 1989 by Claus Gittinger |
527
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
30 |
All Rights Reserved |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
31 |
|
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
32 |
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
|
33 |
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
|
34 |
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
|
35 |
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
|
36 |
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
|
37 |
hereby transferred. |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
38 |
" |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
39 |
! |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
40 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
41 |
documentation |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
42 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
43 |
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
|
44 |
been defined in Behavior and ClassDescription; this adds naming, categories etc. |
68 | 45 |
|
46 |
Also change management and recompilation is defined here (since the superclasses |
|
47 |
do not have enough symbolic information to support compilation). |
|
48 |
||
1287 | 49 |
[Instance variables:] |
50 |
||
51 |
classvars <String> the names of the class variables |
|
52 |
||
53 |
comment <String> the classes comment; either a string, |
|
54 |
a number specifying the offset in classFilename, or nil |
|
55 |
||
56 |
subclasses <Collection> cached collection of subclasses |
|
57 |
(currently unused - but will be soon) |
|
58 |
||
59 |
classFilename <String> the file (or nil) where the classes |
|
60 |
sources are found |
|
61 |
||
62 |
package <Symbol> the package, in which the class was defined |
|
63 |
(inserted by compilers) |
|
64 |
||
65 |
revision <String> revision string - inserted by stc |
|
66 |
||
1711
3bea87e918cd
nope - privateClasses was no good idea;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
67 |
hook <any> reserved: a place to add additional attributes, |
1807 | 68 |
without a need to recompile all classes. |
69 |
Currently unused. |
|
1287 | 70 |
|
71 |
[Class variables:] |
|
72 |
||
73 |
UpdatingChanges <Boolean> true if the changes-file shall be updated |
|
74 |
(except during startup and when filing in, this flag |
|
75 |
is usually true) |
|
76 |
||
77 |
UpdateChangeFileQuerySignal used as an upQuery from the change management. |
|
78 |
Whenever a changeRecord is to be written, |
|
79 |
this signal is raised and a handler (if present) |
|
80 |
is supposed to return true or false. |
|
81 |
If unhandled, the value of the global |
|
82 |
UpdatingChanges is returned for backward |
|
83 |
compatibility (which means that the old |
|
84 |
mechanism is used if no query-handler |
|
85 |
is present). |
|
86 |
||
1923
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
87 |
LockChangesFile <Boolean> if true, the change file is locked for updates. |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
88 |
Required when multiple users operate on a common |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
89 |
change file. |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
90 |
This is an experimental new feature, being evaluated. |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
91 |
|
1287 | 92 |
FileOutErrorSignal raised when an error occurs during fileOut |
93 |
||
94 |
CatchMethodRedefinitions if true, classes protect themself |
|
95 |
MethodRedefinitionSignal (by raising MethodRedefinitionSignal) |
|
96 |
from redefining any existing methods, |
|
97 |
which are defined in another package. |
|
98 |
(i.e. a signal will be raised, if you |
|
99 |
fileIn something which redefines an |
|
100 |
existing method and the packages do not |
|
101 |
match). |
|
102 |
The default is (currently) true. |
|
103 |
||
104 |
TryLocalSourceFirst If true, local source files are tried |
|
105 |
first BEFORE the sourceCodeManager is |
|
106 |
consulted. If false, the sourceCodeManager |
|
107 |
is asked first. |
|
108 |
Should be turned on, if you run an image from |
|
109 |
local sources which have not yet been checked in. |
|
892
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
110 |
|
1923
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
111 |
NameSpaceQuerySignal used as an upQuery to ask for a namespace into |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
112 |
which new classes are to be installed. |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
113 |
|
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
114 |
PackageQuerySignal used as an upQuery to ask for a packageSymbol with |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
115 |
which new classes/methods are to be marked. |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
116 |
|
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
117 |
CreateNameSpaceQuerySignal used as an upQuery to ask if unknown namespaces |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
118 |
should be silently created (without asking the user) |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
119 |
|
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
120 |
OldMethods if nonNil, this must be an IdentityDictionary, |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
121 |
which is filled with method->previousversionMethod |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
122 |
associations. Can be used for undo-last-method-change |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
123 |
Notice: this may fillup your memory over time. |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
124 |
|
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
125 |
|
68 | 126 |
WARNING: layout known by compiler and runtime system |
1287 | 127 |
|
128 |
[author:] |
|
129 |
Claus Gittinger |
|
1669 | 130 |
|
131 |
[see also:] |
|
1807 | 132 |
Behavior ClassDescription Metaclass |
68 | 133 |
" |
662 | 134 |
! ! |
68 | 135 |
|
1739 | 136 |
!Class class methodsFor:'initialization'! |
1 | 137 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
138 |
initialize |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
139 |
"the classvariable 'UpdatingChanges' controls if changes are put |
1 | 140 |
into the changes-file; normally this variable is set to true, but |
68 | 141 |
(for example) during fileIn or when changes are applied, it is set to false |
142 |
to avoid putting too much junk into the changes-file." |
|
1 | 143 |
|
153 | 144 |
UpdatingChanges := true. |
488
1677ee52d630
hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents:
484
diff
changeset
|
145 |
LockChangesFile := false. |
362 | 146 |
CatchMethodRedefinitions := true. |
909 | 147 |
TryLocalSourceFirst := false. |
362 | 148 |
|
153 | 149 |
FileOutErrorSignal isNil ifTrue:[ |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
150 |
FileOutErrorSignal := ErrorSignal newSignalMayProceed:false. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
151 |
FileOutErrorSignal nameClass:self message:#fileOutErrorSignal. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
152 |
FileOutErrorSignal notifierString:'error during fileOut'. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
153 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
154 |
MethodRedefinitionSignal := ErrorSignal newSignalMayProceed:true. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
155 |
MethodRedefinitionSignal nameClass:self message:#methodRedefinitionSignal. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
156 |
MethodRedefinitionSignal notifierString:'attempt to redefine method from different package'. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
157 |
|
2020 | 158 |
UpdateChangeFileQuerySignal := QuerySignal new. |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
159 |
UpdateChangeFileQuerySignal nameClass:self message:#updateChangeFileQuerySignal. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
160 |
UpdateChangeFileQuerySignal notifierString:'asking if changeFile update is wanted'. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
161 |
UpdateChangeFileQuerySignal handlerBlock:[:ex | ex proceedWith:UpdatingChanges]. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
162 |
|
2020 | 163 |
NameSpaceQuerySignal := QuerySignal new. |
1895 | 164 |
NameSpaceQuerySignal nameClass:self message:#nameSpaceQuerySignal. |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
165 |
NameSpaceQuerySignal notifierString:'asking for nameSpace'. |
2003
453ab548bd52
prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
166 |
NameSpaceQuerySignal handlerBlock:[:ex | ex proceedWith:Smalltalk defaultNameSpace]. |
453ab548bd52
prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
167 |
|
2020 | 168 |
UsedNameSpaceQuerySignal := QuerySignal new. |
2003
453ab548bd52
prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
169 |
UsedNameSpaceQuerySignal nameClass:self message:#usedNameSpaceQuerySignal. |
453ab548bd52
prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
170 |
UsedNameSpaceQuerySignal notifierString:'asking for used nameSpaced'. |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
171 |
|
2020 | 172 |
CreateNameSpaceQuerySignal := QuerySignal new. |
1915
c3ca595d0846
added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
173 |
CreateNameSpaceQuerySignal nameClass:self message:#createNameSpaceQuerySignal. |
c3ca595d0846
added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
174 |
CreateNameSpaceQuerySignal notifierString:'asking for nameSpace creation'. |
2038
7c0943b1ab81
care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents:
2036
diff
changeset
|
175 |
CreateNameSpaceQuerySignal defaultAnswer:false. |
1915
c3ca595d0846
added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
176 |
|
2020 | 177 |
PackageQuerySignal := QuerySignal new. |
1895 | 178 |
PackageQuerySignal nameClass:self message:#packageQuerySignal. |
179 |
PackageQuerySignal notifierString:'asking for package'. |
|
180 |
PackageQuerySignal handlerBlock:[:ex | ex proceedWith:(Project isNil |
|
181 |
ifTrue:[ |
|
182 |
'no package' |
|
183 |
] ifFalse:[ |
|
184 |
Project currentPackageName |
|
185 |
])]. |
|
186 |
||
2036
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
187 |
FileOutNameSpaceQuerySignal := QuerySignal new. |
2038
7c0943b1ab81
care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents:
2036
diff
changeset
|
188 |
FileOutNameSpaceQuerySignal defaultAnswer:false. |
2036
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
189 |
|
2262 | 190 |
ChangeFileAccessLock := Semaphore forMutualExclusion name:'ChangeFileAccessLock'. |
153 | 191 |
] |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
192 |
|
2038
7c0943b1ab81
care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents:
2036
diff
changeset
|
193 |
"Modified: 3.1.1997 / 15:16:05 / cg" |
153 | 194 |
! ! |
195 |
||
1739 | 196 |
!Class class methodsFor:'Signal constants'! |
153 | 197 |
|
1915
c3ca595d0846
added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
198 |
createNameSpaceQuerySignal |
c3ca595d0846
added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
199 |
"return the signal used as an upQuery if a new nameSpace should be |
c3ca595d0846
added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
200 |
silently created without user confirmation. |
c3ca595d0846
added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
201 |
Only used when installing autoloaded classes" |
c3ca595d0846
added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
202 |
|
c3ca595d0846
added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
203 |
^ CreateNameSpaceQuerySignal |
c3ca595d0846
added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
204 |
|
c3ca595d0846
added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
205 |
"Created: 7.11.1996 / 12:55:01 / cg" |
c3ca595d0846
added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
206 |
! |
c3ca595d0846
added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents:
1909
diff
changeset
|
207 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
208 |
fileOutErrorSignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
209 |
"return the signal raised when an error occurs while fileing out. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
210 |
This is signalled to allow browsers some user feed back in case |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
211 |
a fileout fails (for example due to disk-full errors)" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
212 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
213 |
^ FileOutErrorSignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
214 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
215 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
216 |
methodRedefinitionSignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
217 |
"return the signal raised when a method is about to be installed |
362 | 218 |
which redefines an existing method and the methods packages are not |
219 |
equal. This helps when filing in alien code, to prevent existing |
|
220 |
methods to be overwritten or redefined by incompatible methods" |
|
221 |
||
222 |
^ MethodRedefinitionSignal |
|
555 | 223 |
! |
224 |
||
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
225 |
nameSpaceQuerySignal |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
226 |
"return the signal used as an upQuery for the current nameSpace. |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
227 |
Will be used when filing in code" |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
228 |
|
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
229 |
^ NameSpaceQuerySignal |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
230 |
|
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
231 |
" |
1895 | 232 |
Transcript showCR:Class nameSpaceQuerySignal raise |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
233 |
" |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
234 |
|
1895 | 235 |
"Modified: 5.11.1996 / 20:08:38 / cg" |
236 |
! |
|
237 |
||
238 |
packageQuerySignal |
|
239 |
"return the signal used as an upQuery for the current packages name. |
|
240 |
Will be used when filing in code" |
|
241 |
||
242 |
^ PackageQuerySignal |
|
243 |
||
244 |
" |
|
245 |
Transcript showCR:Class packageQuerySignal raise |
|
246 |
" |
|
247 |
||
248 |
"Created: 5.11.1996 / 20:07:22 / cg" |
|
249 |
"Modified: 5.11.1996 / 20:08:35 / cg" |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
250 |
! |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
251 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
252 |
updateChangeFileQuerySignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
253 |
"return the signal used as an upQuery if the changeFile should be updated. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
254 |
If unhandled, the value of UpdatingChanges is returned by the signals |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
255 |
static handler." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
256 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
257 |
^ UpdateChangeFileQuerySignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
258 |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
259 |
" |
1895 | 260 |
Transcript showCR:Class updateChangeFileQuerySignal raise |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
261 |
" |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
262 |
|
1895 | 263 |
"Modified: 5.11.1996 / 20:08:44 / cg" |
2003
453ab548bd52
prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
264 |
! |
453ab548bd52
prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
265 |
|
453ab548bd52
prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
266 |
usedNameSpaceQuerySignal |
453ab548bd52
prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
267 |
"return the signal used as an upQuery for the used nameSpace. |
453ab548bd52
prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
268 |
Will be used when filing in code" |
453ab548bd52
prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
269 |
|
453ab548bd52
prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
270 |
^ UsedNameSpaceQuerySignal |
453ab548bd52
prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
271 |
|
453ab548bd52
prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents:
1996
diff
changeset
|
272 |
"Created: 19.12.1996 / 23:57:27 / cg" |
362 | 273 |
! ! |
274 |
||
1739 | 275 |
!Class class methodsFor:'accessing - flags'! |
362 | 276 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
277 |
catchMethodRedefinitions |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
278 |
"return the redefinition catching flag." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
279 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
280 |
^ CatchMethodRedefinitions |
556 | 281 |
! |
282 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
283 |
catchMethodRedefinitions:aBoolean |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
284 |
"turn on/off redefinition catching. Return the prior value of the flag." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
285 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
286 |
|prev| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
287 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
288 |
prev := CatchMethodRedefinitions. |
556 | 289 |
CatchMethodRedefinitions := aBoolean. |
290 |
^ prev |
|
291 |
! |
|
292 |
||
1924 | 293 |
keepMethodHistory:aBoolean |
1923
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
294 |
"turn on/off oldMethod remembering. If on, a methods previous version |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
295 |
is kept locally, for later undo (or compare)." |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
296 |
|
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
297 |
aBoolean ifTrue:[ |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
298 |
OldMethods isNil ifTrue:[ |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
299 |
OldMethods := IdentityDictionary new. |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
300 |
] |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
301 |
] ifFalse:[ |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
302 |
OldMethods := nil |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
303 |
]. |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
304 |
|
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
305 |
" |
1924 | 306 |
Class keepMethodHistory:true |
307 |
Class keepMethodHistory:false |
|
1923
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
308 |
" |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
309 |
|
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
310 |
"Modified: 7.11.1996 / 18:36:00 / cg" |
1924 | 311 |
"Created: 7.11.1996 / 19:05:57 / cg" |
1923
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
312 |
! |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
313 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
314 |
lockChangesFile |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
315 |
"return true, if the change file is locked during update" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
316 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
317 |
^ LockChangesFile |
555 | 318 |
! |
319 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
320 |
lockChangesFile:aBoolean |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
321 |
"turn on/off change-file-locking. Return the previous value of the flag." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
322 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
323 |
|prev| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
324 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
325 |
prev := LockChangesFile. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
326 |
LockChangesFile := aBoolean. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
327 |
^ prev |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
328 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
329 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
330 |
tryLocalSourceFirst |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
331 |
^ TryLocalSourceFirst |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
332 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
333 |
"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
|
334 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
335 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
336 |
tryLocalSourceFirst:aBoolean |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
337 |
TryLocalSourceFirst := aBoolean |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
338 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
339 |
"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
|
340 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
341 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
342 |
updateChanges:aBoolean |
858 | 343 |
"turn on/off changes management. Return the prior value of the flag. |
344 |
This value is used as a default fallback - a querySignal handler may still |
|
345 |
decide to return something else." |
|
362 | 346 |
|
347 |
|prev| |
|
348 |
||
555 | 349 |
prev := UpdatingChanges. |
350 |
UpdatingChanges := aBoolean. |
|
362 | 351 |
^ prev |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
352 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
353 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
354 |
updatingChanges |
858 | 355 |
"return true if changes are recorded. |
356 |
The value returned here is the default fallback - a querySignal handler may still |
|
357 |
decide to return something else." |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
358 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
359 |
^ UpdatingChanges |
1 | 360 |
! ! |
361 |
||
1924 | 362 |
!Class class methodsFor:'accessing - history'! |
363 |
||
364 |
flushMethodHistory |
|
365 |
"flush any method->previousVersion associations, |
|
366 |
all history is lost." |
|
367 |
||
368 |
OldMethods notNil ifTrue:[ |
|
369 |
OldMethods := IdentityDictionary new |
|
370 |
]. |
|
371 |
||
372 |
"Created: 7.11.1996 / 19:07:25 / cg" |
|
373 |
! |
|
374 |
||
375 |
methodHistory |
|
376 |
"return a dictionary containing method->previousVersion associations, |
|
377 |
nil if method remembering has been turned off" |
|
378 |
||
379 |
^ OldMethods |
|
380 |
||
381 |
" |
|
382 |
Class oldMethods |
|
383 |
" |
|
384 |
||
385 |
"Modified: 7.11.1996 / 18:36:00 / cg" |
|
386 |
"Created: 7.11.1996 / 19:06:28 / cg" |
|
387 |
! ! |
|
388 |
||
1739 | 389 |
!Class class methodsFor:'enumeration '! |
193 | 390 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
391 |
allClassesInCategory:aCategory do:aBlock |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
392 |
"evaluate aBlock for all classes in aCategory; |
193 | 393 |
no specific order is defined." |
394 |
||
199 | 395 |
Smalltalk allBehaviorsDo:[:aClass | |
193 | 396 |
aClass isMeta ifFalse:[ |
397 |
(aClass category = aCategory) ifTrue:[ |
|
398 |
aBlock value:aClass |
|
399 |
] |
|
400 |
]. |
|
401 |
] |
|
402 |
||
403 |
" |
|
404 |
Class allClassesInCategory:'Kernel-Classes' |
|
1422 | 405 |
do:[:class |Transcript showCR:class name] |
193 | 406 |
" |
407 |
! |
|
408 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
409 |
allClassesInCategory:aCategory inOrderDo:aBlock |
193 | 410 |
"evaluate aBlock for all classes in aCategory; |
411 |
superclasses come first - then subclasses." |
|
412 |
||
413 |
|classes| |
|
414 |
||
415 |
classes := OrderedCollection new. |
|
199 | 416 |
Smalltalk allBehaviorsDo:[:aClass | |
193 | 417 |
aClass isMeta ifFalse:[ |
418 |
(aClass category = aCategory) ifTrue:[ |
|
419 |
classes add:aClass |
|
420 |
] |
|
421 |
] |
|
422 |
]. |
|
423 |
classes topologicalSort:[:a :b | b isSubclassOf:a]. |
|
424 |
classes do:aBlock |
|
425 |
! ! |
|
426 |
||
1739 | 427 |
!Class class methodsFor:'helpers'! |
620 | 428 |
|
429 |
revisionInfoFromString:aString |
|
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
430 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
431 |
|
620 | 432 |
"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
|
433 |
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
|
434 |
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
|
435 |
|
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
436 |
" |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
437 |
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
|
438 |
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
|
439 |
(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
|
440 |
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
|
441 |
(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
|
442 |
" |
620 | 443 |
|
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
444 |
|words info nm mgr| |
620 | 445 |
|
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
446 |
"/ |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
447 |
"/ 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
|
448 |
"/ |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
449 |
(mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[ |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
450 |
info := mgr revisionInfoFromString:aString. |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
451 |
info notNil ifTrue:[ |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
452 |
^ info |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
453 |
] |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
454 |
]. |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
455 |
|
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
456 |
"/ |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
457 |
"/ 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
|
458 |
"/ is this really needed ? |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
459 |
"/ |
620 | 460 |
info := IdentityDictionary new. |
461 |
words := aString asCollectionOfWords. |
|
462 |
||
744
db7b733455b9
dont crash with bad revision strings (again)
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
463 |
words notEmpty ifTrue:[ |
1994
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
464 |
"/ |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
465 |
"/ supported formats: |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
466 |
"/ |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
467 |
"/ $-Header: pathName rev date time user state $ |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
468 |
"/ $-Revision: rev $ |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
469 |
"/ $-Id: fileName rev date time user state $ |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
470 |
"/ |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
471 |
|
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
472 |
((words at:1) = '$Header:') ifTrue:[ |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
473 |
nm := words at:2. |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
474 |
info at:#repositoryPathName put:nm. |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
475 |
(nm endsWith:',v') ifTrue:[ |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
476 |
nm := nm copyWithoutLast:2 |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
477 |
]. |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
478 |
info at:#fileName put:nm asFilename baseName. |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
479 |
words size > 2 ifTrue:[ |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
480 |
(words at:3) = '$' ifFalse:[ |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
481 |
info at:#revision put:(words at:3). |
2006
7ae5a89ed40a
fixed no-version checkin into an existing container
Claus Gittinger <cg@exept.de>
parents:
2003
diff
changeset
|
482 |
(words at:4) = '$' ifFalse:[ |
7ae5a89ed40a
fixed no-version checkin into an existing container
Claus Gittinger <cg@exept.de>
parents:
2003
diff
changeset
|
483 |
info at:#date put:(words at:4). |
7ae5a89ed40a
fixed no-version checkin into an existing container
Claus Gittinger <cg@exept.de>
parents:
2003
diff
changeset
|
484 |
info at:#time put:(words at:5). |
7ae5a89ed40a
fixed no-version checkin into an existing container
Claus Gittinger <cg@exept.de>
parents:
2003
diff
changeset
|
485 |
info at:#user put:(words at:6). |
7ae5a89ed40a
fixed no-version checkin into an existing container
Claus Gittinger <cg@exept.de>
parents:
2003
diff
changeset
|
486 |
info at:#state put:(words at:7). |
7ae5a89ed40a
fixed no-version checkin into an existing container
Claus Gittinger <cg@exept.de>
parents:
2003
diff
changeset
|
487 |
] |
1994
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
488 |
]. |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
489 |
]. |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
490 |
^ info |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
491 |
]. |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
492 |
((words at:1) = '$Revision:') ifTrue:[ |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
493 |
info at:#revision put:(words at:2). |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
494 |
^ info |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
495 |
]. |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
496 |
((words at:1) = '$Id:') ifTrue:[ |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
497 |
info at:#fileName put:(words at:2). |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
498 |
info at:#revision put:(words at:3). |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
499 |
info at:#date put:(words at:4). |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
500 |
info at:#time put:(words at:5). |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
501 |
info at:#user put:(words at:6). |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
502 |
info at:#state put:(words at:7). |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
503 |
^ info |
53f3334a23d5
handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents:
1977
diff
changeset
|
504 |
]. |
620 | 505 |
]. |
506 |
||
507 |
^ nil |
|
508 |
||
509 |
"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
|
510 |
"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
|
511 |
! |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
512 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
513 |
revisionStringFromSource:aMethodSourceString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
514 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
515 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
516 |
"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
|
517 |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
518 |
|lines line| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
519 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
520 |
lines := aMethodSourceString asCollectionOfLines. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
521 |
lines do:[:l | |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
522 |
|i| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
523 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
524 |
i := l indexOfSubCollection:'$Header: '. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
525 |
i ~~ 0 ifTrue:[ |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
526 |
line := l copyFrom:i. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
527 |
i := line lastIndexOf:$$. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
528 |
i > 1 ifTrue:[ |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
529 |
line := line copyTo:i. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
530 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
531 |
^ line |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
532 |
] |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
533 |
]. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
534 |
^ nil |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
535 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
536 |
"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
|
537 |
"Modified: 16.10.1996 / 16:54:40 / cg" |
620 | 538 |
! ! |
539 |
||
1739 | 540 |
!Class class methodsFor:'queries'! |
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
541 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
542 |
isBuiltInClass |
1266 | 543 |
"return true if this class is known by the run-time-system. |
544 |
Here, true is returned for myself, false for subclasses." |
|
545 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
546 |
^ self == Class class or:[self == Class] |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
547 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
548 |
"Created: 15.4.1996 / 17:17:13 / cg" |
1266 | 549 |
"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
|
550 |
! ! |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
551 |
|
1 | 552 |
!Class methodsFor:'ST/V subclass creation'! |
553 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
554 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s |
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
555 |
"{ Pragma: +optSpace }" |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
556 |
|
37 | 557 |
"this method allows fileIn of ST/V classes |
1 | 558 |
(which seem to have no category)" |
559 |
||
560 |
^ self subclass:t |
|
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
561 |
instanceVariableNames:f |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
562 |
classVariableNames:d |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
563 |
poolDictionaries:s |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
564 |
category:'ST/V classes' |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
565 |
|
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
566 |
"Modified: 5.1.1997 / 19:59:30 / cg" |
1 | 567 |
! |
568 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
569 |
variableByteSubclass:t classVariableNames:d poolDictionaries:s |
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
570 |
"{ Pragma: +optSpace }" |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
571 |
|
37 | 572 |
"this method allows fileIn of ST/V variable byte classes |
1 | 573 |
(which seem to have no category and no instvars)" |
574 |
||
575 |
^ self variableByteSubclass:t |
|
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
576 |
instanceVariableNames:'' |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
577 |
classVariableNames:d |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
578 |
poolDictionaries:s |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
579 |
category:'ST/V classes' |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
580 |
|
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
581 |
"Modified: 5.1.1997 / 19:59:33 / cg" |
1 | 582 |
! |
583 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
584 |
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s |
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
585 |
"{ Pragma: +optSpace }" |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
586 |
|
37 | 587 |
"this method allows fileIn of ST/V variable pointer classes |
1 | 588 |
(which seem to have no category)" |
589 |
||
590 |
^ self variableSubclass:t |
|
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
591 |
instanceVariableNames:f |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
592 |
classVariableNames:d |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
593 |
poolDictionaries:s |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
594 |
category:'ST/V classes' |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
595 |
|
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
596 |
"Modified: 5.1.1997 / 19:59:36 / cg" |
1 | 597 |
! ! |
598 |
||
599 |
!Class methodsFor:'accessing'! |
|
600 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
601 |
addClassVarName:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
602 |
"add a class variable if not already there and initialize it with nil. |
555 | 603 |
Also writes a change record and notifies dependents. |
604 |
BUG: Currently, no recompilation is done - this will change." |
|
605 |
||
606 |
(self classVarNames includes:aString) ifFalse:[ |
|
607 |
self classVariableString:(self classVariableString , ' ' , aString). |
|
608 |
self addChangeRecordForClass:self. |
|
609 |
self changed:#definition. |
|
610 |
] |
|
611 |
||
612 |
"Created: 29.10.1995 / 19:40:51 / cg" |
|
613 |
! |
|
614 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
615 |
classFilename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
616 |
"return the name of the file from which the class was compiled. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
617 |
This is currently NOT used." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
618 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
619 |
|owner| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
620 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
621 |
(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
|
622 |
^ classFilename |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
623 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
624 |
"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
|
625 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
626 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
627 |
classVarAt:aSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
628 |
"return the value of a class variable. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
629 |
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
|
630 |
this may change." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
631 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
632 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
633 |
this hides the (current) implementation of classVariables |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
634 |
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
|
635 |
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
|
636 |
no classPools yet. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
637 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
638 |
^ Smalltalk at:(self name , ':' , aSymbol) asSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
639 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
640 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
641 |
classVarAt:aSymbol put:something |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
642 |
"store something in a classvariable. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
643 |
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
|
644 |
classVar exists - this may change." |
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 |
this hides the (current) implementation of classVariables |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
648 |
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
|
649 |
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
|
650 |
no classPools yet. |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
651 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
652 |
Smalltalk at:(self name , ':' , aSymbol) asSymbol put:something. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
653 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
654 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
655 |
classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
656 |
"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
|
657 |
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
|
658 |
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
|
659 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
660 |
classvars isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
661 |
^ OrderedCollection new |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
662 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
663 |
^ classvars asCollectionOfWords |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
664 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
665 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
666 |
Object classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
667 |
Float classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
668 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
669 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
670 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
671 |
classVariableString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
672 |
"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
|
673 |
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
|
674 |
returned string." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
675 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
676 |
classvars isNil ifTrue:[^ '']. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
677 |
^ classvars |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
678 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
679 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
680 |
Object classVariableString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
681 |
Float classVariableString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
682 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
683 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
684 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
685 |
classVariableString:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
686 |
"set the classes classvarnames string; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
687 |
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
|
688 |
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
|
689 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
690 |
|prevVarNames varNames any| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
691 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
692 |
"ignore for metaclasses except the one" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
693 |
(self isMeta) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
694 |
(self == Metaclass) ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
695 |
^ self |
556 | 696 |
] |
697 |
]. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
698 |
(classvars = aString) ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
699 |
prevVarNames := self classVarNames. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
700 |
classvars := aString. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
701 |
varNames := self classVarNames. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
702 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
703 |
"new ones get initialized to nil; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
704 |
- old ones are nilled and removed from Smalltalk" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
705 |
any := false. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
706 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
707 |
varNames do:[:aName | |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
708 |
(prevVarNames includes:aName) ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
709 |
"a new one" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
710 |
self classVarAt:aName put:nil. |
453 | 711 |
any := true. |
712 |
] ifTrue:[ |
|
713 |
prevVarNames remove:aName |
|
714 |
] |
|
715 |
]. |
|
716 |
"left overs are gone" |
|
717 |
prevVarNames do:[:aName | |
|
718 |
self classVarAt:aName put:nil. |
|
719 |
Smalltalk removeKey:(self name , ':' , aName) asSymbol. |
|
720 |
]. |
|
721 |
any ifTrue:[ |
|
722 |
Smalltalk changed:#classVariables with:self |
|
723 |
]. |
|
724 |
] |
|
725 |
! |
|
726 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
727 |
comment |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
728 |
"return the comment (aString) of the class" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
729 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
730 |
|stream string| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
731 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
732 |
"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
|
733 |
position within the classes sourcefile ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
734 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
735 |
comment isNumber ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
736 |
classFilename notNil ifTrue:[ |
953
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
737 |
stream := self sourceStream. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
738 |
stream notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
739 |
stream position:comment. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
740 |
string := String readFrom:stream onError:''. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
741 |
stream close. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
742 |
^ string |
887
9d1780436f5a
use new metaclass entry when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
881
diff
changeset
|
743 |
]. |
9d1780436f5a
use new metaclass entry when loading binary classes
Claus Gittinger <cg@exept.de>
parents:
881
diff
changeset
|
744 |
^ nil |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
745 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
746 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
747 |
^ comment |
555 | 748 |
|
749 |
" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
750 |
Object comment |
555 | 751 |
" |
752 |
! |
|
753 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
754 |
comment:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
755 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
756 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
757 |
"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
|
758 |
create a change record and notify dependents." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
759 |
|
865
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
760 |
|oldComment newComment| |
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
761 |
|
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
762 |
newComment := aString. |
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
763 |
(aString notNil and:[aString isEmpty]) ifTrue:[ |
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
764 |
newComment := nil |
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
765 |
]. |
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
766 |
comment ~= newComment ifTrue:[ |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
767 |
oldComment := self comment. |
865
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
768 |
comment := newComment. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
769 |
self changed:#comment with:oldComment. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
770 |
self addChangeRecordForClassComment:self. |
555 | 771 |
] |
772 |
! |
|
773 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
774 |
definition |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
775 |
"return an expression-string to define myself" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
776 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
777 |
|s| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
778 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
779 |
s := WriteStream on:(String new). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
780 |
self fileOutDefinitionOn:s. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
781 |
^ s contents |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
782 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
783 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
784 |
Object definition |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
785 |
Point definition |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
786 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
787 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
788 |
|
2444 | 789 |
environment |
790 |
"return the namespace I am contained in; ST-80 compatible name" |
|
791 |
||
792 |
^ self nameSpace |
|
793 |
! |
|
794 |
||
1919 | 795 |
nameSpace |
2070
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
796 |
"return the namespace I am contained in; |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
797 |
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
|
798 |
for public classes, Smalltalk is returned." |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
799 |
|
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
800 |
|idx nsName| |
1919 | 801 |
|
2439
5defcd0c1524
dont check for self being in Smalltalk when extracting
Claus Gittinger <cg@exept.de>
parents:
2356
diff
changeset
|
802 |
"/ (Smalltalk at:name) ~~ self ifTrue:[ |
5defcd0c1524
dont check for self being in Smalltalk when extracting
Claus Gittinger <cg@exept.de>
parents:
2356
diff
changeset
|
803 |
"/ "/ mhmh - anonymous, or someone played around with my name |
5defcd0c1524
dont check for self being in Smalltalk when extracting
Claus Gittinger <cg@exept.de>
parents:
2356
diff
changeset
|
804 |
"/ |
5defcd0c1524
dont check for self being in Smalltalk when extracting
Claus Gittinger <cg@exept.de>
parents:
2356
diff
changeset
|
805 |
"/ ^ nil |
5defcd0c1524
dont check for self being in Smalltalk when extracting
Claus Gittinger <cg@exept.de>
parents:
2356
diff
changeset
|
806 |
"/ ]. |
1919 | 807 |
|
808 |
"/ due to the implementation, extract this from my name |
|
2070
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
809 |
"/ (physically, all classes are found in Smalltalk) |
1919 | 810 |
|
811 |
idx := name lastIndexOf:$:. |
|
812 |
idx == 0 ifTrue:[ |
|
813 |
^ Smalltalk |
|
814 |
]. |
|
815 |
||
816 |
(name at:idx-1) ~~ $: ifTrue:[ |
|
817 |
^ Smalltalk |
|
818 |
]. |
|
819 |
nsName := name copyTo:(idx - 2). |
|
820 |
^ Smalltalk at:nsName asSymbol |
|
821 |
||
2439
5defcd0c1524
dont check for self being in Smalltalk when extracting
Claus Gittinger <cg@exept.de>
parents:
2356
diff
changeset
|
822 |
"Modified: 3.3.1997 / 11:27:03 / cg" |
1919 | 823 |
! |
824 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
825 |
package |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
826 |
"return the package of the class" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
827 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
828 |
|owner| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
829 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
830 |
(owner := self owningClass) notNil ifTrue:[^ owner package]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
831 |
^ package |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
832 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
833 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
834 |
Object package |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
835 |
" |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
836 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
837 |
"Modified: 15.10.1996 / 18:53:36 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
838 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
839 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
840 |
package:aStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
841 |
"set the package of the class." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
842 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
843 |
package := aStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
844 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
845 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
846 |
primitiveDefinitions:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
847 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
848 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
849 |
"set the primitiveDefinition string" |
555 | 850 |
|
851 |
self setPrimitiveSpecsAt:1 to:aString. |
|
852 |
self addChangeRecordForPrimitiveDefinitions:self. |
|
853 |
||
854 |
"Created: 29.10.1995 / 19:41:39 / cg" |
|
855 |
! |
|
856 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
857 |
primitiveDefinitionsString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
858 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
859 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
860 |
"return the primitiveDefinition string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
861 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
862 |
^ self getPrimitiveSpecsAt:1 |
555 | 863 |
|
864 |
" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
865 |
Object primitiveDefinitionsString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
866 |
String primitiveDefinitionsString |
555 | 867 |
" |
868 |
! |
|
869 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
870 |
primitiveFunctions:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
871 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
872 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
873 |
"set the primitiveFunction string" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
874 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
875 |
self setPrimitiveSpecsAt:3 to:aString. |
555 | 876 |
self addChangeRecordForPrimitiveFunctions:self. |
877 |
||
878 |
"Created: 29.10.1995 / 19:41:48 / cg" |
|
879 |
! |
|
880 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
881 |
primitiveFunctionsString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
882 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
883 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
884 |
"return the primitiveFunctions string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
885 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
886 |
^ self getPrimitiveSpecsAt:3 |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
887 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
888 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
889 |
primitiveSpec |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
890 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
891 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
892 |
"return the primitiveSpec or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
893 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
894 |
^ primitiveSpec |
555 | 895 |
! |
896 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
897 |
primitiveSpec:anArrayOf3ElementsOrNil |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
898 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
899 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
900 |
"set the primitiveSpec or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
901 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
902 |
primitiveSpec := anArrayOf3ElementsOrNil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
903 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
904 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
905 |
primitiveVariables:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
906 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
907 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
908 |
"set the primitiveVariable string" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
909 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
910 |
self setPrimitiveSpecsAt:2 to:aString. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
911 |
self addChangeRecordForPrimitiveVariables:self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
912 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
913 |
"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
|
914 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
915 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
916 |
primitiveVariablesString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
917 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
918 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
919 |
"return the primitiveVariables string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
920 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
921 |
^ self getPrimitiveSpecsAt:2 |
555 | 922 |
! |
923 |
||
1739 | 924 |
privateClasses |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
925 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
926 |
|
1739 | 927 |
"return a collection of my private classes (if any); nil otherwise" |
928 |
||
1753
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
929 |
|classes myName| |
1739 | 930 |
|
931 |
classes := IdentitySet new. |
|
1753
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
932 |
myName := self name. |
1739 | 933 |
Smalltalk keysAndValuesDo:[:aName :aValue| |
2009
3f5fad3c9fa9
faster search for privateClasses (less garbage creation)
Claus Gittinger <cg@exept.de>
parents:
2006
diff
changeset
|
934 |
(aName startsWith:myName) ifTrue:[ |
3f5fad3c9fa9
faster search for privateClasses (less garbage creation)
Claus Gittinger <cg@exept.de>
parents:
2006
diff
changeset
|
935 |
(aName startsWith:(myName , '::')) ifTrue:[ |
3f5fad3c9fa9
faster search for privateClasses (less garbage creation)
Claus Gittinger <cg@exept.de>
parents:
2006
diff
changeset
|
936 |
"/ care for private-privateClasses |
3f5fad3c9fa9
faster search for privateClasses (less garbage creation)
Claus Gittinger <cg@exept.de>
parents:
2006
diff
changeset
|
937 |
(aName indexOf:$: startingAt:myName size + 3) == 0 ifTrue:[ |
3f5fad3c9fa9
faster search for privateClasses (less garbage creation)
Claus Gittinger <cg@exept.de>
parents:
2006
diff
changeset
|
938 |
classes add:aValue. |
3f5fad3c9fa9
faster search for privateClasses (less garbage creation)
Claus Gittinger <cg@exept.de>
parents:
2006
diff
changeset
|
939 |
] |
1753
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
940 |
] |
1739 | 941 |
] |
942 |
]. |
|
943 |
classes size == 0 ifTrue:[ |
|
944 |
^ nil |
|
945 |
]. |
|
2021
0c7bf2934d3e
must sort the privateClasses by inheritance
Claus Gittinger <cg@exept.de>
parents:
2020
diff
changeset
|
946 |
^ classes asOrderedCollection topologicalSort:[:a :b | b isSubclassOf:a]. |
1739 | 947 |
|
948 |
" |
|
949 |
Object privateClasses |
|
950 |
" |
|
951 |
||
2021
0c7bf2934d3e
must sort the privateClasses by inheritance
Claus Gittinger <cg@exept.de>
parents:
2020
diff
changeset
|
952 |
"Modified: 2.1.1997 / 14:08:35 / cg" |
1739 | 953 |
! |
954 |
||
1707 | 955 |
privateClassesAt:aClassNameSymbol |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
956 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
957 |
|
1707 | 958 |
"return a private class if present; nil otherwise" |
959 |
||
960 |
|class| |
|
961 |
||
1739 | 962 |
class := self classVarAt:(':' , aClassNameSymbol) asSymbol. |
1707 | 963 |
^ class |
964 |
||
965 |
"Created: 11.10.1996 / 19:05:39 / cg" |
|
1739 | 966 |
"Modified: 14.10.1996 / 17:23:30 / cg" |
1707 | 967 |
! |
968 |
||
969 |
privateClassesAt:aClassNameSymbol put:aClass |
|
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
970 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
971 |
|
1707 | 972 |
"return a private class if present" |
973 |
||
1739 | 974 |
self classVarAt:(':' , aClassNameSymbol) asSymbol put:aClass |
1707 | 975 |
|
976 |
"Created: 11.10.1996 / 17:53:06 / cg" |
|
1739 | 977 |
"Modified: 14.10.1996 / 17:23:36 / cg" |
1707 | 978 |
! |
979 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
980 |
removeClassVarName:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
981 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
982 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
983 |
"remove a class variable if not already there. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
984 |
Also writes a change record and notifies dependents. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
985 |
BUG: Currently, no recompilation is done - this will change." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
986 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
987 |
|names newNames| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
988 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
989 |
names := self classVarNames. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
990 |
(names includes:aString) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
991 |
newNames := ''. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
992 |
names do:[:nm | nm ~= aString ifTrue:[newNames := newNames , nm , ' ']]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
993 |
self classVariableString:newNames withoutSpaces. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
994 |
self addChangeRecordForClass:self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
995 |
self changed:#definition. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
996 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
997 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
998 |
"Created: 29.10.1995 / 19:42:08 / cg" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
999 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1000 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1001 |
renameCategory:oldCategory to:newCategory |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1002 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1003 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1004 |
"rename a category (changes category of those methods). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1005 |
Appends a change record and notifies dependents." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1006 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1007 |
|any| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1008 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1009 |
any := false. |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1010 |
self methodDictionary do:[:aMethod | |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1011 |
aMethod category = oldCategory ifTrue:[ |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1012 |
aMethod category:newCategory. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1013 |
any := true. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1014 |
] |
555 | 1015 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1016 |
any ifTrue:[ |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1017 |
self addChangeRecordForRenameCategory:oldCategory to:newCategory. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1018 |
self changed:#methodCategory. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1019 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1020 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1021 |
"Created: 29.10.1995 / 19:42:15 / cg" |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1022 |
"Modified: 12.6.1996 / 11:49:08 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1023 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1024 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1025 |
setClassFilename:aFilename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1026 |
"set the classes filename. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1027 |
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
|
1028 |
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
|
1029 |
is set here." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1030 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1031 |
classFilename := aFilename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1032 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1033 |
"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
|
1034 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1035 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1036 |
setClassVariableString:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1037 |
"set the classes classvarnames string. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1038 |
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
|
1039 |
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
|
1040 |
NO change record is written." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1041 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1042 |
classvars := aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1043 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1044 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1045 |
setComment:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1046 |
"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
|
1047 |
do NOT create a change record" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1048 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1049 |
comment := aString |
1 | 1050 |
! |
1051 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1052 |
setComment:com category:categoryStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1053 |
"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
|
1054 |
do NOT create a change record" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1055 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1056 |
|cat| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1057 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1058 |
comment := com. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1059 |
categoryStringOrSymbol isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1060 |
cat := '' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1061 |
] ifFalse:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1062 |
cat := categoryStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1063 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1064 |
category := cat asSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1065 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1066 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1067 |
setPackage:aStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1068 |
"set the package of the class." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1069 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1070 |
package := aStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1071 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1072 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1073 |
sharedPools |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1074 |
"ST/X does not (currently) support pools" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1075 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1076 |
^ #() |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1077 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1078 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1079 |
source |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1080 |
"return the classes full source code" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1081 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1082 |
|code aStream| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1083 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1084 |
" this is too slow for big classes ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1085 |
code := String new:1000. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1086 |
aStream := WriteStream on:code. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1087 |
self fileOutOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1088 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1089 |
aStream := FileStream newFileNamed:'__temp'. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1090 |
aStream isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1091 |
self notify:'cannot create temporary file.'. |
555 | 1092 |
^ nil |
1093 |
]. |
|
1094 |
FileOutErrorSignal handle:[:ex | |
|
1095 |
aStream nextPutAll:'"no source available"'. |
|
1096 |
] do:[ |
|
1097 |
self fileOutOn:aStream. |
|
1098 |
]. |
|
1099 |
aStream close. |
|
1100 |
aStream := FileStream oldFileNamed:'__temp'. |
|
1101 |
aStream isNil ifTrue:[ |
|
1102 |
self notify:'oops - cannot reopen temp file'. |
|
1103 |
^ nil |
|
1104 |
]. |
|
1105 |
code := aStream contents. |
|
1106 |
aStream close. |
|
1107 |
OperatingSystem removeFile:'__temp'. |
|
1108 |
^ code |
|
385 | 1109 |
! |
1110 |
||
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1111 |
sourceCodeManager |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1112 |
"return my source code manager. |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1113 |
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
|
1114 |
But future versions may support mixed reporitories" |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1115 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1116 |
|owner| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1117 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1118 |
(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
|
1119 |
^ Smalltalk at:#SourceCodeManager |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1120 |
|
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1121 |
"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
|
1122 |
"Modified: 15.10.1996 / 18:54:02 / cg" |
1 | 1123 |
! ! |
1124 |
||
1125 |
!Class methodsFor:'adding/removing'! |
|
1126 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1127 |
addSelector:newSelector withMethod:newMethod |
68 | 1128 |
"add the method given by 2nd argument under the selector given by |
92 | 1129 |
1st argument to the methodDictionary. |
153 | 1130 |
Append a change record to the changes file and tell dependents." |
1 | 1131 |
|
362 | 1132 |
|oldMethod| |
1133 |
||
2277
fc4b06d2cf78
remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents:
2262
diff
changeset
|
1134 |
oldMethod := self compiledMethodAt:newSelector. |
fc4b06d2cf78
remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents:
2262
diff
changeset
|
1135 |
|
362 | 1136 |
CatchMethodRedefinitions ifTrue:[ |
1651
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1137 |
"check for attempts to redefine a method |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1138 |
in a different package. Signal a resumable error if so. |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1139 |
This allows tracing redefinitions of existing system methods |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1140 |
when filing in alien code .... |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1141 |
(which we may want to forbit sometimes) |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1142 |
" |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1143 |
oldMethod notNil ifTrue:[ |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1144 |
oldMethod package ~= newMethod package ifTrue:[ |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1145 |
" |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1146 |
attempt to redefine an existing method, which was |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1147 |
defined in another package. |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1148 |
If you continue in the debugger, the new method gets installed. |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1149 |
Otherwise, the existing (old) method remains valid. |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1150 |
|
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1151 |
You can turn of the catching of redefinitions by setting |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1152 |
CatchMethodRedefinitions to false |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1153 |
(also found in the Launchers 'settings-misc' menu) |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1154 |
" |
1928 | 1155 |
(MethodRedefinitionSignal |
1927
a6c8e3b01436
pass old -> new methods as parameter in
Claus Gittinger <cg@exept.de>
parents:
1924
diff
changeset
|
1156 |
raiseRequestWith:(oldMethod -> newMethod) |
a6c8e3b01436
pass old -> new methods as parameter in
Claus Gittinger <cg@exept.de>
parents:
1924
diff
changeset
|
1157 |
errorString:('redefinition of ' , name , '>>' , newSelector) |
1928 | 1158 |
) == #keep ifTrue:[ |
1159 |
newMethod package:oldMethod package |
|
1160 |
]. |
|
1927
a6c8e3b01436
pass old -> new methods as parameter in
Claus Gittinger <cg@exept.de>
parents:
1924
diff
changeset
|
1161 |
|
a6c8e3b01436
pass old -> new methods as parameter in
Claus Gittinger <cg@exept.de>
parents:
1924
diff
changeset
|
1162 |
"/ if proceeded, install as usual. |
1651
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1163 |
] |
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1164 |
] |
362 | 1165 |
]. |
1923
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1166 |
|
2277
fc4b06d2cf78
remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents:
2262
diff
changeset
|
1167 |
"/ remember new->old association in the OldMethods dictionary (if non-nil) |
fc4b06d2cf78
remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents:
2262
diff
changeset
|
1168 |
|
1923
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1169 |
OldMethods notNil ifTrue:[ |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1170 |
oldMethod notNil ifTrue:[ |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1171 |
"/ oldMethod source:(oldMethod source). |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1172 |
OldMethods at:newMethod put:oldMethod |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1173 |
] |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1174 |
]. |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1175 |
|
2277
fc4b06d2cf78
remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents:
2262
diff
changeset
|
1176 |
"/ remember in the projects overwritten dictionary |
fc4b06d2cf78
remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents:
2262
diff
changeset
|
1177 |
|
fc4b06d2cf78
remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents:
2262
diff
changeset
|
1178 |
oldMethod notNil ifTrue:[ |
fc4b06d2cf78
remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents:
2262
diff
changeset
|
1179 |
oldMethod package ~= newMethod package ifTrue:[ |
2335
a0e7564d47c7
remember methods sent to Project
Claus Gittinger <cg@exept.de>
parents:
2321
diff
changeset
|
1180 |
Project notNil ifTrue:[ |
a0e7564d47c7
remember methods sent to Project
Claus Gittinger <cg@exept.de>
parents:
2321
diff
changeset
|
1181 |
"/ allow configurations without Project |
a0e7564d47c7
remember methods sent to Project
Claus Gittinger <cg@exept.de>
parents:
2321
diff
changeset
|
1182 |
Project rememberOverwrittenMethod:newMethod from:oldMethod |
a0e7564d47c7
remember methods sent to Project
Claus Gittinger <cg@exept.de>
parents:
2321
diff
changeset
|
1183 |
] |
2277
fc4b06d2cf78
remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents:
2262
diff
changeset
|
1184 |
] |
fc4b06d2cf78
remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents:
2262
diff
changeset
|
1185 |
]. |
fc4b06d2cf78
remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents:
2262
diff
changeset
|
1186 |
|
92 | 1187 |
(super addSelector:newSelector withMethod:newMethod) ifTrue:[ |
1651
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1188 |
self addChangeRecordForMethod:newMethod. |
92 | 1189 |
] |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
1190 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
1191 |
"Created: 29.10.1995 / 19:42:42 / cg" |
1651
fc6505852b73
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
1646
diff
changeset
|
1192 |
"Modified: 9.9.1996 / 22:39:32 / stefan" |
2335
a0e7564d47c7
remember methods sent to Project
Claus Gittinger <cg@exept.de>
parents:
2321
diff
changeset
|
1193 |
"Modified: 30.1.1997 / 21:08:14 / cg" |
1923
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1194 |
! |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1195 |
|
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1196 |
basicAddSelector:newSelector withMethod:newMethod |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1197 |
"add the method given by 2nd argument under the selector given by |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1198 |
1st argument to the methodDictionary. |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1199 |
This does NOT append a change record to the changes file and tell |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1200 |
dependents. Also, no methodHistory is kept or redefinition is checked." |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1201 |
|
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1202 |
super addSelector:newSelector withMethod:newMethod |
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1203 |
|
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
1204 |
"Created: 7.11.1996 / 18:48:35 / cg" |
1 | 1205 |
! |
1206 |
||
2036
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1207 |
removeFromSystem |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1208 |
"ST-80 compatibility |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1209 |
remove myself from the system" |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1210 |
|
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1211 |
^ Smalltalk removeClass:self |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1212 |
|
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1213 |
"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
|
1214 |
! |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1215 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1216 |
removeSelector:aSelector |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1217 |
"remove the selector, aSelector and its associated method |
92 | 1218 |
from the methodDictionary. |
153 | 1219 |
Append a change record to the changes file and tell dependents." |
1 | 1220 |
|
92 | 1221 |
(super removeSelector:aSelector) ifTrue:[ |
2095
fa85d9f387ac
beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents:
2088
diff
changeset
|
1222 |
self addChangeRecordForRemoveSelector:aSelector. |
fa85d9f387ac
beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents:
2088
diff
changeset
|
1223 |
"/ |
fa85d9f387ac
beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents:
2088
diff
changeset
|
1224 |
"/ also notify a change of mySelf; |
fa85d9f387ac
beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents:
2088
diff
changeset
|
1225 |
"/ |
fa85d9f387ac
beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents:
2088
diff
changeset
|
1226 |
self changed:#methodDictionary with:aSelector. |
fa85d9f387ac
beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents:
2088
diff
changeset
|
1227 |
|
fa85d9f387ac
beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents:
2088
diff
changeset
|
1228 |
"/ |
fa85d9f387ac
beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents:
2088
diff
changeset
|
1229 |
"/ also notify a change of Smalltalk; |
fa85d9f387ac
beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents:
2088
diff
changeset
|
1230 |
"/ this allows a dependent of Smalltalk to watch all class |
fa85d9f387ac
beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents:
2088
diff
changeset
|
1231 |
"/ changes (no need for observing all classes) |
fa85d9f387ac
beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents:
2088
diff
changeset
|
1232 |
"/ - this allows for watchers to find out if its a new method or a method-change |
fa85d9f387ac
beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents:
2088
diff
changeset
|
1233 |
"/ |
fa85d9f387ac
beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents:
2088
diff
changeset
|
1234 |
Smalltalk changed:#methodInClassRemoved with:(Array with:self with:aSelector). |
1 | 1235 |
] |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
1236 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
1237 |
"Created: 29.10.1995 / 19:42:47 / cg" |
2095
fa85d9f387ac
beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents:
2088
diff
changeset
|
1238 |
"Modified: 8.1.1997 / 23:03:49 / cg" |
216 | 1239 |
! |
1240 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1241 |
unload |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1242 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1243 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1244 |
"if the receiver was autoloaded, unload and reinstall it as |
293 | 1245 |
autoloaded. Can be used to get rid of no longer needed autoloaded |
328 | 1246 |
classes. |
1247 |
(maybe, autoloaded classes should unload themselfes when no |
|
1248 |
longer needed - for example, after some delay when the last instance |
|
1249 |
is gone ...)" |
|
293 | 1250 |
|
1251 |
|nm| |
|
1252 |
||
216 | 1253 |
self wasAutoloaded ifFalse:[ |
1254 |
||
1415 | 1255 |
" |
1256 |
can it be done ? |
|
1257 |
" |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1258 |
self methodDictionary do:[:aMethod | |
1415 | 1259 |
aMethod source isNil ifTrue:[^false]. |
1260 |
aMethod hasPrimitiveCode ifTrue:[^ false]. |
|
1261 |
]. |
|
216 | 1262 |
]. |
1263 |
||
283 | 1264 |
self allSubclassesDo:[:aClass | |
1415 | 1265 |
aClass unload |
283 | 1266 |
]. |
1415 | 1267 |
Transcript showCR:'unloading ' , name , ' ...'. |
283 | 1268 |
|
359 | 1269 |
Autoload removeClass:self. |
293 | 1270 |
nm := name. |
1271 |
Smalltalk at:nm put:nil. |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1272 |
"/ name := (nm , ' (leftover)') asSymbol. |
288 | 1273 |
ObjectMemory flushInlineCaches. |
1274 |
ObjectMemory flushMethodCache. |
|
293 | 1275 |
Autoload addClass:nm inCategory:category. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1276 |
"/ category := #unloaded. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1277 |
Smalltalk flushCachedClasses. |
216 | 1278 |
^ true |
1279 |
||
1280 |
" |
|
1281 |
Clock open. |
|
1282 |
Clock unload. |
|
1283 |
ClockView unload. |
|
1284 |
Clock open |
|
1285 |
" |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1286 |
|
1415 | 1287 |
"Modified: 18.5.1996 / 15:41:49 / cg" |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1288 |
"Modified: 7.6.1996 / 09:15:05 / stefan" |
1 | 1289 |
! ! |
1290 |
||
453 | 1291 |
!Class methodsFor:'binary storage'! |
1292 |
||
2477 | 1293 |
addGlobalsForBinaryStorageTo:globalDictionary |
453 | 1294 |
" |
1295 |
classPool == nil ifFalse: [ |
|
2477 | 1296 |
classPool associationsDo: [:assoc| |
1297 |
globalDictionary at: assoc put: self |
|
1298 |
] |
|
453 | 1299 |
] |
1300 |
" |
|
2477 | 1301 |
|
1302 |
"Created: 21.3.1997 / 15:40:45 / cg" |
|
453 | 1303 |
! |
1304 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1305 |
binaryClassDefinitionFrom:stream manager:manager |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1306 |
"retrieve a class as stored previously with |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1307 |
#storeBinaryClassOn:manager: |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1308 |
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
|
1309 |
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
|
1310 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1311 |
|superclassName name flags instvars classvars category classInstVars |
1756 | 1312 |
comment package superclassSig rev |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1313 |
newClass superClass methods cmethods formatID environment |
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1314 |
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
|
1315 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1316 |
"/ 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
|
1317 |
"/ the storing in #storeBinaryClassOn:manager: |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1318 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1319 |
"/ retrieve |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1320 |
"/ formatID |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1321 |
"/ superclasses name, |
944
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1322 |
"/ superclasses signature |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1323 |
"/ name, |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1324 |
"/ typeSymbol, |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1325 |
"/ instVarNames |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1326 |
"/ classVarNames |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1327 |
"/ category |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1328 |
"/ classInstVarNames |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1329 |
"/ comment |
1756 | 1330 |
"/ revision |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1331 |
"/ package |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1332 |
"/ name of owner, or nil |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1333 |
"/ classes methodDictionary |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1334 |
"/ methodDictionary |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1335 |
"/ number of private classes |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1336 |
"/ private classes, if any |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1337 |
|
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1338 |
formatID := manager nextObject. |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1339 |
formatID isInteger ifFalse:[ "/ backward compatibilty |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1340 |
formatID := nil. |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1341 |
superclassName := formatID |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1342 |
] ifTrue:[ |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1343 |
superclassName := manager nextObject. |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1344 |
]. |
944
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1345 |
superclassSig := manager nextObject. |
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1346 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1347 |
superclassName notNil ifTrue:[ |
1439 | 1348 |
superClass := Smalltalk at:superclassName ifAbsent:nil. |
1349 |
||
1350 |
superClass isNil ifTrue:[ |
|
1351 |
BinaryIOManager nonexistingClassSignal |
|
1352 |
raiseRequestWith:'non existent superclass (in binaryLoad)'. |
|
1353 |
^ nil |
|
1354 |
]. |
|
1355 |
||
1356 |
"/ ('loading superclass: ' , superclassName ) printNL. |
|
1357 |
superClass autoload. |
|
1358 |
superClass := Smalltalk at:superclassName. |
|
1359 |
||
1360 |
superclassSig ~= superClass signature ifTrue:[ |
|
1361 |
BinaryIOManager changedInstLayoutSignal |
|
1362 |
raiseRequestWith:'incompatible superclass (in binaryLoad)'. |
|
1363 |
^ nil |
|
1364 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1365 |
]. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1366 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1367 |
name := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1368 |
flags := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1369 |
instvars := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1370 |
instvars isNil ifTrue:[instvars := '']. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1371 |
classvars := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1372 |
classvars isNil ifTrue:[classvars := '']. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1373 |
category := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1374 |
classInstVars := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1375 |
classInstVars isNil ifTrue:[classInstVars := '']. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1376 |
comment := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1377 |
package := manager nextObject. |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1378 |
formatID == 1 ifTrue:[ |
1756 | 1379 |
rev := manager nextObject. |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1380 |
ownerName := manager nextObject. |
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1381 |
ownerName notNil ifTrue:[ |
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1382 |
name := name copyFrom:(ownerName size + 2 + 1). |
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1383 |
owner := Smalltalk at:ownerName. |
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1384 |
] |
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1385 |
]. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1386 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1387 |
"/ 'got superName:' print. superclassName printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1388 |
"/ 'got name:' print. name printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1389 |
"/ 'got flags: ' print. flags printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1390 |
"/ 'got instvars: ' print. instvars printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1391 |
"/ 'got classvars: ' print. classvars printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1392 |
"/ 'got category: ' print. category printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1393 |
"/ 'got classInstvars: ' print. classInstVars printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1394 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1395 |
"/ ('create class: ' , name ) printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1396 |
|
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1397 |
owner notNil ifTrue:[ |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1398 |
environment := owner |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1399 |
] ifFalse:[ |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1400 |
environment := Class nameSpaceQuerySignal raise. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1401 |
]. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1402 |
|
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1403 |
cls := superClass. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1404 |
superClass isNil ifTrue:[ |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1405 |
cls := Object |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1406 |
]. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1407 |
|
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1408 |
newClass := cls class |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1409 |
name:name asSymbol |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1410 |
in:environment |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1411 |
subclassOf:cls |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1412 |
instanceVariableNames:instvars |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1413 |
variable:false |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1414 |
words:false |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1415 |
pointers:true |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1416 |
classVariableNames:classvars |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1417 |
poolDictionaries:'' |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1418 |
category:category |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1419 |
comment:comment |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1420 |
changed:false |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1421 |
classInstanceVariableNames:classInstVars. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1422 |
|
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1423 |
newClass isNil ifTrue:[ |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1424 |
^ nil. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1425 |
]. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1426 |
|
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1427 |
superClass isNil ifTrue:[ |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1428 |
newClass setSuperclass:nil. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1429 |
newClass class setSuperclass:Class. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1430 |
]. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1431 |
|
1759 | 1432 |
"/ Transcript showCR:'loaded ' , name , ' in ' , environment name. |
1433 |
||
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1434 |
newClass flags:flags. |
453 | 1435 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1436 |
"/ retrieve class methods |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1437 |
cmethods := MethodDictionary binaryFullDefinitionFrom:stream manager:manager. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1438 |
"/ retrieve inst methods |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1439 |
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
|
1440 |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1441 |
formatID == 1 ifTrue:[ |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1442 |
"/ privateClasses |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1443 |
nPrivate := manager nextObject. |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1444 |
nPrivate timesRepeat:[ |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1445 |
Class nameSpaceQuerySignal |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1446 |
answer:newClass |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1447 |
do:[ |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1448 |
privateClass := manager nextObject |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1449 |
] |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1450 |
] |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1451 |
]. |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1452 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1453 |
(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
|
1454 |
newClass isNil ifTrue:[ |
1439 | 1455 |
^ nil |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1456 |
]. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1457 |
|
1756 | 1458 |
owner notNil ifTrue:[ |
1459 |
newClass category:nil. |
|
1460 |
] ifFalse:[ |
|
1461 |
newClass package:package. |
|
1462 |
]. |
|
1463 |
||
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1464 |
newClass methodDictionary:methods. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1465 |
newClass class methodDictionary:cmethods. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1466 |
^ newClass |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1467 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1468 |
"Modified: 7.6.1996 / 13:43:06 / stefan" |
1699
42a53290bd5d
allow for a class to be loaded into another environment
Claus Gittinger <cg@exept.de>
parents:
1687
diff
changeset
|
1469 |
"Created: 8.10.1996 / 17:57:02 / cg" |
1900 | 1470 |
"Modified: 5.11.1996 / 22:01:09 / cg" |
872 | 1471 |
! |
1472 |
||
1473 |
storeBinaryClassOn:stream manager:manager |
|
1474 |
"store a classes complete description (i.e. including methods). |
|
1475 |
However, the superclass chain is not stored - at load time, that must |
|
1476 |
be either present or autoloadable." |
|
1477 |
||
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1478 |
|s sig owner privateClasses| |
872 | 1479 |
|
1480 |
stream nextPut: manager codeForClass. |
|
1481 |
||
1482 |
"/ the following order must correlate to |
|
1483 |
"/ the storing in #binaryDefinitionFrom:manager: |
|
1484 |
||
1485 |
"/ store |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1486 |
"/ format ID |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1487 |
"/ superclasses name |
944
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1488 |
"/ superclasses signature |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1489 |
"/ name |
872 | 1490 |
"/ typeSymbol, |
1491 |
"/ instVarNames |
|
1492 |
"/ classVarNames |
|
1493 |
"/ category |
|
1494 |
"/ classInstVarNames |
|
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1495 |
"/ comment |
902
2e1c740a255f
also store the package in binaryClassStore
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1496 |
"/ package |
1756 | 1497 |
"/ revision |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1498 |
"/ name of owner, or nil |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1499 |
"/ classes methodDictionary |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1500 |
"/ methodDictionary |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1501 |
"/ # of privateClass names |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1502 |
"/ privateClasses, if any |
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 |
1 storeBinaryOn:stream manager:manager. "/ formatID |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1505 |
|
1756 | 1506 |
owner := self owningClass. |
1507 |
||
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1508 |
superclass isNil ifTrue:[ |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1509 |
s := nil. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1510 |
sig := 0. |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1511 |
] ifFalse:[ |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1512 |
s := superclass name. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1513 |
sig := superclass signature. |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1514 |
]. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1515 |
s storeBinaryOn:stream manager:manager. |
944
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1516 |
sig storeBinaryOn:stream manager:manager. |
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1517 |
|
872 | 1518 |
name storeBinaryOn:stream manager:manager. |
1519 |
flags storeBinaryOn:stream manager:manager. |
|
1520 |
(instvars notNil and:[instvars isEmpty]) ifTrue:[ |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1521 |
s := nil |
872 | 1522 |
] ifFalse:[ |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1523 |
s := instvars |
872 | 1524 |
]. |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1525 |
s storeBinaryOn:stream manager:manager. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1526 |
|
872 | 1527 |
(classvars notNil and:[classvars isEmpty]) ifTrue:[ |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1528 |
s := nil |
872 | 1529 |
] ifFalse:[ |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1530 |
s := classvars |
872 | 1531 |
]. |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1532 |
s storeBinaryOn:stream manager:manager. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1533 |
|
1756 | 1534 |
"/ the category |
1535 |
owner notNil ifTrue:[ |
|
1759 | 1536 |
nil storeBinaryOn:stream manager:manager. |
1756 | 1537 |
] ifFalse:[ |
1538 |
category storeBinaryOn:stream manager:manager. |
|
1759 | 1539 |
]. |
1540 |
||
1541 |
"/ the classInstVarString |
|
1542 |
s := self class instanceVariableString. |
|
1543 |
(s notNil and:[s isEmpty]) ifTrue:[ |
|
1544 |
s := nil |
|
872 | 1545 |
]. |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1546 |
s storeBinaryOn:stream manager:manager. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1547 |
|
1756 | 1548 |
"/ the comment |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1549 |
s := comment. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1550 |
manager sourceMode == #discard ifTrue:[ |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1551 |
s := nil |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1552 |
]. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1553 |
s storeBinaryOn:stream manager:manager. |
1756 | 1554 |
|
1555 |
"/ the revision, package & owner |
|
1556 |
owner notNil ifTrue:[ |
|
1557 |
nil storeBinaryOn:stream manager:manager. |
|
1558 |
nil storeBinaryOn:stream manager:manager. |
|
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1559 |
owner name storeBinaryOn:stream manager:manager. |
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1560 |
] ifFalse:[ |
1756 | 1561 |
package storeBinaryOn:stream manager:manager. |
1562 |
revision storeBinaryOn:stream manager:manager. |
|
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1563 |
nil storeBinaryOn:stream manager:manager. |
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1564 |
]. |
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1565 |
|
944
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1566 |
"/ |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1567 |
"/ store class method dictionary and methods |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1568 |
"/ |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1569 |
self class methodDictionary storeFullBinaryDefinitionOn:stream manager:manager. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1570 |
"/ store inst method dictionary and methods |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1571 |
self methodDictionary storeFullBinaryDefinitionOn:stream manager:manager. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1572 |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1573 |
"/ |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1574 |
"/ names of private classes |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1575 |
"/ |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1576 |
privateClasses := self privateClasses. |
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1577 |
privateClasses size storeBinaryOn:stream manager:manager. |
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1578 |
privateClasses size > 0 ifTrue:[ |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1579 |
privateClasses do:[:aClass | |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1580 |
aClass storeBinaryClassOn:stream manager:manager |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1581 |
] |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1582 |
]. |
872 | 1583 |
|
1584 |
" |
|
1585 |
|bos| |
|
1586 |
||
1587 |
bos := BinaryObjectStorage onNew: (Filename named: 'FBrowser.cls') writeStream. |
|
1588 |
bos nextPutClasses:(Array with:FileBrowser). |
|
1589 |
bos close. |
|
1590 |
" |
|
1591 |
" |
|
1592 |
|bos cls| |
|
1593 |
||
1594 |
bos := BinaryObjectStorage onOld: (Filename named: 'FBrowser.cls') readStream. |
|
1595 |
cls := bos next. |
|
1596 |
bos close. |
|
1597 |
cls open. |
|
1598 |
" |
|
1599 |
||
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1600 |
"Modified: 7.6.1996 / 13:39:02 / stefan" |
1759 | 1601 |
"Modified: 15.10.1996 / 21:13:32 / cg" |
872 | 1602 |
! |
1603 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1604 |
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
|
1605 |
"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
|
1606 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1607 |
| string | |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1608 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1609 |
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
|
1610 |
stream nextNumber: 2 put: string size. |
2463
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1611 |
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
|
1612 |
"/ string do: [:char| stream nextPut: char asciiValue] |
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1613 |
|
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1614 |
"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
|
1615 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1616 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1617 |
storeBinaryDefinitionOn: stream manager: manager |
1259 | 1618 |
"store the receiver in a binary format on stream. |
1619 |
This is an internal interface for binary storage mechanism. |
|
1620 |
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
|
1621 |
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
|
1622 |
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
|
1623 |
restore time. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1624 |
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
|
1625 |
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
|
1626 |
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
|
1627 |
(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
|
1628 |
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
|
1629 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1630 |
|varnames n sz| |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1631 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1632 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1633 |
output the signature |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1634 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1635 |
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
|
1636 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1637 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1638 |
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
|
1639 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1640 |
varnames := self allInstVarNames. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1641 |
n := varnames size. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1642 |
n == 0 ifTrue:[ |
1259 | 1643 |
sz := 0 |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1644 |
] ifFalse:[ |
1259 | 1645 |
sz := varnames inject:0 into:[:sum :nm | sum + nm size]. |
1646 |
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
|
1647 |
]. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1648 |
stream nextNumber:2 put:sz. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1649 |
varnames keysAndValuesDo:[:i :nm | |
2463
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1650 |
stream nextPutBytes:(nm size) from:nm startingAt:1. |
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1651 |
"/ nm do:[:c | |
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1652 |
"/ stream nextPut:c asciiValue |
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1653 |
"/ ]. |
1259 | 1654 |
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
|
1655 |
]. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1656 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1657 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1658 |
output my name |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1659 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1660 |
stream nextNumber:2 put:name size. |
2463
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1661 |
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
|
1662 |
"/ name do:[:c| |
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1663 |
"/ stream nextPut:c asciiValue |
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1664 |
"/ ] |
937
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 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1667 |
|s| |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1668 |
s := WriteStream on:ByteArray new. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1669 |
Rectangle storeBinaryOn:s. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1670 |
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
|
1671 |
" |
1259 | 1672 |
|
2463
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1673 |
"Modified: 19.3.1997 / 18:47:10 / cg" |
453 | 1674 |
! ! |
1675 |
||
1676 |
!Class methodsFor:'c function interfacing'! |
|
1677 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1678 |
cInterfaceFunction:selector calling:cFunctionNameString args:argTypeArray returning:returnType |
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1679 |
"{ Pragma: +optSpace }" |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1680 |
|
453 | 1681 |
"create an interface to an existing (i.e. already linked in) c function. |
1682 |
The function can be called by sending selector to the receiver class. |
|
1683 |
The c-function has the name cFunctionNameString, and expects parameters as specified in |
|
1684 |
argTypeArray. The functions return value has a type as specified by returnType. |
|
1685 |
WARNING: |
|
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1686 |
this interface is EXPERIMENTAL - it may change or even be removed." |
453 | 1687 |
|
1688 |
StubGenerator isNil ifTrue:[ |
|
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1689 |
^ self error:'this system does not support dynamic C Interface functions'. |
453 | 1690 |
]. |
1691 |
||
1692 |
StubGenerator |
|
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1693 |
createStubFor:selector |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1694 |
calling:cFunctionNameString |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1695 |
args:argTypeArray |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1696 |
returning:returnType |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1697 |
in:self |
453 | 1698 |
|
1699 |
" |
|
1700 |
Object subclass:#CInterface |
|
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1701 |
instanceVariableNames:'' |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1702 |
classVariableNames:'' |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1703 |
poolDictionaries:'' |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1704 |
category:'Examples'. |
453 | 1705 |
|
1706 |
CInterface cInterfaceFunction:#printfOn:format:withFloat: |
|
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1707 |
calling:'fprintf' |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1708 |
args:#(ExternalStream String Float) |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1709 |
returning:#SmallInteger. |
453 | 1710 |
|
1711 |
CInterface printfOn:Stdout format:'this is a float: %g' withFloat:(Float pi). Stdout cr |
|
1712 |
" |
|
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1713 |
|
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
1714 |
"Modified: 5.1.1997 / 19:58:22 / cg" |
453 | 1715 |
! ! |
1716 |
||
1 | 1717 |
!Class methodsFor:'changes management'! |
1718 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1719 |
addChangeRecordForChangeCategory |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1720 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1721 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1722 |
"add a category change record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1723 |
|
2256 | 1724 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1725 |
self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category. |
|
1726 |
] |
|
1727 |
||
1728 |
"Modified: 24.1.1997 / 19:09:34 / cg" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1729 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1730 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1731 |
addChangeRecordForClass:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1732 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1733 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1734 |
"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
|
1735 |
|
2256 | 1736 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1737 |
self writingChangePerform:#addChangeRecordForClass:to: with:aClass. |
|
1738 |
] |
|
1739 |
||
1740 |
"Modified: 24.1.1997 / 19:09:41 / cg" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1741 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1742 |
|
620 | 1743 |
addChangeRecordForClassCheckIn:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1744 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1745 |
|
620 | 1746 |
"append a class-was-checkedIn-record to the changes file" |
1747 |
||
1938 | 1748 |
|rv| |
1749 |
||
2256 | 1750 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1751 |
rv := aClass revision. |
|
1752 |
rv isNil ifTrue:[rv := '???']. |
|
1753 |
||
1754 |
self |
|
1755 |
writingChangeWithTimeStamp:false |
|
1756 |
perform:#addInfoRecord:to: |
|
1757 |
with:('checkin ' , aClass name , ' (' , rv , ')'). |
|
1758 |
] |
|
620 | 1759 |
|
1760 |
"Created: 18.11.1995 / 17:04:58 / cg" |
|
2256 | 1761 |
"Modified: 24.1.1997 / 19:11:55 / cg" |
620 | 1762 |
! |
1763 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1764 |
addChangeRecordForClassComment:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1765 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1766 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1767 |
"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
|
1768 |
|
2256 | 1769 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1770 |
self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass. |
|
1771 |
] |
|
1772 |
||
1773 |
"Modified: 24.1.1997 / 19:09:59 / cg" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1774 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1775 |
|
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1776 |
addChangeRecordForClassContainerRemove:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1777 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1778 |
|
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1779 |
"append a container-was-removed-record to the changes file" |
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1780 |
|
2256 | 1781 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1782 |
self |
|
1783 |
writingChangeWithTimeStamp:false |
|
1784 |
perform:#addInfoRecord:to: |
|
1785 |
with:('removed source container of ' , aClass name). |
|
1786 |
] |
|
1787 |
||
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1788 |
"Created: 11.9.1996 / 15:37:19 / cg" |
2256 | 1789 |
"Modified: 24.1.1997 / 19:12:05 / cg" |
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1790 |
! |
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1791 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1792 |
addChangeRecordForClassFileOut:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1793 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1794 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1795 |
"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
|
1796 |
|
2256 | 1797 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1798 |
self |
|
1799 |
writingChangeWithTimeStamp:false |
|
1800 |
perform:#addInfoRecord:to: |
|
1801 |
with:('fileOut ' , aClass name). |
|
1802 |
] |
|
1803 |
||
1804 |
"Modified: 24.1.1997 / 19:12:14 / cg" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1805 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1806 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1807 |
addChangeRecordForClassInstvars:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1808 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1809 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1810 |
"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
|
1811 |
|
2256 | 1812 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1813 |
self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass. |
|
1814 |
] |
|
1815 |
||
1816 |
"Modified: 24.1.1997 / 19:10:18 / cg" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1817 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1818 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1819 |
addChangeRecordForClassRemove:oldName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1820 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1821 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1822 |
"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
|
1823 |
|
2256 | 1824 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1825 |
self writingChangePerform:#addChangeRecordForClassRemove:to: with:oldName. |
|
1826 |
] |
|
1827 |
||
1828 |
"Modified: 24.1.1997 / 19:10:25 / cg" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1829 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1830 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1831 |
addChangeRecordForClassRename:oldName to:newName |
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 |
"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
|
1835 |
|
2256 | 1836 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1837 |
self writingChangeDo:[:aStream | |
|
1838 |
self addChangeRecordForClassRename:oldName to:newName to:aStream |
|
1839 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1840 |
] |
1846 | 1841 |
|
2256 | 1842 |
"Modified: 24.1.1997 / 19:10:35 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1843 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1844 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1845 |
addChangeRecordForMethod:aMethod |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1846 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1847 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1848 |
"add a method-change-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1849 |
|
2206 | 1850 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1851 |
self writingChangePerform:#addChangeRecordForMethod:to: with:aMethod. |
|
1852 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1853 |
Project notNil ifTrue:[ |
|
1854 |
Project addMethodChange:aMethod in:self |
|
1855 |
] |
|
555 | 1856 |
] |
2206 | 1857 |
|
1858 |
"Modified: 20.1.1997 / 12:36:02 / cg" |
|
555 | 1859 |
! |
1860 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1861 |
addChangeRecordForMethodCategory:aMethod category:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1862 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1863 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1864 |
"add a methodCategory-change-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1865 |
|
2206 | 1866 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1867 |
self writingChangeDo:[:aStream | |
|
1868 |
self addChangeRecordForMethodCategory:aMethod category:aString to:aStream. |
|
1869 |
]. |
|
1870 |
||
1871 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1872 |
Project notNil ifTrue:[ |
|
1873 |
Project addMethodCategoryChange:aMethod category:aString in:self |
|
1874 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1875 |
] |
2206 | 1876 |
|
1877 |
"Modified: 20.1.1997 / 12:36:05 / cg" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1878 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1879 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1880 |
addChangeRecordForMethodPrivacy:aMethod |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1881 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1882 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1883 |
"add a method-privacy-change-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1884 |
|
2206 | 1885 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1886 |
self writingChangePerform:#addChangeRecordForMethodPrivacy:to: with:aMethod. |
|
1887 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1888 |
Project notNil ifTrue:[ |
|
1889 |
Project addMethodPrivacyChange:aMethod in:self |
|
1890 |
] |
|
555 | 1891 |
] |
1892 |
||
1893 |
"Modified: 27.8.1995 / 22:47:32 / claus" |
|
2206 | 1894 |
"Modified: 20.1.1997 / 12:36:08 / cg" |
555 | 1895 |
! |
1896 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1897 |
addChangeRecordForPrimitiveDefinitions:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1898 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1899 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1900 |
"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
|
1901 |
|
2206 | 1902 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1903 |
self writingChangePerform:#addChangeRecordForPrimitiveDefinitions:to: with:aClass. |
|
1904 |
Project notNil ifTrue:[ |
|
1905 |
Project addPrimitiveDefinitionsChangeFor:aClass |
|
1906 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1907 |
] |
2206 | 1908 |
|
1909 |
"Modified: 20.1.1997 / 12:36:10 / cg" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1910 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1911 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1912 |
addChangeRecordForPrimitiveFunctions:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1913 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1914 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1915 |
"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
|
1916 |
|
2206 | 1917 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1918 |
self writingChangePerform:#addChangeRecordForPrimitiveFunctions:to: with:aClass. |
|
1919 |
Project notNil ifTrue:[ |
|
1920 |
Project addPrimitiveFunctionsChangeFor:aClass |
|
1921 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1922 |
] |
2206 | 1923 |
|
1924 |
"Modified: 20.1.1997 / 12:36:13 / cg" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1925 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1926 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1927 |
addChangeRecordForPrimitiveVariables:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1928 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1929 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1930 |
"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
|
1931 |
|
2206 | 1932 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1933 |
self writingChangePerform:#addChangeRecordForPrimitiveVariables:to: with:aClass. |
|
1934 |
Project notNil ifTrue:[ |
|
1935 |
Project addPrimitiveVariablesChangeFor:aClass |
|
1936 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1937 |
] |
2206 | 1938 |
|
1939 |
"Modified: 20.1.1997 / 12:36:16 / cg" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1940 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1941 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1942 |
addChangeRecordForRemoveSelector:aSelector |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1943 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1944 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1945 |
"add a method-remove-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1946 |
|
2256 | 1947 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1948 |
self writingChangePerform:#addChangeRecordForRemoveSelector:to: with:aSelector. |
|
1949 |
] |
|
1950 |
||
1951 |
"Modified: 24.1.1997 / 19:10:48 / cg" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1952 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1953 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1954 |
addChangeRecordForRenameCategory:oldCategory to:newCategory |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1955 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1956 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1957 |
"add a category-rename record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1958 |
|
2256 | 1959 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1960 |
self writingChangeDo:[:aStream | |
|
1961 |
self addChangeRecordForRenameCategory:oldCategory to:newCategory to:aStream. |
|
1962 |
] |
|
555 | 1963 |
] |
2256 | 1964 |
|
1965 |
"Modified: 24.1.1997 / 19:10:57 / cg" |
|
555 | 1966 |
! |
1967 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1968 |
addChangeRecordForSnapshot:aFileName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1969 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1970 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1971 |
"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
|
1972 |
|
2256 | 1973 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1974 |
self |
|
1975 |
writingChangeWithTimeStamp:false |
|
1976 |
perform:#addInfoRecord:to: |
|
1977 |
with:('snapshot ' , aFileName). |
|
1978 |
] |
|
1979 |
||
1980 |
"Modified: 24.1.1997 / 19:12:25 / cg" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1981 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1982 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1983 |
addChangeRecordForSnapshot:aFileName to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1984 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1985 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1986 |
"add a snapshot-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1987 |
|
2256 | 1988 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
1989 |
self addInfoRecord:('snapshot ' , aFileName) to:aStream |
|
1990 |
] |
|
1991 |
||
1992 |
"Modified: 24.1.1997 / 19:11:08 / cg" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1993 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1994 |
|
620 | 1995 |
addChangeTimeStampTo:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1996 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1997 |
|
620 | 1998 |
"a timestamp - prepended to any change, except infoRecords" |
1999 |
||
2000 |
|info| |
|
2001 |
||
2256 | 2002 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
2003 |
info := 'timestamp ' , OperatingSystem getLoginName , '@' , OperatingSystem getHostName. |
|
2004 |
self addInfoRecord:info to:aStream. aStream cr. |
|
2005 |
] |
|
620 | 2006 |
|
2007 |
"Created: 18.11.1995 / 15:41:01 / cg" |
|
2256 | 2008 |
"Modified: 24.1.1997 / 19:11:19 / cg" |
620 | 2009 |
! |
2010 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2011 |
addInfoRecord:aMessage |
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2012 |
"{ Pragma: +optSpace }" |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2013 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2014 |
"add an info-record (snapshot, class fileOut etc.) to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2015 |
|
2256 | 2016 |
UpdateChangeFileQuerySignal raise ifTrue:[ |
2017 |
self writingChangeWithTimeStamp:false |
|
2018 |
perform:#addInfoRecord:to: |
|
2019 |
with:aMessage. |
|
2020 |
] |
|
2021 |
||
2022 |
"Modified: 24.1.1997 / 19:13:14 / cg" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2023 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2024 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2025 |
changesStream |
2256 | 2026 |
"return a Stream for the writing changes file. |
2195 | 2027 |
This returns a regular stream or a locked stream - according to |
2028 |
the LockChangesFile settings |
|
2029 |
(recommended if multiple images operate on a common changes file)" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2030 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2031 |
|streamType aStream fileName| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2032 |
|
2256 | 2033 |
fileName := ObjectMemory nameForChanges. |
2034 |
||
2035 |
LockChangesFile ifTrue:[ |
|
2036 |
streamType := LockedFileStream. |
|
2037 |
] ifFalse:[ |
|
2038 |
streamType := FileStream. |
|
2039 |
]. |
|
2040 |
aStream := streamType oldFileNamed:fileName. |
|
2041 |
aStream isNil ifTrue:[ |
|
2042 |
aStream := streamType newFileNamed:fileName. |
|
2195 | 2043 |
aStream isNil ifTrue:[ |
2256 | 2044 |
self warn:'cannot create/update the changes file'. |
2045 |
^ nil |
|
2046 |
] |
|
92 | 2047 |
]. |
2256 | 2048 |
aStream setToEnd. |
92 | 2049 |
^ aStream |
453 | 2050 |
|
2051 |
"Created: 28.10.1995 / 16:53:43 / cg" |
|
2256 | 2052 |
"Modified: 24.1.1997 / 19:14:27 / cg" |
92 | 2053 |
! |
2054 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2055 |
sourcesStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2056 |
"return a stream for writing the sources file. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2057 |
Notice, in ST/X, it is noncommon to use a single |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2058 |
source file; typically each classes source is kept |
555 | 2059 |
in a separate file." |
2060 |
||
2061 |
|aStream fileName| |
|
2062 |
||
2063 |
fileName := ObjectMemory nameForSources. |
|
2064 |
aStream := FileStream oldFileNamed:fileName. |
|
2065 |
aStream isNil ifTrue:[ |
|
1415 | 2066 |
aStream := FileStream newFileNamed:fileName. |
2067 |
aStream isNil ifTrue:[ |
|
2068 |
Transcript showCR:'cannot update sources file'. |
|
2069 |
^ nil |
|
2070 |
] |
|
555 | 2071 |
]. |
2072 |
aStream setToEnd. |
|
2073 |
^ aStream |
|
2074 |
||
2075 |
"Created: 28.10.1995 / 16:53:17 / cg" |
|
1415 | 2076 |
"Modified: 18.5.1996 / 15:41:47 / cg" |
555 | 2077 |
! |
2078 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2079 |
withoutUpdatingChangesDo:aBlock |
2195 | 2080 |
"turn off change file update while evaluating aBlock." |
2081 |
||
2082 |
UpdateChangeFileQuerySignal |
|
2083 |
answer:false |
|
2084 |
do:[ |
|
2085 |
aBlock value |
|
555 | 2086 |
]. |
2195 | 2087 |
|
2088 |
"Modified: 17.1.1997 / 20:48:05 / cg" |
|
1 | 2089 |
! ! |
2090 |
||
2091 |
!Class methodsFor:'compiling'! |
|
2092 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2093 |
compile:code |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2094 |
"compile code, aString for this class; |
742 | 2095 |
if successful update the method dictionary. |
2096 |
Returns the new method or nil (on failure)." |
|
2097 |
||
2098 |
^ self compilerClass |
|
759
908363ce8a32
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2099 |
compile:code |
908363ce8a32
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2100 |
forClass:self |
742 | 2101 |
|
2102 |
"Modified: 13.12.1995 / 10:56:00 / cg" |
|
328 | 2103 |
! |
2104 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2105 |
compile:code classified:category |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2106 |
"compile code, aString for this class; |
671 | 2107 |
if successful update the method dictionary. |
742 | 2108 |
The method is classified under category. |
2109 |
Returns the new method or nil (on failure)." |
|
2110 |
||
1234
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2111 |
^ self compile:code classified:category logged:true |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2112 |
|
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2113 |
"Modified: 20.4.1996 / 12:30:51 / cg" |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2114 |
! |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2115 |
|
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2116 |
compile:code classified:category logged:logged |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2117 |
"compile code, aString for this class; |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2118 |
if successful update the method dictionary. |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2119 |
The method is classified under category. |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2120 |
If logged is true, a changeRecord is written. |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2121 |
Returns the new method or nil (on failure)." |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2122 |
|
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2123 |
logged ifFalse:[ |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2124 |
self withoutUpdatingChangesDo:[ |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2125 |
^ self compilerClass |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2126 |
compile:code |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2127 |
forClass:self |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2128 |
inCategory:category |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2129 |
] |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2130 |
] ifTrue:[ |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2131 |
^ self compilerClass |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2132 |
compile:code |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2133 |
forClass:self |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2134 |
inCategory:category |
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2135 |
]. |
742 | 2136 |
|
2137 |
"Modified: 13.12.1995 / 11:02:34 / cg" |
|
1234
593af1cdd6ac
added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
2138 |
"Created: 20.4.1996 / 12:30:35 / cg" |
1 | 2139 |
! |
2140 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2141 |
compile:code notifying:requestor |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2142 |
"compile code, aString for this class; on any error, notify |
742 | 2143 |
requestor, anObject with the error reason. |
2144 |
Returns the new method or nil (on failure)." |
|
2145 |
||
2146 |
^ self compilerClass |
|
759
908363ce8a32
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2147 |
compile:code |
908363ce8a32
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2148 |
forClass:self |
908363ce8a32
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2149 |
notifying:requestor |
742 | 2150 |
|
2151 |
"Modified: 13.12.1995 / 11:02:40 / cg" |
|
1 | 2152 |
! |
2153 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2154 |
recompile |
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2155 |
"{ Pragma: +optSpace }" |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2156 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2157 |
"recompile all methods |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2158 |
used when a class changes instances and therefore all methods |
555 | 2159 |
have to be recompiled" |
2 | 2160 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2161 |
self methodDictionary keys do:[:aSelector | |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2162 |
self recompile:aSelector |
2 | 2163 |
] |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2164 |
|
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2165 |
"Modified: 12.6.1996 / 11:51:15 / stefan" |
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2166 |
"Modified: 5.1.1997 / 19:56:23 / cg" |
2 | 2167 |
! |
2168 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2169 |
recompile:aSelector |
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2170 |
"{ Pragma: +optSpace }" |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2171 |
|
1 | 2172 |
"recompile the method associated with the argument, aSelector; |
2173 |
used when a superclass changes instances and we have to recompile |
|
2174 |
subclasses" |
|
2175 |
||
199 | 2176 |
|cat code| |
1 | 2177 |
|
199 | 2178 |
Class withoutUpdatingChangesDo:[ |
978 | 2179 |
MethodRedefinitionSignal ignoreIn:[ |
2180 |
cat := (self compiledMethodAt:aSelector) category. |
|
2181 |
code := self sourceCodeAt:aSelector. |
|
2182 |
self compilerClass compile:code forClass:self inCategory:cat |
|
2183 |
] |
|
2 | 2184 |
] |
978 | 2185 |
|
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2186 |
"Modified: 5.1.1997 / 19:56:54 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2187 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2188 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2189 |
recompileAll |
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2190 |
"{ Pragma: +optSpace }" |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2191 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2192 |
"recompile this class and all subclasses" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2193 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2194 |
|classes| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2195 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2196 |
classes := self subclasses. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2197 |
self recompile. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2198 |
classes do:[:aClass | |
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2199 |
aClass recompileAll |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2200 |
] |
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2201 |
|
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2202 |
"Modified: 5.1.1997 / 19:56:29 / cg" |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2203 |
! |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2204 |
|
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2205 |
recompileForSpeed:aSelector |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2206 |
"{ Pragma: +optSpace }" |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2207 |
|
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2208 |
"recompile the method associated with the argument, aSelector; |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2209 |
for highest speed (i.e. using the stc compiler, if supported by |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2210 |
the architecture)." |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2211 |
|
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2212 |
|cat code prev savedMethod| |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2213 |
|
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2214 |
Class withoutUpdatingChangesDo:[ |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2215 |
MethodRedefinitionSignal ignoreIn:[ |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2216 |
savedMethod := self compiledMethodAt:aSelector. |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2217 |
cat := savedMethod category. |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2218 |
code := self sourceCodeAt:aSelector. |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2219 |
|
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2220 |
prev := Compiler stcCompilation:#always. |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2221 |
[ |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2222 |
self compilerClass compile:code forClass:self inCategory:cat |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2223 |
] valueNowOrOnUnwindDo:[ |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2224 |
Compiler stcCompilation:prev. |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2225 |
|
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2226 |
(self compiledMethodAt:aSelector) isNil ifTrue:[ |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2227 |
self primAddSelector:aSelector withMethod:savedMethod |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2228 |
] |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2229 |
] |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2230 |
] |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2231 |
] |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2232 |
|
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2233 |
"Created: 5.1.1997 / 19:22:41 / cg" |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2234 |
"Modified: 5.1.1997 / 19:55:33 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2235 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2236 |
|
1876 | 2237 |
recompileInvalidatedMethods |
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2238 |
"{ Pragma: +optSpace }" |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2239 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2240 |
"recompile all invalidated methods" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2241 |
|
1876 | 2242 |
self methodDictionary keysAndValuesDo:[:aSelector :aMethod | |
2243 |
|trap trapCode trapByteCode| |
|
2244 |
||
2245 |
trap := aMethod trapMethodForNumArgs:aMethod numArgs. |
|
2246 |
trapCode := trap code. |
|
2247 |
trapByteCode := trap byteCode. |
|
2248 |
||
2249 |
(aMethod code = trapCode |
|
2250 |
or:[aMethod byteCode == trapByteCode]) ifTrue:[ |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2251 |
self recompile:aSelector |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2252 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2253 |
] |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2254 |
|
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2255 |
"Modified: 12.6.1996 / 11:52:09 / stefan" |
1876 | 2256 |
"Created: 4.11.1996 / 22:12:47 / cg" |
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2257 |
"Modified: 5.1.1997 / 19:56:59 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2258 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2259 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2260 |
recompileMethodsAccessingAny:setOfNames |
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2261 |
"{ Pragma: +optSpace }" |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2262 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2263 |
"recompile all methods accessing a variable from setOfNames" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2264 |
|
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2265 |
self recompileMethodsAccessingAny:setOfNames orSuper:false |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2266 |
|
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2267 |
"Modified: 5.1.1997 / 19:57:05 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2268 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2269 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2270 |
recompileMethodsAccessingAny:setOfNames orSuper:superBoolean |
2071
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2271 |
"{ Pragma: +optSpace }" |
47a1f5d7e8a5
added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents:
2070
diff
changeset
|
2272 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2273 |
"recompile all methods accessing a variable from setOfNames, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2274 |
or super (if superBoolean is true)" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2275 |
|
2105
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2276 |
|p| |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2277 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2278 |
self methodDictionary keys do:[:aSelector | |
2105
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2279 |
|m mustCompile lits source| |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2280 |
|
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2281 |
m := self compiledMethodAt:aSelector. |
2105
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2282 |
mustCompile := nil. |
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2283 |
|
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2284 |
source := m source. |
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2285 |
|
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2286 |
"/ avoid parsing, if possible |
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2287 |
superBoolean ifFalse:[ |
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2288 |
setOfNames size == 1 ifTrue:[ |
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2289 |
(source findString:(setOfNames first)) == 0 ifTrue:[ |
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2290 |
mustCompile := false. |
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2291 |
] |
2104
fefe5f88f2e0
quicker recompilation if only a classVar has changed
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
2292 |
] |
2105
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2293 |
]. |
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2294 |
|
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2295 |
mustCompile isNil ifTrue:[ |
2104
fefe5f88f2e0
quicker recompilation if only a classVar has changed
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
2296 |
p := Parser parseMethod:(m source) in:self. |
fefe5f88f2e0
quicker recompilation if only a classVar has changed
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
2297 |
(p isNil |
fefe5f88f2e0
quicker recompilation if only a classVar has changed
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
2298 |
or:[(p usedVars notNil and:[p usedVars includesAny:setOfNames]) |
fefe5f88f2e0
quicker recompilation if only a classVar has changed
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
2299 |
or:[superBoolean and:[p usesSuper]]]) ifTrue:[ |
2105
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2300 |
mustCompile := true |
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2301 |
] |
2104
fefe5f88f2e0
quicker recompilation if only a classVar has changed
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
2302 |
]. |
fefe5f88f2e0
quicker recompilation if only a classVar has changed
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
2303 |
|
2105
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2304 |
mustCompile == true ifTrue:[ |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2305 |
self recompile:aSelector |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2306 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2307 |
] |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2308 |
|
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2309 |
"Modified: 12.6.1996 / 11:52:35 / stefan" |
2105
815fb9413872
oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents:
2104
diff
changeset
|
2310 |
"Modified: 9.1.1997 / 02:07:40 / cg" |
2309
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2311 |
! |
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2312 |
|
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2313 |
recompileMethodsAccessingGlobal:aGlobalKey |
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2314 |
"{ Pragma: +optSpace }" |
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2315 |
|
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2316 |
"recompile all methods accessing the global variable aGlobalKey" |
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2317 |
|
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2318 |
self methodDictionary keys do:[:aSelector | |
2321 | 2319 |
|m lits| |
2309
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2320 |
|
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2321 |
m := self compiledMethodAt:aSelector. |
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2322 |
"/ can look at the methods literalArray .. |
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2323 |
m isWrapped ifTrue:[ |
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2324 |
m := m originalMethod |
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2325 |
]. |
2321 | 2326 |
lits := m literals. |
2327 |
lits notNil ifTrue:[ |
|
2328 |
(lits includes:aGlobalKey) ifTrue:[ |
|
2329 |
self recompile:aSelector |
|
2330 |
] |
|
2309
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2331 |
] |
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2332 |
] |
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2333 |
|
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2334 |
"Modified: 12.6.1996 / 11:52:35 / stefan" |
9d0fafbb5855
support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents:
2277
diff
changeset
|
2335 |
"Created: 29.1.1997 / 17:57:55 / cg" |
2321 | 2336 |
"Modified: 29.1.1997 / 23:51:11 / cg" |
1 | 2337 |
! ! |
2338 |
||
1824 | 2339 |
!Class methodsFor:'enumerating'! |
2340 |
||
2341 |
privateClassesDo:aBlock |
|
2342 |
"evaluate aBlock on all of my private classes (if any)" |
|
2343 |
||
2344 |
|classes| |
|
2345 |
||
2346 |
(classes := self privateClasses) notNil ifTrue:[ |
|
2347 |
classes do:aBlock |
|
2348 |
]. |
|
2349 |
||
2350 |
"Created: 26.10.1996 / 12:28:57 / cg" |
|
2351 |
! ! |
|
2352 |
||
1 | 2353 |
!Class methodsFor:'fileIn interface'! |
2354 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2355 |
ignoredMethodsFor:aCategory |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2356 |
"this is a speciality of ST/X - it allows quick commenting of methods |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2357 |
from a source-file by replacing the 'methodsFor:' by 'ignoredMethodsFor:'. |
555 | 2358 |
Returns a ClassCategoryReader to read in and skip methods." |
2359 |
||
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2360 |
^ (self methodsFor:aCategory) ignoredProtocol |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2361 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2362 |
"Modified: 10.2.1996 / 12:53:25 / cg" |
555 | 2363 |
! |
2364 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2365 |
methods |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2366 |
"this method allows fileIn of ST/V methods - |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2367 |
return a ClassCategoryReader to read in and compile methods for me. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2368 |
Since ST/V does not support method categories, the loaded methods are |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2369 |
categorized as 'ST/V methods'." |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2370 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2371 |
^ ClassCategoryReader class:self category:'ST/V methods' |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2372 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2373 |
"Modified: 10.2.1996 / 12:44:21 / cg" |
555 | 2374 |
! |
2375 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2376 |
methodsFor:aCategory |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2377 |
"return a ClassCategoryReader to read in and compile methods for me." |
1 | 2378 |
|
2379 |
^ ClassCategoryReader class:self category:aCategory |
|
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2380 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2381 |
"Modified: 10.2.1996 / 12:44:43 / cg" |
1 | 2382 |
! |
2383 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2384 |
methodsForUndefined:categoryString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2385 |
"ST-80 compatibility. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2386 |
I dont yet know what this does - it was encountered by some tester. |
555 | 2387 |
For now, simply forward it." |
2388 |
||
2389 |
^ self methodsFor:categoryString |
|
2390 |
! |
|
2391 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2392 |
primitiveDefinitions |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2393 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2394 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2395 |
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
|
2396 |
unprocessed contents in the classes primitiveDefinitions section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2397 |
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
|
2398 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2399 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2400 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2401 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2402 |
"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
|
2403 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2404 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2405 |
primitiveFunctions |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2406 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2407 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2408 |
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
|
2409 |
unprocessed contents in the classes primitiveFunctions section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2410 |
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
|
2411 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2412 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2413 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2414 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2415 |
"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
|
2416 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2417 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2418 |
primitiveVariables |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2419 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2420 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2421 |
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
|
2422 |
unprocessed contents in the classes primitiveVariables section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2423 |
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
|
2424 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2425 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2426 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2427 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2428 |
"Modified: 10.2.1996 / 12:47:28 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2429 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2430 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2431 |
privateMethodsFor:aCategory |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2432 |
"this method allows fileIn of ENVY and ST/X private methods. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2433 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2434 |
The following methods are only allowed to be executed if sent from a method |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2435 |
within the current class. Subclass sends or out-of-class sends will raise |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2436 |
a privatMethodError exception." |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2437 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2438 |
^ (self methodsFor:aCategory) privateProtocol |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2439 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2440 |
"Modified: 10.2.1996 / 12:48:44 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2441 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2442 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2443 |
protectedMethodsFor:aCategory |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2444 |
"this method allows fileIn of ENVY and ST/X protected methods. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2445 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2446 |
The following methods are only allowed to be executed if sent from a method |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2447 |
within the current class or a subclass. Out-of-class sends will raise |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2448 |
a privatMethodError exception." |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2449 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2450 |
^ (self methodsFor:aCategory) protectedProtocol |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2451 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2452 |
"Modified: 10.2.1996 / 12:49:18 / cg" |
557
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 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2455 |
publicMethodsFor:aCategory |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2456 |
"this method allows fileIn of ENVY methods |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2457 |
The publicMethods keyword is for documentation only; my default, methods |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2458 |
are public anyway (for backward compatibility)." |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2459 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2460 |
^ self methodsFor:aCategory |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2461 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2462 |
"Modified: 10.2.1996 / 12:50:11 / cg" |
1 | 2463 |
! ! |
2464 |
||
2465 |
!Class methodsFor:'fileOut'! |
|
2466 |
||
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2467 |
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2468 |
"append an expression on aStream, which defines myself." |
238 | 2469 |
|
2245 | 2470 |
|s owner ns nsName fullName superName cls topOwner| |
1 | 2471 |
|
1741 | 2472 |
owner := self owningClass. |
2038
7c0943b1ab81
care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents:
2036
diff
changeset
|
2473 |
|
1932 | 2474 |
owner isNil ifTrue:[ |
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2475 |
ns := self nameSpace. |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2476 |
] ifFalse:[ |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2477 |
ns := self topOwningClass nameSpace |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2478 |
]. |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2479 |
fullName := FileOutNameSpaceQuerySignal raise == true. |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2480 |
|
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2481 |
((owner isNil and:[fullName not]) |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2482 |
or:[owner notNil and:[forceNameSpace and:[fullName not]]]) ifTrue:[ |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2483 |
(ns notNil and:[ns ~~ Smalltalk]) ifTrue:[ |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2484 |
nsName := ns name. |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2485 |
(nsName includes:$:) ifTrue:[ |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2486 |
nsName := '''' , nsName , '''' |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2487 |
]. |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2488 |
aStream nextPutLine:'"{ NameSpace: ' , nsName , ' }"'; cr. |
1930
6a8b95d5f108
fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents:
1928
diff
changeset
|
2489 |
] |
6a8b95d5f108
fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents:
1928
diff
changeset
|
2490 |
]. |
1741 | 2491 |
|
68 | 2492 |
"take care of nil-superclass" |
1 | 2493 |
superclass isNil ifTrue:[ |
1707 | 2494 |
s := 'nil' |
1 | 2495 |
] ifFalse:[ |
2038
7c0943b1ab81
care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents:
2036
diff
changeset
|
2496 |
fullName ifTrue:[ |
7c0943b1ab81
care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents:
2036
diff
changeset
|
2497 |
s := superclass name |
1930
6a8b95d5f108
fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents:
1928
diff
changeset
|
2498 |
] ifFalse:[ |
2038
7c0943b1ab81
care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents:
2036
diff
changeset
|
2499 |
(ns == superclass nameSpace |
7c0943b1ab81
care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents:
2036
diff
changeset
|
2500 |
and:[superclass owningClass isNil]) ifTrue:[ |
7c0943b1ab81
care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents:
2036
diff
changeset
|
2501 |
s := superclass nameWithoutPrefix |
7c0943b1ab81
care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents:
2036
diff
changeset
|
2502 |
] ifFalse:[ |
2232
1d184023197f
care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
2503 |
"/ a very special (rare) situation: |
1d184023197f
care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
2504 |
"/ my superclass resides in another nameSpace, |
1d184023197f
care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
2505 |
"/ but there is something else named like this |
1d184023197f
care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
2506 |
"/ to be found in my nameSpace (or a private class) |
1d184023197f
care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
2507 |
|
1d184023197f
care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
2508 |
superName := superclass nameWithoutNameSpacePrefix asSymbol. |
1d184023197f
care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
2509 |
cls := self privateClassesAt:superName. |
1d184023197f
care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
2510 |
cls isNil ifTrue:[ |
2245 | 2511 |
(topOwner := self topOwningClass) isNil ifTrue:[ |
2356 | 2512 |
ns := self nameSpace. |
2513 |
ns notNil ifTrue:[ |
|
2514 |
cls := ns privateClassesAt:superName |
|
2515 |
] ifFalse:[ |
|
2516 |
"/ self error:'unexpected nil namespace' |
|
2517 |
] |
|
2245 | 2518 |
] ifFalse:[ |
2519 |
cls := topOwner nameSpace at:superName. |
|
2520 |
] |
|
2232
1d184023197f
care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
2521 |
]. |
1d184023197f
care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
2522 |
(cls notNil and:[cls ~~ superclass]) ifTrue:[ |
1d184023197f
care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
2523 |
s := superclass nameSpace name , '::' , superName |
1d184023197f
care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
2524 |
] ifFalse:[ |
1d184023197f
care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
2525 |
s := superName |
1d184023197f
care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
2526 |
] |
2038
7c0943b1ab81
care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents:
2036
diff
changeset
|
2527 |
] |
1930
6a8b95d5f108
fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents:
1928
diff
changeset
|
2528 |
] |
1 | 2529 |
]. |
293 | 2530 |
|
1707 | 2531 |
aStream nextPutAll:s. |
2532 |
aStream space. |
|
2533 |
self basicFileOutInstvarTypeKeywordOn:aStream. |
|
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2534 |
|
2038
7c0943b1ab81
care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents:
2036
diff
changeset
|
2535 |
fullName ifTrue:[ |
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2536 |
owner isNil ifTrue:[ |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2537 |
aStream nextPutAll:'#'''; nextPutAll:(self name); nextPutAll:''''. |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2538 |
] ifFalse:[ |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2539 |
aStream nextPut:$#; nextPutAll:(self nameWithoutPrefix). |
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2540 |
] |
1741 | 2541 |
] ifFalse:[ |
1756 | 2542 |
aStream nextPut:$#; nextPutAll:(self nameWithoutPrefix). |
1741 | 2543 |
]. |
1 | 2544 |
|
345 | 2545 |
aStream crtab. |
738 | 2546 |
aStream nextPutAll:'instanceVariableNames:'''. |
1 | 2547 |
self printInstVarNamesOn:aStream indent:16. |
2548 |
aStream nextPutAll:''''. |
|
2549 |
||
345 | 2550 |
aStream crtab. |
738 | 2551 |
aStream nextPutAll:'classVariableNames:'''. |
1 | 2552 |
self printClassVarNamesOn:aStream indent:16. |
2553 |
aStream nextPutAll:''''. |
|
2554 |
||
345 | 2555 |
aStream crtab. |
738 | 2556 |
aStream nextPutAll:'poolDictionaries:'''''. |
1 | 2557 |
|
345 | 2558 |
aStream crtab. |
1741 | 2559 |
owner isNil ifTrue:[ |
1735 | 2560 |
"/ a public class |
2561 |
aStream nextPutAll:'category:'. |
|
2562 |
category isNil ifTrue:[ |
|
2563 |
s := '''''' |
|
2564 |
] ifFalse:[ |
|
2565 |
s := category asString storeString |
|
2566 |
]. |
|
2567 |
aStream nextPutAll:s. |
|
1 | 2568 |
] ifFalse:[ |
1735 | 2569 |
"/ a private class |
2570 |
aStream nextPutAll:'privateIn:'. |
|
2049
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
2571 |
fullName ifTrue:[ |
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
2572 |
aStream nextPutAll:owner name. |
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
2573 |
] ifFalse:[ |
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
2574 |
aStream nextPutAll:owner nameWithoutNameSpacePrefix. |
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
2575 |
] |
1 | 2576 |
]. |
2577 |
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
|
2578 |
|
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2579 |
"Created: 4.1.1997 / 20:38:16 / cg" |
2232
1d184023197f
care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
2580 |
"Modified: 23.1.1997 / 02:06:18 / cg" |
1707 | 2581 |
! |
2582 |
||
2583 |
basicFileOutInstvarTypeKeywordOn:aStream |
|
2584 |
"a helper for fileOutDefinition" |
|
2585 |
||
2586 |
|isVar s| |
|
2587 |
||
2588 |
superclass isNil ifTrue:[ |
|
2589 |
isVar := self isVariable |
|
2590 |
] ifFalse:[ |
|
2591 |
"I cant remember what this is for ?" |
|
2592 |
isVar := (self isVariable and:[superclass isVariable not]) |
|
2593 |
]. |
|
2594 |
||
2595 |
isVar ifTrue:[ |
|
2596 |
self isBytes ifTrue:[ |
|
2597 |
s := 'variableByteSubclass:' |
|
2598 |
] ifFalse:[ |
|
2599 |
self isWords ifTrue:[ |
|
2600 |
s := 'variableWordSubclass:' |
|
2601 |
] ifFalse:[ |
|
2602 |
self isLongs ifTrue:[ |
|
2603 |
s := 'variableLongSubclass:' |
|
2604 |
] ifFalse:[ |
|
2605 |
self isFloats ifTrue:[ |
|
2606 |
s := 'variableFloatSubclass:' |
|
2607 |
] ifFalse:[ |
|
2608 |
self isDoubles ifTrue:[ |
|
2609 |
s := 'variableDoubleSubclass:' |
|
2610 |
] ifFalse:[ |
|
2611 |
self isSignedWords ifTrue:[ |
|
2612 |
s := 'variableSignedWordSubclass:' |
|
2613 |
] ifFalse:[ |
|
2614 |
self isSignedLongs ifTrue:[ |
|
2615 |
s := 'variableSignedLongSubclass:' |
|
2616 |
] ifFalse:[ |
|
2617 |
s := 'variableSubclass:' |
|
2618 |
] |
|
2619 |
] |
|
2620 |
] |
|
2621 |
] |
|
2622 |
] |
|
2623 |
] |
|
2624 |
] |
|
2625 |
] ifFalse:[ |
|
2626 |
s := 'subclass:' |
|
2627 |
]. |
|
2628 |
aStream nextPutAll:s. |
|
2629 |
||
2630 |
"Created: 11.10.1996 / 18:57:29 / cg" |
|
1 | 2631 |
! |
2632 |
||
880 | 2633 |
binaryFileOut |
2068
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2634 |
"create a file 'class.cls' (in the current projects fileOut-directory), |
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2635 |
consisting of all methods in myself in a portable binary format. |
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2636 |
The methods source is saved by reference |
894
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2637 |
to the classes sourceFile if there is any. |
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2638 |
That sourcefile needs to be present after reload in order to be |
895 | 2639 |
browsable." |
894
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2640 |
|
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2641 |
self binaryFileOutWithSourceMode:#reference |
2068
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2642 |
|
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2643 |
"Modified: 5.1.1997 / 15:40:05 / cg" |
894
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2644 |
! |
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2645 |
|
880 | 2646 |
binaryFileOutOn:aStream |
894
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2647 |
"append a binary representation of myself to aStream" |
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2648 |
|
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2649 |
self binaryFileOutOn:aStream sourceMode:#reference |
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2650 |
! |
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2651 |
|
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2652 |
binaryFileOutOn:aStream sourceMode:sourceMode |
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2653 |
"append a binary representation of myself to aStream in |
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2654 |
a portable binary format. |
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2655 |
The argument controls how sources are to be saved: |
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2656 |
#keep - include the source |
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2657 |
#reference - include a reference to the sourceFile |
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2658 |
#discard - dont save sources. |
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2659 |
|
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2660 |
With #reference, the sourceFile needs to be present after reload |
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2661 |
in order to be browsable." |
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2662 |
|
880 | 2663 |
|bos| |
2664 |
||
2665 |
bos := BinaryObjectStorage onNew:aStream. |
|
894
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2666 |
bos sourceMode:sourceMode. |
880 | 2667 |
bos nextPutClasses:(Array with:self). |
2668 |
bos close. |
|
2669 |
! |
|
2670 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2671 |
binaryFileOutWithSourceMode:sourceMode |
2068
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2672 |
"create a file 'class.cls' (in the current projects fileOut-directory), |
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2673 |
consisting of all methods in myself in a portable binary format. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2674 |
The argument controls how sources are to be saved: |
2068
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2675 |
#keep - include the source |
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2676 |
#reference - include a reference to the sourceFile |
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2677 |
#discard - dont save sources. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2678 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2679 |
With #reference, the sourceFile needs to be present after reload |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2680 |
in order to be browsable." |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2681 |
|
2068
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2682 |
|baseName fileName aStream dirName| |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2683 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2684 |
baseName := (Smalltalk fileNameForClass:self name). |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2685 |
fileName := baseName , '.cls'. |
2068
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2686 |
|
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2687 |
Project notNil ifTrue:[ |
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2688 |
dirName := Project currentProjectDirectory |
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2689 |
] ifFalse:[ |
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2690 |
dirName := '' |
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2691 |
]. |
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2692 |
fileName := dirName , fileName. |
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2693 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2694 |
aStream := FileStream newFileNamed:fileName. |
2068
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2695 |
aStream isNil ifTrue:[ |
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2696 |
^ FileOutErrorSignal |
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2697 |
raiseRequestWith:fileName |
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2698 |
errorString:('cannot create file:', fileName) |
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2699 |
]. |
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2700 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2701 |
aStream binary. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2702 |
self binaryFileOutOn:aStream sourceMode:sourceMode. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2703 |
aStream close. |
2068
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2704 |
|
6d5711ab4a44
care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents:
2059
diff
changeset
|
2705 |
"Modified: 5.1.1997 / 15:39:30 / cg" |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2706 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2707 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2708 |
fileOut |
894
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2709 |
"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
|
2710 |
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
|
2711 |
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
|
2712 |
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
|
2713 |
case of errors (for example: disk full). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2714 |
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
|
2715 |
sourceFile may not be rewritten." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2716 |
|
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2717 |
|aStream baseName dirName fileNameString fileName newFileName needRename |
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
|
2718 |
mySourceFileName sameFile s mySourceFileID anySourceRef| |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2719 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2720 |
baseName := (Smalltalk fileNameForClass:self name). |
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2721 |
fileNameString := baseName , '.st'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2722 |
|
139 | 2723 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2724 |
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
|
2725 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2726 |
Project notNil ifTrue:[ |
967 | 2727 |
dirName := Project currentProjectDirectory |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2728 |
] ifFalse:[ |
967 | 2729 |
dirName := '' |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2730 |
]. |
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2731 |
fileNameString := dirName , fileNameString. |
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2732 |
fileName := fileNameString asFilename. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2733 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2734 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2735 |
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
|
2736 |
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
|
2737 |
and, if that worked rename afterwards ... |
153 | 2738 |
" |
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2739 |
(fileName exists) ifTrue:[ |
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
|
2740 |
sameFile := false. |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2741 |
|
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2742 |
"/ check carefully - maybe, my source does not really come from that |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2743 |
"/ file (i.e. all of my methods have their source as string) |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2744 |
|
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2745 |
anySourceRef := false. |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2746 |
self methodDictionary do:[:m| |
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
|
2747 |
m sourcePosition notNil ifTrue:[ |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2748 |
anySourceRef := true |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2749 |
] |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2750 |
]. |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2751 |
self class methodDictionary do:[:m| |
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
|
2752 |
m sourcePosition notNil ifTrue:[ |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2753 |
anySourceRef := true |
967 | 2754 |
] |
2755 |
]. |
|
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
|
2756 |
|
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2757 |
anySourceRef ifTrue:[ |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2758 |
s := self sourceStream. |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2759 |
s notNil ifTrue:[ |
1860
e65f13417bfc
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
1846
diff
changeset
|
2760 |
mySourceFileID := s pathName asFilename info id. |
e65f13417bfc
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
1846
diff
changeset
|
2761 |
sameFile := (fileName info id) == mySourceFileID. |
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
|
2762 |
s close. |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2763 |
] ifFalse:[ |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2764 |
classFilename notNil ifTrue:[ |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2765 |
" |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2766 |
check for overwriting my current source file |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2767 |
this is not allowed, since it would clobber my methods source |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2768 |
file ... you have to save it to some other place. |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2769 |
This happens if you ask for a fileOut into the source-directory |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2770 |
(from which my methods get their source) |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2771 |
" |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2772 |
mySourceFileName := Smalltalk getSourceFileName:classFilename. |
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2773 |
sameFile := (fileNameString = mySourceFileName). |
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
|
2774 |
sameFile ifFalse:[ |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2775 |
mySourceFileName notNil ifTrue:[ |
1860
e65f13417bfc
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
1846
diff
changeset
|
2776 |
sameFile := (fileName info id) == (mySourceFileName asFilename info id) |
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
|
2777 |
] |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2778 |
]. |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2779 |
] |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2780 |
]. |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2781 |
]. |
e0411b74b808
allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents:
1102
diff
changeset
|
2782 |
|
967 | 2783 |
sameFile ifTrue:[ |
2784 |
^ FileOutErrorSignal |
|
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2785 |
raiseRequestWith:fileNameString |
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2786 |
errorString:('may not overwrite sourcefile:', fileNameString) |
967 | 2787 |
]. |
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
|
2788 |
|
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2789 |
fileName copyTo:('/tmp/' , baseName , '.sav'). |
967 | 2790 |
newFileName := dirName , baseName , '.new'. |
2791 |
needRename := true |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2792 |
] ifFalse:[ |
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2793 |
newFileName := fileNameString. |
967 | 2794 |
needRename := false |
1 | 2795 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2796 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2797 |
aStream := FileStream newFileNamed:newFileName. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2798 |
aStream isNil ifTrue:[ |
967 | 2799 |
^ FileOutErrorSignal |
2800 |
raiseRequestWith:newFileName |
|
2801 |
errorString:('cannot create file:', newFileName) |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2802 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2803 |
self fileOutOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2804 |
aStream close. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2805 |
|
199 | 2806 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2807 |
finally, replace the old-file |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2808 |
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
|
2809 |
we have to do a copy ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2810 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2811 |
needRename ifTrue:[ |
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2812 |
newFileName asFilename copyTo:fileNameString. |
967 | 2813 |
newFileName asFilename delete |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2814 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2815 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2816 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2817 |
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
|
2818 |
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
|
2819 |
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
|
2820 |
applied again |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2821 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2822 |
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
|
2823 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2824 |
"Modified: 7.6.1996 / 09:14:43 / stefan" |
1860
e65f13417bfc
changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents:
1846
diff
changeset
|
2825 |
"Modified: 1.11.1996 / 20:23:57 / cg" |
1 | 2826 |
! |
2827 |
||
1753
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2828 |
fileOutAllDefinitionsOn:aStream |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2829 |
"append expressions on aStream, which defines myself and all of my private classes." |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2830 |
|
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2831 |
|privateClasses| |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2832 |
|
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2833 |
self fileOutDefinitionOn:aStream. |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2834 |
aStream nextPutChunkSeparator. |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2835 |
aStream cr; cr. |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2836 |
|
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2837 |
"/ |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2838 |
"/ optional classInstanceVariables |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2839 |
"/ |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2840 |
self class instanceVariableString isBlank ifFalse:[ |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2841 |
self fileOutClassInstVarDefinitionOn:aStream. |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2842 |
aStream nextPutChunkSeparator. |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2843 |
aStream cr; cr |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2844 |
]. |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2845 |
|
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2846 |
(privateClasses := self privateClasses) notNil ifTrue:[ |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2847 |
privateClasses do:[:aClass | |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2848 |
aClass fileOutAllDefinitionsOn:aStream |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2849 |
] |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2850 |
] |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2851 |
|
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2852 |
"Created: 15.10.1996 / 11:15:19 / cg" |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2853 |
"Modified: 15.10.1996 / 11:26:30 / cg" |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2854 |
! |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2855 |
|
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2856 |
fileOutAllMethodsOn:aStream |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2857 |
|collectionOfCategories privateClasses| |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2858 |
|
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2859 |
collectionOfCategories := self class categories asSortedCollection. |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2860 |
collectionOfCategories notNil ifTrue:[ |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2861 |
collectionOfCategories do:[:aCategory | |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2862 |
self class fileOutCategory:aCategory on:aStream. |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2863 |
aStream cr |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2864 |
] |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2865 |
]. |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2866 |
collectionOfCategories := self categories asSortedCollection. |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2867 |
collectionOfCategories notNil ifTrue:[ |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2868 |
collectionOfCategories do:[:aCategory | |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2869 |
self fileOutCategory:aCategory on:aStream. |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2870 |
aStream cr |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2871 |
] |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2872 |
]. |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2873 |
|
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2874 |
(privateClasses := self privateClasses) notNil ifTrue:[ |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2875 |
privateClasses do:[:aClass | |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2876 |
aClass fileOutAllMethodsOn:aStream |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2877 |
] |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2878 |
]. |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2879 |
|
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2880 |
"Created: 15.10.1996 / 11:13:00 / cg" |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2881 |
! |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2882 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2883 |
fileOutCategory:aCategory |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2884 |
"create a file 'class-category.st' consisting of all methods in aCategory. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2885 |
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
|
2886 |
directory." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2887 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2888 |
|aStream fileName| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2889 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2890 |
fileName := name , '-' , aCategory , '.st'. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2891 |
fileName replaceAll:(Character space) by:$_. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2892 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2893 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2894 |
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
|
2895 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2896 |
Project notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2897 |
fileName := Project currentProjectDirectory , fileName. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2898 |
]. |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
2899 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
2900 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2901 |
if file exists, save original in a .sav file |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
2902 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2903 |
fileName asFilename exists ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2904 |
fileName asFilename copyTo:(fileName , '.sav') |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2905 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2906 |
aStream := FileStream newFileNamed:fileName. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2907 |
aStream isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2908 |
^ FileOutErrorSignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2909 |
raiseRequestWith:fileName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2910 |
errorString:('cannot create file:', fileName) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2911 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2912 |
self fileOutCategory:aCategory on:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2913 |
aStream close |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2914 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2915 |
|
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2916 |
fileOutCategory:aCategory except:skippedMethods only:savedMethods on:aStream |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2917 |
"file out all methods belonging to aCategory, aString onto aStream. |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2918 |
If skippedMethods is nonNil, those are not saved. |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2919 |
If savedMethods is nonNil, only those are saved. |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2920 |
If both are nil, all are saved. See version-method handling in |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2921 |
fileOut for what this is needed." |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
2922 |
|
1977
6d288d63c918
oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents:
1951
diff
changeset
|
2923 |
|dict source sortedSelectors first privacy interestingMethods cat| |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2924 |
|
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2925 |
dict := self methodDictionary. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2926 |
dict notNil ifTrue:[ |
956 | 2927 |
interestingMethods := OrderedCollection new. |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2928 |
dict do:[:aMethod | |
956 | 2929 |
|wanted| |
2930 |
||
2931 |
(aCategory = aMethod category) ifTrue:[ |
|
2932 |
skippedMethods notNil ifTrue:[ |
|
2933 |
wanted := (skippedMethods includesIdentical:aMethod) not |
|
2934 |
] ifFalse:[ |
|
2935 |
savedMethods notNil ifTrue:[ |
|
2936 |
wanted := (savedMethods includesIdentical:aMethod). |
|
2937 |
] ifFalse:[ |
|
2938 |
wanted := true |
|
2939 |
] |
|
2940 |
]. |
|
2941 |
wanted ifTrue:[interestingMethods add:aMethod]. |
|
2942 |
] |
|
2943 |
]. |
|
2944 |
interestingMethods notEmpty ifTrue:[ |
|
2945 |
first := true. |
|
2946 |
privacy := nil. |
|
2947 |
||
2948 |
"/ |
|
2949 |
"/ sort by selector |
|
2950 |
"/ |
|
2951 |
sortedSelectors := interestingMethods collect:[:m | self selectorAtMethod:m]. |
|
2952 |
sortedSelectors sortWith:interestingMethods. |
|
2953 |
||
2954 |
interestingMethods do:[:aMethod | |
|
2955 |
first ifFalse:[ |
|
2956 |
privacy ~~ aMethod privacy ifTrue:[ |
|
2957 |
first := true. |
|
2958 |
aStream space. |
|
2959 |
aStream nextPutChunkSeparator. |
|
2960 |
]. |
|
2961 |
aStream cr; cr |
|
2962 |
]. |
|
2963 |
||
2964 |
privacy := aMethod privacy. |
|
2965 |
||
2966 |
first ifTrue:[ |
|
2967 |
aStream nextPutChunkSeparator. |
|
2968 |
self printClassNameOn:aStream. |
|
2969 |
privacy ~~ #public ifTrue:[ |
|
1977
6d288d63c918
oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents:
1951
diff
changeset
|
2970 |
aStream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'. |
956 | 2971 |
] ifFalse:[ |
1977
6d288d63c918
oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents:
1951
diff
changeset
|
2972 |
aStream nextPutAll:' methodsFor:'. |
956 | 2973 |
]. |
1977
6d288d63c918
oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents:
1951
diff
changeset
|
2974 |
cat := aCategory. |
6d288d63c918
oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents:
1951
diff
changeset
|
2975 |
cat isNil ifTrue:[ cat := '' ]. |
6d288d63c918
oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents:
1951
diff
changeset
|
2976 |
aStream nextPutAll:aCategory asString storeString. |
6d288d63c918
oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents:
1951
diff
changeset
|
2977 |
aStream nextPutChunkSeparator; cr; cr. |
956 | 2978 |
first := false. |
2979 |
]. |
|
2980 |
source := aMethod source. |
|
2981 |
source isNil ifTrue:[ |
|
2982 |
FileOutErrorSignal |
|
2983 |
raiseRequestWith:self |
|
1546
0e91715409d0
pass name of method to exception, if fileOut fails due to
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
2984 |
errorString:'no source for method: ', (aMethod displayString) |
956 | 2985 |
] ifFalse:[ |
2986 |
aStream nextChunkPut:source. |
|
2987 |
]. |
|
2988 |
]. |
|
2989 |
aStream space. |
|
2990 |
aStream nextPutChunkSeparator. |
|
2991 |
aStream cr |
|
2992 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2993 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2994 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2995 |
"Modified: 28.8.1995 / 14:30:41 / claus" |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
2996 |
"Modified: 12.6.1996 / 11:37:33 / stefan" |
1977
6d288d63c918
oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents:
1951
diff
changeset
|
2997 |
"Modified: 15.11.1996 / 11:32:21 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2998 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2999 |
|
662 | 3000 |
fileOutCategory:aCategory on:aStream |
3001 |
"file out all methods belonging to aCategory, aString onto aStream" |
|
3002 |
||
3003 |
self fileOutCategory:aCategory except:nil only:nil on:aStream |
|
3004 |
! |
|
3005 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3006 |
fileOutClassInstVarDefinitionOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3007 |
"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
|
3008 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3009 |
aStream nextPutAll:(name , ' class instanceVariableNames:'''). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3010 |
self class printInstVarNamesOn:aStream indent:8. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3011 |
aStream nextPutAll:''''. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3012 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3013 |
"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
|
3014 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3015 |
aStream cr; cr; nextPut:(Character doubleQuote); cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3016 |
aStream space; |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3017 |
nextPutLine:'The following class instance variables are inherited by this class:'; |
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3018 |
cr. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3019 |
self allSuperclassesDo:[:aSuperClass | |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3020 |
aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '. |
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3021 |
aStream nextPutLine:(aSuperClass class instanceVariableString). |
556 | 3022 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3023 |
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
|
3024 |
|
983d045c17f5
make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
3025 |
"Created: 10.12.1995 / 16:31:25 / cg" |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3026 |
"Modified: 9.11.1996 / 00:11:07 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3027 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3028 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3029 |
fileOutCommentOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3030 |
"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
|
3031 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3032 |
|comment s| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3033 |
|
2011
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
3034 |
self printClassNameOn:aStream. |
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
3035 |
aStream nextPutAll:' comment:'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3036 |
(comment := self comment) isNil ifTrue:[ |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3037 |
s := '''''' |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3038 |
] ifFalse:[ |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3039 |
s := comment storeString |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3040 |
]. |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3041 |
aStream nextPutAllAsChunk:s. |
1063
b45a722a10c3
oops - forgot excla after comment-chunk
Claus Gittinger <cg@exept.de>
parents:
989
diff
changeset
|
3042 |
aStream nextPutChunkSeparator. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3043 |
aStream cr |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3044 |
|
2011
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
3045 |
"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
|
3046 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3047 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3048 |
fileOutDefinitionOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3049 |
"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
|
3050 |
|
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
3051 |
^ 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
|
3052 |
|
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
3053 |
"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
|
3054 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3055 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3056 |
fileOutIn:aFileDirectory |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3057 |
"create a file 'class.st' consisting of all methods in self in |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3058 |
directory aFileDirectory (ignoring any directory setting in |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3059 |
the current porject). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3060 |
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
|
3061 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3062 |
|aStream fileName| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3063 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3064 |
fileName := (Smalltalk fileNameForClass:self name) , '.st'. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3065 |
aStream := FileStream newFileNamed:fileName in:aFileDirectory. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3066 |
aStream isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3067 |
^ FileOutErrorSignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3068 |
raiseRequestWith:fileName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3069 |
errorString:('cannot create file:', fileName) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3070 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3071 |
self fileOutOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3072 |
aStream close |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3073 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3074 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3075 |
fileOutMethod:aMethod |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3076 |
"create a file 'class-method.st' consisting of the method, aMethod. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3077 |
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
|
3078 |
directory." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3079 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3080 |
|aStream fileName selector| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3081 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3082 |
selector := self selectorAtMethod:aMethod. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3083 |
selector notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3084 |
fileName := name , '-' , selector, '.st'. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3085 |
fileName replaceAll:$: by:$_. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3086 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3087 |
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
|
3088 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3089 |
Project notNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3090 |
fileName := Project currentProjectDirectory , fileName. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3091 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3092 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3093 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3094 |
if file exists, save original in a .sav file |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3095 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3096 |
fileName asFilename exists ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3097 |
fileName asFilename copyTo:(fileName , '.sav') |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3098 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3099 |
aStream := FileStream newFileNamed:fileName. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3100 |
aStream isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3101 |
^ FileOutErrorSignal |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3102 |
raiseRequestWith:fileName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3103 |
errorString:('cannot create file:', fileName) |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3104 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3105 |
self fileOutMethod:aMethod on:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3106 |
aStream close |
555 | 3107 |
] |
3108 |
! |
|
3109 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3110 |
fileOutMethod:aMethod on:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3111 |
"file out the method, aMethod onto aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3112 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3113 |
|dict cat source privacy| |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3114 |
|
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3115 |
dict := self methodDictionary. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3116 |
dict notNil ifTrue:[ |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3117 |
aStream nextPutChunkSeparator. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3118 |
self printClassNameOn:aStream. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3119 |
|
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3120 |
(privacy := aMethod privacy) ~~ #public ifTrue:[ |
1977
6d288d63c918
oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents:
1951
diff
changeset
|
3121 |
aStream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'. |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3122 |
] ifFalse:[ |
1977
6d288d63c918
oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents:
1951
diff
changeset
|
3123 |
aStream nextPutAll:' methodsFor:'. |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3124 |
]. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3125 |
cat := aMethod category. |
1977
6d288d63c918
oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents:
1951
diff
changeset
|
3126 |
cat isNil ifTrue:[ |
6d288d63c918
oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents:
1951
diff
changeset
|
3127 |
cat := '' |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3128 |
]. |
1977
6d288d63c918
oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents:
1951
diff
changeset
|
3129 |
aStream nextPutAll:cat asString storeString. |
6d288d63c918
oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents:
1951
diff
changeset
|
3130 |
aStream nextPutChunkSeparator; cr; cr. |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3131 |
source := aMethod source. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3132 |
source isNil ifTrue:[ |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3133 |
FileOutErrorSignal |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3134 |
raiseRequestWith:self |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3135 |
errorString:('no source for method: ' , |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3136 |
self name , '>>' , |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3137 |
(self selectorAtMethod:aMethod)) |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3138 |
] ifFalse:[ |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3139 |
aStream nextChunkPut:source. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3140 |
]. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3141 |
aStream space. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3142 |
aStream nextPutChunkSeparator. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3143 |
aStream cr |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3144 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3145 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3146 |
"Modified: 27.8.1995 / 01:23:19 / claus" |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3147 |
"Modified: 12.6.1996 / 11:44:41 / stefan" |
1977
6d288d63c918
oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents:
1951
diff
changeset
|
3148 |
"Modified: 15.11.1996 / 11:32:43 / cg" |
555 | 3149 |
! |
3150 |
||
3151 |
fileOutOn:aStream |
|
3152 |
"file out my definition and all methods onto aStream" |
|
3153 |
||
3154 |
^ self fileOutOn:aStream withTimeStamp:true |
|
3155 |
||
3156 |
"Created: 15.11.1995 / 12:53:32 / cg" |
|
2046 | 3157 |
"Modified: 3.1.1997 / 17:50:28 / cg" |
555 | 3158 |
! |
3159 |
||
3160 |
fileOutOn:aStream withTimeStamp:stampIt |
|
3161 |
"file out my definition and all methods onto aStream" |
|
3162 |
||
989 | 3163 |
|collectionOfCategories copyrightMethod copyrightText comment versionMethod skippedMethods |
1743
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
3164 |
meta privateClasses| |
555 | 3165 |
|
3166 |
self isLoaded ifFalse:[ |
|
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3167 |
^ FileOutErrorSignal |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3168 |
raiseRequestWith:self |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3169 |
errorString:'will not fileOut unloaded classes' |
555 | 3170 |
]. |
3171 |
||
1753
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
3172 |
privateClasses := self privateClasses. |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
3173 |
|
989 | 3174 |
meta := self class. |
3175 |
||
555 | 3176 |
" |
3177 |
if there is a copyright method, add a copyright comment |
|
3178 |
at the beginning, taking the string from the copyright method. |
|
3179 |
We cannot do this unconditionally - that would lead to my copyrights |
|
3180 |
being put on your code ;-). |
|
3181 |
On the other hand: I want every file created by myself to have the |
|
3182 |
copyright string at the beginning be preserved .... even if the |
|
3183 |
code was edited in the browser and filedOut. |
|
3184 |
" |
|
989 | 3185 |
(copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[ |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3186 |
" |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3187 |
get the copyright methods source, |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3188 |
and insert at beginning. |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3189 |
" |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3190 |
copyrightText := copyrightMethod source. |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3191 |
copyrightText isNil ifTrue:[ |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3192 |
" |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3193 |
no source available - trigger an error |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3194 |
" |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3195 |
FileOutErrorSignal |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3196 |
raiseRequestWith:'no source for class ' , name , ' available. Cannot fileOut'. |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3197 |
^ self |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3198 |
]. |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3199 |
" |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3200 |
strip off the selector-line |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3201 |
" |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3202 |
copyrightText := copyrightText asCollectionOfLines asStringCollection. |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3203 |
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
|
3204 |
"/ copyrightText do:[:line | aStream nextPutAll:line. aStream cr.]. |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3205 |
copyrightText := copyrightText asString. |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3206 |
aStream nextPutAllAsChunk:copyrightText. |
555 | 3207 |
]. |
3208 |
||
3209 |
stampIt ifTrue:[ |
|
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3210 |
"/ |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3211 |
"/ first, a timestamp |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3212 |
"/ |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3213 |
aStream nextPutAll:(Smalltalk timeStamp). |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3214 |
aStream nextPutChunkSeparator. |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3215 |
aStream cr; cr. |
555 | 3216 |
]. |
3217 |
||
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3218 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3219 |
"/ then the definition |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3220 |
"/ |
1753
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
3221 |
self fileOutAllDefinitionsOn:aStream. |
1743
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
3222 |
|
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
3223 |
"/ |
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3224 |
"/ a comment - if any |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3225 |
"/ |
555 | 3226 |
(comment := self comment) notNil ifTrue:[ |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3227 |
self fileOutCommentOn:aStream. |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3228 |
aStream cr. |
555 | 3229 |
]. |
3230 |
||
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3231 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3232 |
"/ primitive definitions - if any |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3233 |
"/ |
555 | 3234 |
self fileOutPrimitiveSpecsOn:aStream. |
3235 |
||
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3236 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3237 |
"/ 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
|
3238 |
"/ 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
|
3239 |
"/ avoid sourcePosition-shifts when checked out later. |
1930
6a8b95d5f108
fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents:
1928
diff
changeset
|
3240 |
"/ (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
|
3241 |
"/ |
989 | 3242 |
collectionOfCategories := meta categories asSortedCollection. |
555 | 3243 |
collectionOfCategories notNil ifTrue:[ |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3244 |
"/ |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3245 |
"/ documentation first (if any), but not the version method |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3246 |
"/ |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3247 |
(collectionOfCategories includes:'documentation') ifTrue:[ |
989 | 3248 |
versionMethod := meta compiledMethodAt:#version. |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3249 |
versionMethod notNil ifTrue:[ |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3250 |
skippedMethods := Array with:versionMethod |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3251 |
]. |
989 | 3252 |
meta fileOutCategory:'documentation' except:skippedMethods only:nil on:aStream. |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3253 |
aStream cr. |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3254 |
]. |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3255 |
|
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3256 |
"/ |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3257 |
"/ initialization next (if any) |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3258 |
"/ |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3259 |
(collectionOfCategories includes:'initialization') ifTrue:[ |
989 | 3260 |
meta fileOutCategory:'initialization' on:aStream. |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3261 |
aStream cr. |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3262 |
]. |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3263 |
|
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3264 |
"/ |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3265 |
"/ instance creation next (if any) |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3266 |
"/ |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3267 |
(collectionOfCategories includes:'instance creation') ifTrue:[ |
989 | 3268 |
meta fileOutCategory:'instance creation' on:aStream. |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3269 |
aStream cr. |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3270 |
]. |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3271 |
collectionOfCategories do:[:aCategory | |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3272 |
((aCategory ~= 'documentation') |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3273 |
and:[(aCategory ~= 'initialization') |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3274 |
and:[aCategory ~= 'instance creation']]) ifTrue:[ |
989 | 3275 |
meta fileOutCategory:aCategory on:aStream. |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3276 |
aStream cr |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3277 |
] |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3278 |
] |
555 | 3279 |
]. |
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3280 |
|
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3281 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3282 |
"/ methods from all categories in myself |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3283 |
"/ |
555 | 3284 |
collectionOfCategories := self categories asSortedCollection. |
3285 |
collectionOfCategories notNil ifTrue:[ |
|
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3286 |
collectionOfCategories do:[:aCategory | |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3287 |
self fileOutCategory:aCategory on:aStream. |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3288 |
aStream cr |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3289 |
] |
555 | 3290 |
]. |
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3291 |
|
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3292 |
"/ |
1743
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
3293 |
"/ any private classes' methods |
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
3294 |
"/ |
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
3295 |
privateClasses notNil ifTrue:[ |
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
3296 |
privateClasses do:[:aClass | |
1753
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
3297 |
aClass fileOutAllMethodsOn:aStream |
1743
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
3298 |
]. |
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
3299 |
]. |
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
3300 |
|
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
3301 |
|
18eed89fe918
fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
3302 |
"/ |
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3303 |
"/ finally, the previously skipped version method |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3304 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3305 |
versionMethod notNil ifTrue:[ |
989 | 3306 |
meta fileOutCategory:'documentation' except:nil only:skippedMethods on:aStream. |
638
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3307 |
]. |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3308 |
|
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3309 |
"/ |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3310 |
"/ optionally an initialize message |
70584e2d2f38
place version method at the end
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
3311 |
"/ |
989 | 3312 |
(meta implements:#initialize) ifTrue:[ |
2011
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
3313 |
self printClassNameOn:aStream. aStream nextPutAll:' initialize'. |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3314 |
aStream nextPutChunkSeparator. |
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
3315 |
aStream cr |
555 | 3316 |
] |
3317 |
||
3318 |
"Created: 15.11.1995 / 12:53:06 / cg" |
|
2011
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
3319 |
"Modified: 21.12.1996 / 13:54:01 / cg" |
555 | 3320 |
! |
3321 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3322 |
fileOutPrimitiveDefinitionsOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3323 |
"append primitive defs (if any) to aStream." |
555 | 3324 |
|
3325 |
|s| |
|
3326 |
||
3327 |
" |
|
3328 |
primitive definitions - if any |
|
3329 |
" |
|
3330 |
(s := self primitiveDefinitionsString) notNil ifTrue:[ |
|
2088
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3331 |
aStream nextPutChunkSeparator. |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3332 |
self printClassNameOn:aStream. |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3333 |
aStream nextPutAll:' primitiveDefinitions'; |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3334 |
nextPutChunkSeparator; |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3335 |
cr. |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3336 |
aStream nextPutAll:s. |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3337 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
555 | 3338 |
]. |
3339 |
(s := self primitiveVariablesString) notNil ifTrue:[ |
|
2088
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3340 |
aStream nextPutChunkSeparator. |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3341 |
self printClassNameOn:aStream. |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3342 |
aStream nextPutAll:' primitiveVariables'; |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3343 |
nextPutChunkSeparator; |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3344 |
cr. |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3345 |
aStream nextPutAll:s. |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3346 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
555 | 3347 |
]. |
2088
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3348 |
|
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3349 |
"Modified: 8.1.1997 / 17:45:40 / cg" |
555 | 3350 |
! |
3351 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3352 |
fileOutPrimitiveSpecsOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3353 |
"append primitive defs (if any) to aStream." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3354 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3355 |
|s| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3356 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3357 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3358 |
primitive definitions - if any |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3359 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3360 |
self fileOutPrimitiveDefinitionsOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3361 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3362 |
primitive functions - if any |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3363 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3364 |
(s := self primitiveFunctionsString) notNil ifTrue:[ |
2088
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3365 |
aStream nextPutChunkSeparator. |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3366 |
self printClassNameOn:aStream. |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3367 |
aStream nextPutAll:' primitiveFunctions'; |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3368 |
nextPutChunkSeparator; |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3369 |
cr. |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3370 |
aStream nextPutAll:s. |
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3371 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3372 |
]. |
2088
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3373 |
|
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
3374 |
"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
|
3375 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3376 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3377 |
!Class methodsFor:'printOut'! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3378 |
|
2046 | 3379 |
nameWithoutNameSpacePrefix |
3380 |
"helper for fileOut and others - return my names printString, |
|
3381 |
without any nameSpace prefix (but with owningClasses prefix)" |
|
3382 |
||
3383 |
|nm idx owner| |
|
3384 |
||
2070
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3385 |
nm := self nameWithoutPrefix. |
2046 | 3386 |
(owner := self owningClass) isNil ifTrue:[ |
2070
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3387 |
^ nm |
2046 | 3388 |
]. |
3389 |
||
2070
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3390 |
^ (owner nameWithoutNameSpacePrefix , '::' , nm) |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3391 |
|
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3392 |
"a public class: |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3393 |
Array name |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3394 |
Array nameWithoutPrefix |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3395 |
Array nameWithoutNameSpacePrefix |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3396 |
" |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3397 |
|
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3398 |
"a private class: |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3399 |
Method::MethodWhoInfo name |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3400 |
Method::MethodWhoInfo nameWithoutPrefix |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3401 |
Method::MethodWhoInfo nameWithoutNameSpacePrefix |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3402 |
" |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3403 |
|
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3404 |
"a namespace class: |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3405 |
CodingExamples::TopClass name |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3406 |
CodingExamples::TopClass nameWithoutPrefix |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3407 |
CodingExamples::TopClass nameWithoutNameSpacePrefix |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3408 |
" |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3409 |
|
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3410 |
"a private class in a namespace class: |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3411 |
CodingExamples::TopClass::SubClass name |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3412 |
CodingExamples::TopClass::SubClass nameWithoutPrefix |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3413 |
CodingExamples::TopClass::SubClass nameWithoutNameSpacePrefix |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3414 |
" |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3415 |
|
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3416 |
"Modified: 5.1.1997 / 18:22:57 / cg" |
2046 | 3417 |
! |
3418 |
||
1756 | 3419 |
nameWithoutPrefix |
3420 |
"helper for fileOut and others - return my names printString, |
|
2046 | 3421 |
without any owningClass or nameSpace prefix" |
1741 | 3422 |
|
1746
b3d129085905
print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
3423 |
|nm idx| |
b3d129085905
print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
3424 |
|
b3d129085905
print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
3425 |
nm := self name. |
b3d129085905
print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
3426 |
idx := nm lastIndexOf:$:. |
2070
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3427 |
idx == 0 ifTrue:[ |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3428 |
^ nm |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3429 |
]. |
1746
b3d129085905
print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
3430 |
^ nm copyFrom:idx+1. |
b3d129085905
print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
3431 |
|
2070
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3432 |
"a public class: |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3433 |
Array name |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3434 |
Array nameWithoutPrefix |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3435 |
Array nameWithoutNameSpacePrefix |
1930
6a8b95d5f108
fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents:
1928
diff
changeset
|
3436 |
" |
2070
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3437 |
|
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3438 |
"a private class: |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3439 |
Method::MethodWhoInfo name |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3440 |
Method::MethodWhoInfo nameWithoutPrefix |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3441 |
Method::MethodWhoInfo nameWithoutNameSpacePrefix |
1930
6a8b95d5f108
fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents:
1928
diff
changeset
|
3442 |
" |
6a8b95d5f108
fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents:
1928
diff
changeset
|
3443 |
|
2070
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3444 |
"a namespace class: |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3445 |
CodingExamples::TopClass name |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3446 |
CodingExamples::TopClass nameWithoutPrefix |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3447 |
CodingExamples::TopClass nameWithoutNameSpacePrefix |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3448 |
" |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3449 |
|
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3450 |
"a private class in a namespace class: |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3451 |
CodingExamples::TopClass::SubClass name |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3452 |
CodingExamples::TopClass::SubClass nameWithoutPrefix |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3453 |
CodingExamples::TopClass::SubClass nameWithoutNameSpacePrefix |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3454 |
" |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3455 |
|
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
3456 |
"Modified: 5.1.1997 / 18:23:14 / cg" |
1741 | 3457 |
! |
3458 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3459 |
printClassNameOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3460 |
"helper for fileOut - print my name if I am not a Metaclass; |
2036
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3461 |
otherwise my name without -class followed by space-class. |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3462 |
Private classes always print their owning-class as nameSpace |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3463 |
prefix; non-private ones print without, except if the |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3464 |
FileOutNameSpaceQuery returns true. The last feature is used |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3465 |
with changefile updates - here, the full name is wanted." |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3466 |
|
1739 | 3467 |
|nm| |
3468 |
||
2049
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
3469 |
FileOutNameSpaceQuerySignal raise == false ifTrue:[ |
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
3470 |
nm := self nameWithoutNameSpacePrefix |
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
3471 |
] ifFalse:[ |
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
3472 |
nm := self name. |
2011
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
3473 |
]. |
2049
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
3474 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3475 |
self isMeta ifTrue:[ |
1739 | 3476 |
(nm endsWith:' class') ifTrue:[ |
3477 |
nm := nm copyWithoutLast:6. |
|
2049
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
3478 |
aStream nextPutAll:nm; nextPutAll:' class'. |
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
3479 |
^ self |
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
3480 |
] |
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
3481 |
]. |
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
3482 |
aStream nextPutAll:nm. |
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
3483 |
|
308ce0c3828a
dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents:
2046
diff
changeset
|
3484 |
"Modified: 3.1.1997 / 20:41:26 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3485 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3486 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3487 |
printClassVarNamesOn:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3488 |
"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
|
3489 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3490 |
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
|
3491 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3492 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3493 |
printFullHierarchyOn:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3494 |
"print myself and all subclasses on aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3495 |
recursively calls itself to print subclasses. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3496 |
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
|
3497 |
|
1996
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3498 |
|nm| |
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3499 |
|
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3500 |
nm := self name. |
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3501 |
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
|
3502 |
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
|
3503 |
aStream nextPutLine:')'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3504 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3505 |
(self subclasses sort:[:a :b | a name < b name]) do:[:aSubclass | |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3506 |
aSubclass printFullHierarchyOn:aStream indent:(indent + 2) |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3507 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3508 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3509 |
"|printStream| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3510 |
printStream := Printer new. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3511 |
Object printFullHierarchyOn:printStream indent:0. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3512 |
printStream close" |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3513 |
|
1996
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3514 |
"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
|
3515 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3516 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3517 |
printOutCategory:aCategory on:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3518 |
"print out all methods in aCategory on aPrintStream should be a PrintStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3519 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3520 |
|dict any| |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3521 |
|
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3522 |
dict := self methodDictionary. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3523 |
dict notNil ifTrue:[ |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3524 |
any := false. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3525 |
dict do:[:aMethod | |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3526 |
(aCategory = aMethod category) ifTrue:[ |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3527 |
any := true |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3528 |
] |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3529 |
]. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3530 |
any ifTrue:[ |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3531 |
aPrintStream italic. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3532 |
aPrintStream nextPutAll:aCategory. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3533 |
aPrintStream normal. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3534 |
aPrintStream cr; cr. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3535 |
dict do:[:aMethod | |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3536 |
(aCategory = aMethod category) ifTrue:[ |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3537 |
self printOutSource:(aMethod source) on:aPrintStream. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3538 |
aPrintStream cr; cr |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3539 |
] |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3540 |
]. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3541 |
aPrintStream cr |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3542 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3543 |
] |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3544 |
|
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3545 |
"Modified: 12.6.1996 / 11:47:36 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3546 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3547 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3548 |
printOutDefinitionOn:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3549 |
"print out my definition" |
1 | 3550 |
|
333 | 3551 |
|comment s| |
3552 |
||
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3553 |
aPrintStream nextPutAll:'class '; bold; nextPutLine:name; normal. |
1 | 3554 |
aPrintStream nextPutAll:'superclass '. |
3555 |
superclass isNil ifTrue:[ |
|
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3556 |
s := 'Object' |
1 | 3557 |
] ifFalse:[ |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3558 |
s := superclass name |
1 | 3559 |
]. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3560 |
aPrintStream nextPutLine:s. |
1 | 3561 |
|
3562 |
aPrintStream nextPutAll:'instance Variables '. |
|
3563 |
self printInstVarNamesOn:aPrintStream indent:21. |
|
3564 |
aPrintStream cr. |
|
3565 |
||
3566 |
aPrintStream nextPutAll:'class Variables '. |
|
3567 |
self printClassVarNamesOn:aPrintStream indent:21. |
|
3568 |
aPrintStream cr. |
|
3569 |
||
3570 |
category notNil ifTrue:[ |
|
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3571 |
aPrintStream nextPutAll:'category '; |
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3572 |
nextPutLine:(category printString). |
1 | 3573 |
]. |
3574 |
||
193 | 3575 |
(comment := self comment) notNil ifTrue:[ |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3576 |
aPrintStream cr; nextPutLine:'comment:'; italic; nextPutLine:comment; normal |
1 | 3577 |
] |
733
983d045c17f5
make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
3578 |
|
983d045c17f5
make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
3579 |
"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
|
3580 |
"Modified: 9.11.1996 / 00:13:37 / cg" |
1 | 3581 |
! |
3582 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3583 |
printOutOn:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3584 |
"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
|
3585 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3586 |
|collectionOfCategories| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3587 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3588 |
self printOutDefinitionOn:aPrintStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3589 |
aPrintStream cr. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3590 |
collectionOfCategories := self class categories. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3591 |
collectionOfCategories notNil ifTrue:[ |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3592 |
aPrintStream nextPutLine:'class protocol'. |
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3593 |
aPrintStream cr. |
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3594 |
collectionOfCategories do:[:aCategory | |
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3595 |
self class printOutCategory:aCategory on:aPrintStream |
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3596 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3597 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3598 |
collectionOfCategories := self categories. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3599 |
collectionOfCategories notNil ifTrue:[ |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3600 |
aPrintStream nextPutLine:'instance protocol'. |
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3601 |
aPrintStream cr. |
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3602 |
collectionOfCategories do:[:aCategory | |
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3603 |
self printOutCategory:aCategory on:aPrintStream |
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3604 |
] |
555 | 3605 |
] |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3606 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3607 |
"Modified: 9.11.1996 / 00:14:11 / cg" |
555 | 3608 |
! |
3609 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3610 |
printOutSource:aString on:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3611 |
"print out a source-string; the message-specification is printed bold, |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3612 |
comments are printed italic" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3613 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3614 |
|text textIndex textSize line lineIndex lineSize inComment aCharacter| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3615 |
text := aString asStringCollection. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3616 |
aPrintStream bold. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3617 |
aPrintStream nextPutAll:(text at:1). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3618 |
aPrintStream normal. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3619 |
aPrintStream cr. |
1 | 3620 |
inComment := false. |
3621 |
textSize := text size. |
|
3622 |
textIndex := 2. |
|
3623 |
[textIndex <= textSize] whileTrue:[ |
|
153 | 3624 |
line := text at:textIndex. |
3625 |
((line occurrencesOf:Character doubleQuote) == 0) ifTrue:[ |
|
3626 |
aPrintStream nextPutAll:line |
|
3627 |
] ifFalse:[ |
|
3628 |
lineSize := line size. |
|
3629 |
lineIndex := 1. |
|
3630 |
[lineIndex <= lineSize] whileTrue:[ |
|
3631 |
aCharacter := line at:lineIndex. |
|
3632 |
(aCharacter == Character doubleQuote) ifTrue:[ |
|
3633 |
inComment ifTrue:[ |
|
3634 |
aPrintStream normal. |
|
3635 |
aPrintStream nextPut:aCharacter. |
|
3636 |
inComment := false |
|
3637 |
] ifFalse:[ |
|
3638 |
aPrintStream nextPut:aCharacter. |
|
3639 |
aPrintStream italic. |
|
3640 |
inComment := true |
|
3641 |
] |
|
3642 |
] ifFalse:[ |
|
3643 |
aPrintStream nextPut:aCharacter |
|
3644 |
]. |
|
3645 |
lineIndex := lineIndex + 1 |
|
3646 |
] |
|
3647 |
]. |
|
3648 |
aPrintStream cr. |
|
3649 |
textIndex := textIndex + 1 |
|
1 | 3650 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3651 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3652 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3653 |
!Class methodsFor:'private changes management'! |
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 |
addChangeRecordForChangeCategory:category to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3656 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3657 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3658 |
"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
|
3659 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3660 |
self printClassNameOn:aStream. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3661 |
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
|
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 |
"this test allows a smalltalk without Projects/ChangeSets" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3665 |
Project notNil ifTrue:[ |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3666 |
Project addClassDefinitionChangeFor:self |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3667 |
] |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3668 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3669 |
"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
|
3670 |
"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
|
3671 |
! |
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 |
addChangeRecordForClass:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3674 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3675 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3676 |
"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
|
3677 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3678 |
aClass isLoaded ifTrue:[ |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3679 |
aClass fileOutDefinitionOn:aStream. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3680 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3681 |
Project notNil ifTrue:[ |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3682 |
Project addClassDefinitionChangeFor:aClass |
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 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3686 |
"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
|
3687 |
"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
|
3688 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3689 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3690 |
addChangeRecordForClassComment:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3691 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3692 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3693 |
"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
|
3694 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3695 |
aClass fileOutCommentOn:aStream. |
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 |
"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
|
3698 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3699 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3700 |
addChangeRecordForClassInstvars:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3701 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3702 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3703 |
"append a class-instvars-record to aStream" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3704 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3705 |
aClass fileOutClassInstVarDefinitionOn:aStream. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3706 |
aStream nextPutChunkSeparator. |
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 |
addChangeRecordForClassRemove:oldName 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 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
|
3713 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3714 |
aStream nextPutAll:('Smalltalk removeClass:' , oldName). |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3715 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3716 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3717 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3718 |
addChangeRecordForClassRename:oldName to:newName to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3719 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3720 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3721 |
"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
|
3722 |
|
1846 | 3723 |
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
|
3724 |
aStream nextPutChunkSeparator. |
1846 | 3725 |
|
3726 |
"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
|
3727 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3728 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3729 |
addChangeRecordForMethod:aMethod to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3730 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3731 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3732 |
"append a method-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
|
3733 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3734 |
self fileOutMethod:aMethod on:aStream. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3735 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3736 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3737 |
addChangeRecordForMethodCategory:aMethod category:newCategory to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3738 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3739 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3740 |
"append a methodCategory-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
|
3741 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3742 |
|selector| |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3743 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3744 |
selector := aMethod selector. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3745 |
selector notNil ifTrue:[ |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3746 |
aStream nextPutAll:'('. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3747 |
self printClassNameOn:aStream. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3748 |
aStream nextPutAll:(' compiledMethodAt:' , selector storeString). |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3749 |
aStream nextPutAll:(') category:' , newCategory storeString). |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3750 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3751 |
] |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3752 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3753 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3754 |
addChangeRecordForMethodPrivacy:aMethod to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3755 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3756 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3757 |
"append a method-privacy-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
|
3758 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3759 |
|selector| |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3760 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3761 |
selector := aMethod selector. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3762 |
selector notNil ifTrue:[ |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3763 |
aStream nextPutAll:'('. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3764 |
self printClassNameOn:aStream. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3765 |
aStream nextPutAll:(' compiledMethodAt:' , selector storeString). |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3766 |
aStream nextPutAll:(') privacy:' , aMethod privacy storeString). |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3767 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3768 |
] |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3769 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3770 |
"Modified: 27.8.1995 / 22:59:56 / claus" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3771 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3772 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3773 |
addChangeRecordForPrimitiveDefinitions:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3774 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3775 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3776 |
"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
|
3777 |
|
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3778 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveDefinitions:'''; |
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3779 |
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
|
3780 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3781 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3782 |
"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
|
3783 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3784 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3785 |
addChangeRecordForPrimitiveFunctions:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3786 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3787 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3788 |
"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
|
3789 |
|
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3790 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveFunctions:'''; |
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3791 |
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
|
3792 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3793 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3794 |
"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
|
3795 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3796 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3797 |
addChangeRecordForPrimitiveVariables:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3798 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3799 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3800 |
"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
|
3801 |
|
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3802 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveVariables:'''; |
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3803 |
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
|
3804 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3805 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3806 |
"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
|
3807 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3808 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3809 |
addChangeRecordForRemoveSelector:aSelector to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3810 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3811 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3812 |
"append a method-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
|
3813 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3814 |
self printClassNameOn:aStream. |
1509
fc4b99648f9f
change record for removeSelector must save storeString of selector;
Claus Gittinger <cg@exept.de>
parents:
1461
diff
changeset
|
3815 |
aStream nextPutAll:(' removeSelector:' , aSelector asSymbol storeString). |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3816 |
aStream nextPutChunkSeparator. |
1509
fc4b99648f9f
change record for removeSelector must save storeString of selector;
Claus Gittinger <cg@exept.de>
parents:
1461
diff
changeset
|
3817 |
|
fc4b99648f9f
change record for removeSelector must save storeString of selector;
Claus Gittinger <cg@exept.de>
parents:
1461
diff
changeset
|
3818 |
"Modified: 1.7.1996 / 21:27:55 / cg" |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3819 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3820 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3821 |
addChangeRecordForRenameCategory:oldCategory to:newCategory to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3822 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3823 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3824 |
"append a category-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
|
3825 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3826 |
self printClassNameOn:aStream. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3827 |
aStream nextPutAll:(' renameCategory:' , oldCategory storeString). |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3828 |
aStream nextPutAll:(' to:' , newCategory storeString). |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3829 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3830 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3831 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3832 |
addInfoRecord:aMessage to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3833 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3834 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3835 |
"append an info-record (snapshot, class fileOut etc.) to aStream" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3836 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3837 |
aStream nextPutAll:('''---- ' , aMessage , ' ', |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3838 |
Date today printString , ' ' , |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3839 |
Time now printString , |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3840 |
' ----'''). |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3841 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3842 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3843 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3844 |
writingChangeDo:aBlock |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3845 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3846 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3847 |
"common helper to write a change record. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3848 |
Opens the changefile and executes aBlock passing the stream |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3849 |
as argument. WriteErrors are cought and will lead to a warning. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3850 |
The changefile is not kept open, to force the change to go to disk |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3851 |
as soon as possible - thus, in case of a crash, no changes should |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3852 |
be lost due to buffering." |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3853 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3854 |
self writingChangeWithTimeStamp:true do:aBlock |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3855 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3856 |
"Modified: 18.11.1995 / 15:43:36 / cg" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3857 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3858 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3859 |
writingChangePerform:aSelector with:anArgument |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3860 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3861 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3862 |
self writingChangeWithTimeStamp:true perform:aSelector with:anArgument |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3863 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3864 |
"Created: 28.10.1995 / 16:50:48 / cg" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3865 |
"Modified: 18.11.1995 / 15:44:53 / cg" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3866 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3867 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3868 |
writingChangeWithTimeStamp:doStampIt do:aBlock |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3869 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3870 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3871 |
"common helper to write a change record. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3872 |
Opens the changefile and executes aBlock passing the stream |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3873 |
as argument. WriteErrors are cought and will lead to a warning. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3874 |
The changefile is not kept open, to force the change to go to disk |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3875 |
as soon as possible - thus, in case of a crash, no changes should |
2195 | 3876 |
be lost due to buffering. |
3877 |
Access to the change file is serialized via the accessLock; |
|
3878 |
this prevents the changefile to be corrupted when multiple users |
|
3879 |
accept in the browser in a multi-display (or timesliced) configuration" |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3880 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3881 |
ChangeFileAccessLock critical:[ |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3882 |
|aStream| |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3883 |
|
2036
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3884 |
FileOutNameSpaceQuerySignal answer:true |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3885 |
do:[ |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3886 |
aStream := self changesStream. |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3887 |
aStream notNil ifTrue:[ |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3888 |
[ |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3889 |
FileStream writeErrorSignal handle:[:ex | |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3890 |
self warn:('could not update the changes-file\\' , ex errorString) withCRs. |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3891 |
ex return |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3892 |
] do:[ |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3893 |
doStampIt ifTrue:[self addChangeTimeStampTo:aStream]. |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3894 |
aBlock value:aStream. |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3895 |
aStream cr. |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3896 |
]. |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3897 |
] valueNowOrOnUnwindDo:[ |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3898 |
aStream close |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3899 |
] |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
3900 |
] |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3901 |
] |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3902 |
] |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3903 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3904 |
"Created: 18.11.1995 / 15:36:02 / cg" |
2256 | 3905 |
"Modified: 24.1.1997 / 19:14:48 / cg" |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3906 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3907 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3908 |
writingChangeWithTimeStamp:stampIt perform:aSelector with:anArgument |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3909 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3910 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3911 |
self writingChangeWithTimeStamp:stampIt do:[:stream | |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3912 |
self perform:aSelector with:anArgument with:stream. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3913 |
] |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3914 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3915 |
"Created: 18.11.1995 / 15:44:28 / cg" |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3916 |
! ! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3917 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3918 |
!Class methodsFor:'private helpers'! |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3919 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3920 |
addAllCategoriesTo:aCollection |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3921 |
"helper - add categories and all superclasses categories |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3922 |
to the argument, aCollection" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3923 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3924 |
(superclass notNil) ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3925 |
superclass addAllCategoriesTo:aCollection |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3926 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3927 |
self addCategoriesTo:aCollection |
556 | 3928 |
! |
3929 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3930 |
addCategoriesTo:aCollection |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3931 |
"helper - add categories to the argument, aCollection" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3932 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3933 |
self methodDictionary do:[:aMethod | |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3934 |
|cat| |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3935 |
|
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3936 |
cat := aMethod category. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3937 |
(aCollection includes:cat) ifFalse:[ |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3938 |
aCollection add:cat |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3939 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3940 |
] |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3941 |
|
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3942 |
"Modified: 12.6.1996 / 11:46:24 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3943 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3944 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3945 |
getPrimitiveSpecsAt:index |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3946 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3947 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3948 |
"return a primitiveSpecification component as string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3949 |
|
2172
151dc4a34898
Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents:
2124
diff
changeset
|
3950 |
|owner pos stream string| |
151dc4a34898
Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents:
2124
diff
changeset
|
3951 |
|
151dc4a34898
Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents:
2124
diff
changeset
|
3952 |
(owner := self owningClass) notNil ifTrue:[^ owner getPrimitiveSpecsAt:index]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3953 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3954 |
primitiveSpec isNil ifTrue:[^ nil]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3955 |
pos := primitiveSpec at:index. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3956 |
pos isNil ifTrue:[^ nil]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3957 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3958 |
"the primitiveSpec 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
|
3959 |
position within the classes sourcefile ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3960 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3961 |
pos isNumber ifTrue:[ |
2172
151dc4a34898
Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents:
2124
diff
changeset
|
3962 |
classFilename notNil ifTrue:[ |
151dc4a34898
Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents:
2124
diff
changeset
|
3963 |
stream := self sourceStream. |
151dc4a34898
Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents:
2124
diff
changeset
|
3964 |
stream notNil ifTrue:[ |
151dc4a34898
Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents:
2124
diff
changeset
|
3965 |
stream position:pos+1. |
151dc4a34898
Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents:
2124
diff
changeset
|
3966 |
string := stream nextChunk. |
151dc4a34898
Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents:
2124
diff
changeset
|
3967 |
stream close. |
151dc4a34898
Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents:
2124
diff
changeset
|
3968 |
^ string |
151dc4a34898
Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents:
2124
diff
changeset
|
3969 |
] |
151dc4a34898
Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents:
2124
diff
changeset
|
3970 |
]. |
151dc4a34898
Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents:
2124
diff
changeset
|
3971 |
^ nil |
544 | 3972 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3973 |
^ pos |
2172
151dc4a34898
Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents:
2124
diff
changeset
|
3974 |
|
151dc4a34898
Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents:
2124
diff
changeset
|
3975 |
"Modified: 15.1.1997 / 15:29:30 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3976 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3977 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3978 |
setPrimitiveSpecsAt:index to:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3979 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3980 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3981 |
"set a primitiveSpecification component to aString" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3982 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3983 |
primitiveSpec isNil ifTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3984 |
primitiveSpec := Array new:3 |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3985 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3986 |
primitiveSpec at:index put:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3987 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3988 |
|
1237 | 3989 |
!Class methodsFor:'protocol printOut'! |
3990 |
||
3991 |
printOutCategoryProtocol:aCategory on:aPrintStream |
|
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3992 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3993 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3994 |
|dict any| |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3995 |
|
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3996 |
dict := self methodDictionary. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3997 |
dict notNil ifTrue:[ |
1237 | 3998 |
any := false. |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
3999 |
dict do:[:aMethod | |
1237 | 4000 |
(aCategory = aMethod category) ifTrue:[ |
4001 |
any := true |
|
4002 |
] |
|
4003 |
]. |
|
4004 |
any ifTrue:[ |
|
4005 |
aPrintStream italic. |
|
4006 |
aPrintStream nextPutAll:aCategory. |
|
4007 |
aPrintStream normal. |
|
4008 |
aPrintStream cr; cr. |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
4009 |
dict do:[:aMethod | |
1237 | 4010 |
(aCategory = aMethod category) ifTrue:[ |
4011 |
self printOutMethodProtocol:aMethod on:aPrintStream. |
|
4012 |
aPrintStream cr; cr |
|
4013 |
] |
|
4014 |
]. |
|
4015 |
aPrintStream cr |
|
4016 |
] |
|
4017 |
] |
|
4018 |
||
4019 |
"Modified: 20.4.1996 / 18:20:26 / cg" |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
4020 |
"Modified: 12.6.1996 / 11:48:46 / stefan" |
1237 | 4021 |
! |
4022 |
||
4023 |
printOutMethodProtocol:aMethod on:aPrintStream |
|
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4024 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4025 |
|
1237 | 4026 |
"given the source in aString, print the methods message specification |
4027 |
and any method comments - without source; used to generate documentation |
|
4028 |
pages" |
|
4029 |
||
4030 |
|text comment| |
|
4031 |
||
4032 |
text := aMethod source asStringCollection. |
|
4033 |
(text size < 1) ifTrue:[^self]. |
|
4034 |
aPrintStream bold. |
|
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
4035 |
aPrintStream nextPutLine:(text at:1). |
1237 | 4036 |
(text size >= 2) ifTrue:[ |
4037 |
(comment := aMethod comment) notNil ifTrue:[ |
|
4038 |
aPrintStream italic. |
|
4039 |
aPrintStream spaces:((text at:2) indexOfNonSeparatorStartingAt:1). |
|
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
4040 |
aPrintStream nextPutLine:aMethod comment. |
1237 | 4041 |
] |
4042 |
]. |
|
4043 |
aPrintStream normal |
|
4044 |
||
4045 |
" |
|
4046 |
Float printOutProtocolOn:Stdout |
|
4047 |
" |
|
4048 |
||
4049 |
"Created: 20.4.1996 / 18:20:31 / cg" |
|
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
4050 |
"Modified: 9.11.1996 / 00:13:54 / cg" |
1237 | 4051 |
! |
4052 |
||
4053 |
printOutProtocolOn:aPrintStream |
|
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4054 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4055 |
|
1237 | 4056 |
|collectionOfCategories| |
4057 |
||
4058 |
self printOutDefinitionOn:aPrintStream. |
|
4059 |
aPrintStream cr. |
|
4060 |
collectionOfCategories := self class categories. |
|
4061 |
collectionOfCategories notNil ifTrue:[ |
|
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
4062 |
aPrintStream nextPutLine:'class protocol'. |
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
4063 |
aPrintStream cr. |
1237 | 4064 |
collectionOfCategories do:[:aCategory | |
4065 |
self class printOutCategoryProtocol:aCategory on:aPrintStream |
|
4066 |
] |
|
4067 |
]. |
|
4068 |
collectionOfCategories := self categories. |
|
4069 |
collectionOfCategories notNil ifTrue:[ |
|
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
4070 |
aPrintStream nextPutLine:'instance protocol'. |
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
4071 |
aPrintStream cr. |
1237 | 4072 |
collectionOfCategories do:[:aCategory | |
4073 |
self printOutCategoryProtocol:aCategory on:aPrintStream |
|
4074 |
] |
|
4075 |
] |
|
4076 |
||
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
4077 |
"Modified: 9.11.1996 / 00:14:26 / cg" |
1237 | 4078 |
! ! |
4079 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4080 |
!Class methodsFor:'queries'! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4081 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4082 |
allCategories |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4083 |
"Return a collection of all method-categories known in class |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4084 |
and all superclasses. This does NOT include the metaclass categories. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4085 |
The returned collection is not sorted by any order." |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4086 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4087 |
|coll| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4088 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4089 |
coll := OrderedCollection new. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4090 |
self addAllCategoriesTo:coll. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4091 |
^ coll |
453 | 4092 |
|
4093 |
" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4094 |
Point categories |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4095 |
Point allCategories |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4096 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4097 |
Point class categories |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4098 |
Point class allCategories |
453 | 4099 |
" |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4100 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4101 |
"Modified: 21.3.1996 / 16:28:57 / cg" |
453 | 4102 |
! |
4103 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4104 |
categories |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4105 |
"Return a collection of all method-categories known in the receiver class. |
1193
5784d6b2b918
moved some protocol from Class to upper levels
Claus Gittinger <cg@exept.de>
parents:
1179
diff
changeset
|
4106 |
This does NOT include the metaclasses categories or the superclass categories. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4107 |
The returned collection is not sorted by any order." |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
4108 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
4109 |
|newList cat| |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
4110 |
|
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
4111 |
newList := OrderedCollection new. |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
4112 |
self methodDictionary do:[:aMethod | |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4113 |
cat := aMethod category. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4114 |
newList indexOf:cat ifAbsent:[newList add:cat] |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
4115 |
]. |
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
4116 |
^ newList |
453 | 4117 |
|
4118 |
" |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4119 |
Point categories |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4120 |
Point class categories |
293 | 4121 |
" |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4122 |
|
1193
5784d6b2b918
moved some protocol from Class to upper levels
Claus Gittinger <cg@exept.de>
parents:
1179
diff
changeset
|
4123 |
"Modified: 16.4.1996 / 18:06:11 / cg" |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
4124 |
"Modified: 12.6.1996 / 11:25:59 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4125 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4126 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4127 |
isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4128 |
"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
|
4129 |
(a real class, not just behavior); |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4130 |
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
|
4131 |
See also Behavior>>isBehavior." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4132 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4133 |
^ true |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4134 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4135 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4136 |
Point isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4137 |
1 isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4138 |
Behavior new isBehavior |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4139 |
Behavior new isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4140 |
Class new isBehavior |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4141 |
Class new isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4142 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4143 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4144 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4145 |
wasAutoloaded |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4146 |
"return true, if this class came into the system via an |
555 | 4147 |
autoload; false otherwise. |
4148 |
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
|
4149 |
Autoload. The interface here is for your convenience." |
555 | 4150 |
|
4151 |
^ 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
|
4152 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
4153 |
"Modified: 21.3.1996 / 16:27:09 / cg" |
555 | 4154 |
! |
4155 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4156 |
whichClassDefinesClassVar:aVariableName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4157 |
"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
|
4158 |
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
|
4159 |
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
|
4160 |
many throw away intermediate objects." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4161 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4162 |
|cls| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4163 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4164 |
cls := self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4165 |
[cls notNil] whileTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4166 |
(cls classVarNames includes:aVariableName) ifTrue:[ ^ cls]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4167 |
cls := cls superclass |
556 | 4168 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4169 |
^ nil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4170 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4171 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4172 |
StandardSystemView whichClassDefinesClassVar:'ErrorSignal' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4173 |
StandardSystemView whichClassDefinesClassVar:'Foo' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4174 |
" |
556 | 4175 |
! |
4176 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4177 |
whichClassDefinesInstVar:aVariableName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4178 |
"return the class which defines the instance variable |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4179 |
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
|
4180 |
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
|
4181 |
many throw away intermediate objects." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4182 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4183 |
|cls| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4184 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4185 |
cls := self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4186 |
[cls notNil] whileTrue:[ |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4187 |
(cls instVarNames includes:aVariableName) ifTrue:[ ^ cls]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4188 |
cls := cls superclass |
453 | 4189 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4190 |
^ nil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4191 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4192 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4193 |
StandardSystemView whichClassDefinesInstVar:'label' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4194 |
StandardSystemView whichClassDefinesInstVar:'paint' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4195 |
StandardSystemView whichClassDefinesInstVar:'foo' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4196 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4197 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
4198 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4199 |
!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
|
4200 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4201 |
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
|
4202 |
"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
|
4203 |
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
|
4204 |
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
|
4205 |
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
|
4206 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4207 |
|owner| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4208 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4209 |
(owner := self owningClass) notNil ifTrue:[^ owner binaryRevision]. |
953
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4210 |
self isMeta ifTrue:[ |
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4211 |
^ self soleInstance binaryRevision |
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4212 |
]. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4213 |
^ 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
|
4214 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4215 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4216 |
Object binaryRevision |
953
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4217 |
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
|
4218 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4219 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4220 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4221 |
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
|
4222 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4223 |
|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
|
4224 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4225 |
classes := Smalltalk allClasses |
953
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4226 |
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
|
4227 |
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
|
4228 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4229 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4230 |
"Created: 7.12.1995 / 10:58:47 / cg" |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4231 |
"Modified: 15.10.1996 / 18:55:28 / 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
|
4232 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4233 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4234 |
packageSourceCodeInfo |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4235 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4236 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4237 |
"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
|
4238 |
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
|
4239 |
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
|
4240 |
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
|
4241 |
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
|
4242 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4243 |
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
|
4244 |
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
|
4245 |
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
|
4246 |
(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
|
4247 |
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
|
4248 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4249 |
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
|
4250 |
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
|
4251 |
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
|
4252 |
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
|
4253 |
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
|
4254 |
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
|
4255 |
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
|
4256 |
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
|
4257 |
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
|
4258 |
(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
|
4259 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4260 |
For example: |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4261 |
'....(libbasic)' -> module: stx directory: libbasic library: libbasic |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4262 |
'....(stx:libbasic)' -> module: stx directory: libbasic library: libbasic |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4263 |
'....(aeg:libIECInterface)' -> module: aeg directory: libIECInterface library:libIECInterface |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4264 |
'....(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
|
4265 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4266 |
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
|
4267 |
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
|
4268 |
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
|
4269 |
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
|
4270 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4271 |
Caveat: |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4272 |
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
|
4273 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4274 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4275 |
|owner sourceInfo packageString idx1 idx2 |
2453
603af5a4e0fc
handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents:
2444
diff
changeset
|
4276 |
moduleString directoryString libraryString components 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
|
4277 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4278 |
(owner := self owningClass) notNil ifTrue:[^ owner packageSourceCodeInfo]. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4279 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4280 |
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
|
4281 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4282 |
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
|
4283 |
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
|
4284 |
idx1 ~~ 0 ifTrue:[ |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4285 |
idx2 := packageString indexOf:$) startingAt:idx1+1. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4286 |
idx2 ~~ 0 ifTrue:[ |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4287 |
sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1 |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4288 |
] |
2453
603af5a4e0fc
handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents:
2444
diff
changeset
|
4289 |
] ifFalse:[ |
603af5a4e0fc
handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents:
2444
diff
changeset
|
4290 |
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
|
4291 |
]. |
2453
603af5a4e0fc
handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents:
2444
diff
changeset
|
4292 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4293 |
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
|
4294 |
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
|
4295 |
components size == 0 ifTrue:[ |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4296 |
moduleString := 'stx'. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4297 |
directoryString := libraryString := ''. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4298 |
^ nil |
2454 | 4299 |
]. |
4300 |
components size == 1 ifTrue:[ |
|
4301 |
"/ a single name given - the module becomes 'stx' or |
|
4302 |
"/ the very first directory component (if such a module exists). |
|
4303 |
"/ If the component includes slashes, its the directory |
|
4304 |
"/ otherwise the library |
|
4305 |
"/ |
|
4306 |
dirComponents := Filename components:(components at:1). |
|
4307 |
||
4308 |
(dirComponents size > 1 |
|
4309 |
and:[(mgr := self sourceCodeManager) notNil |
|
4310 |
and:[mgr checkForExistingModule:dirComponents first]]) ifTrue:[ |
|
4311 |
moduleString := dirComponents first. |
|
4312 |
directoryString := libraryString := (Filename fromComponents:(dirComponents copyFrom:2)) asString. |
|
4313 |
] ifFalse:[ |
|
4314 |
moduleString := 'stx'. |
|
4315 |
directoryString := libraryString := components at:1. |
|
4316 |
]. |
|
4317 |
||
4318 |
(libraryString includes:$/) ifTrue:[ |
|
4319 |
libraryString := libraryString asFilename baseName |
|
4320 |
] |
|
773
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 |
] ifFalse:[ |
2454 | 4322 |
components size == 2 ifTrue:[ |
4323 |
"/ two components - assume its the module and the directory; |
|
4324 |
"/ the library is assumed to be named after the directory |
|
4325 |
"/ except, if slashes are in the name; then the libraryname |
|
4326 |
"/ is the last component. |
|
4327 |
"/ |
|
4328 |
moduleString := components at:1. |
|
4329 |
directoryString := libraryString := components at:2. |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4330 |
(libraryString includes:$/) ifTrue:[ |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4331 |
libraryString := libraryString asFilename baseName |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4332 |
] |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4333 |
] ifFalse:[ |
2454 | 4334 |
"/ all components given |
4335 |
moduleString := components at:1. |
|
4336 |
directoryString := components at:2. |
|
4337 |
libraryString := components at:3. |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4338 |
] |
773
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 |
]. |
2454 | 4340 |
|
773
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 |
libraryString isEmpty ifTrue:[ |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4342 |
directoryString notEmpty ifTrue:[ |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4343 |
libraryString := directoryString asFilename baseName |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4344 |
]. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4345 |
libraryString isEmpty ifTrue:[ |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4346 |
"/ lets extract the library from the liblist file ... |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4347 |
libraryString := Smalltalk libraryFileNameOfClass:self. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4348 |
libraryString isNil ifTrue:[^ nil]. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4349 |
] |
773
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 |
]. |
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 |
|
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 |
moduleString isEmpty ifTrue:[ |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4353 |
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
|
4354 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4355 |
directoryString isEmpty ifTrue:[ |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4356 |
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
|
4357 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4358 |
|
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 |
^ IdentityDictionary |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4360 |
with:(#module->moduleString) |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4361 |
with:(#directory->directoryString) |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4362 |
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
|
4363 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4364 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4365 |
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
|
4366 |
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
|
4367 |
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
|
4368 |
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
|
4369 |
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
|
4370 |
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
|
4371 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4372 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4373 |
"Created: 4.11.1995 / 20:36:53 / cg" |
2454 | 4374 |
"Modified: 17.3.1997 / 18:13:03 / 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
|
4375 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4376 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4377 |
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
|
4378 |
"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
|
4379 |
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
|
4380 |
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
|
4381 |
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
|
4382 |
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
|
4383 |
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
|
4384 |
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
|
4385 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4386 |
|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
|
4387 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4388 |
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
|
4389 |
info notNil ifTrue:[ |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4390 |
^ info at:#revision ifAbsent: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
|
4391 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4392 |
^ 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
|
4393 |
|
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 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4395 |
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
|
4396 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4397 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4398 |
"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
|
4399 |
"Modified: 12.12.1995 / 20:30: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
|
4400 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4401 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4402 |
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
|
4403 |
"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
|
4404 |
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
|
4405 |
The revisionInfo contains all or a subset of: |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4406 |
#binaryRevision - the revision upon which the binary of this class is based |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4407 |
#revision - the revision upon which the class is based logically |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4408 |
(different, if a changed class was checked in, but not yet recompiled) |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4409 |
#user - the user who checked in the logical revision |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4410 |
#date - the date when the logical revision was checked in |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4411 |
#time - the time when the logical revision was checked in |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4412 |
#fileName - the classes source file name |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4413 |
#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
|
4414 |
" |
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 |
|
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
4416 |
|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
|
4417 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4418 |
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
|
4419 |
vsnString notNil ifTrue:[ |
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
4420 |
mgr := self sourceCodeManager. |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
4421 |
mgr notNil ifTrue:[ |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
4422 |
info := mgr revisionInfoFromString:vsnString |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
4423 |
] ifFalse:[ |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
4424 |
info := Class revisionInfoFromString:vsnString. |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
4425 |
]. |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4426 |
info notNil ifTrue:[ |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4427 |
info at:#binaryRevision put:revision. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4428 |
] |
773
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 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4430 |
^ 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
|
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 |
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
|
4434 |
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
|
4435 |
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
|
4436 |
" |
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 |
"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
|
4439 |
"Modified: 29.1.1997 / 18:59:12 / 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
|
4440 |
! |
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 |
|
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 |
revisionString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4443 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4444 |
|
773
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 |
"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
|
4446 |
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
|
4447 |
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
|
4448 |
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
|
4449 |
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
|
4450 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4451 |
|owner cls meta m src val| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4452 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4453 |
(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
|
4454 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4455 |
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
|
4456 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4457 |
self isMeta ifTrue:[ |
1102
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4458 |
meta := self. cls := self soleInstance |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4459 |
] ifFalse:[ |
1102
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4460 |
cls := self. meta := 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
|
4461 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4462 |
|
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 |
m := meta compiledMethodAt:#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
|
4464 |
m isNil ifTrue:[ |
1102
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4465 |
m := cls compiledMethodAt:#version. |
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4466 |
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
|
4467 |
]. |
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 |
|
1102
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4469 |
m isExecutable ifTrue:[ |
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4470 |
"/ |
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4471 |
"/ if its a method returning the string, |
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4472 |
"/ thats the returned value |
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4473 |
"/ |
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4474 |
val := cls version. |
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4475 |
val isString ifTrue:[^ val]. |
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4476 |
]. |
773
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 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4478 |
"/ |
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 |
"/ 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
|
4480 |
"/ 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
|
4481 |
"/ 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
|
4482 |
"/ 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
|
4483 |
"/ 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
|
4484 |
"/ |
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 |
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
|
4486 |
src isNil ifTrue:[^ nil]. |
1811 | 4487 |
^ 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
|
4488 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4489 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4490 |
Smalltalk allClassesDo:[:cls | |
1422 | 4491 |
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
|
4492 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4493 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4494 |
Number 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
|
4495 |
FileDirectory 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
|
4496 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4497 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4498 |
"Created: 29.10.1995 / 19:28:03 / cg" |
1811 | 4499 |
"Modified: 23.10.1996 / 18:23: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
|
4500 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4501 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4502 |
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
|
4503 |
"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
|
4504 |
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
|
4505 |
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
|
4506 |
(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
|
4507 |
|
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 |
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
|
4509 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4510 |
"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
|
4511 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4512 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4513 |
setPackageFromRevision |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4514 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4515 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4516 |
"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
|
4517 |
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
|
4518 |
(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
|
4519 |
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
|
4520 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4521 |
|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
|
4522 |
|
1756 | 4523 |
self owningClass notNil ifTrue:[^ self]. |
4524 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4525 |
mgr := self sourceCodeManager. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4526 |
mgr notNil ifTrue:[ |
1430 | 4527 |
info := mgr sourceInfoOfClass:self |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4528 |
]. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4529 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4530 |
info notNil ifTrue:[ |
1430 | 4531 |
mod := info at:#module ifAbsent:nil. "/ stx, aeg, <your-organization> |
4532 |
dir := info at:#directory ifAbsent:nil. "/ libbasic, libtool ... |
|
4533 |
lib := info at:#library ifAbsent:dir. |
|
4534 |
||
4535 |
p := ''. |
|
4536 |
mod notNil ifTrue:[ |
|
4537 |
mod ~= 'stx' ifTrue:[ |
|
4538 |
p := p , mod |
|
4539 |
] |
|
4540 |
]. |
|
4541 |
dir notNil ifTrue:[ |
|
4542 |
p notEmpty ifTrue:[p := p , ':']. |
|
4543 |
p := p , dir. |
|
4544 |
]. |
|
4545 |
lib notNil ifTrue:[ |
|
4546 |
lib ~= dir ifTrue:[ |
|
4547 |
p notEmpty ifTrue:[p := p , ':']. |
|
4548 |
p := p , lib. |
|
4549 |
] |
|
4550 |
]. |
|
2072
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4551 |
(p notEmpty and:[p ~= package]) ifTrue:[ |
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4552 |
"/ package notNil ifTrue:[ |
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4553 |
"/ (name , ': changing packageID from ''' , package , ''' to ''' , p , '''') infoPrintCR. |
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4554 |
"/ ]. |
1430 | 4555 |
package := p. |
4556 |
||
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
4557 |
self methodDictionary do:[:aMethod | |
1430 | 4558 |
aMethod package isNil ifTrue:[ |
4559 |
aMethod package:p |
|
4560 |
] |
|
4561 |
] |
|
4562 |
]. |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4563 |
]. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4564 |
^ self |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4565 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4566 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4567 |
MemoryMonitor autoload. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4568 |
MemoryMonitor setPackageFromRevision |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4569 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4570 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
4571 |
"Modified: 12.6.1996 / 11:49:31 / stefan" |
2072
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4572 |
"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
|
4573 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4574 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4575 |
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
|
4576 |
"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
|
4577 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4578 |
|owner source cls| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4579 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4580 |
(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
|
4581 |
|
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 |
self isMeta ifTrue:[ |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4583 |
cls := self soleInstance |
773
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 |
] ifFalse:[ |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4585 |
cls := self |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4586 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4587 |
classFilename notNil ifTrue:[ |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4588 |
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
|
4589 |
] ifFalse:[ |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4590 |
source := (Smalltalk fileNameForClass:cls) , '.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
|
4591 |
]. |
953
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4592 |
^ cls sourceStreamFor:source |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4593 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4594 |
"Modified: 15.10.1996 / 18:59:40 / cg" |
953
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4595 |
! |
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4596 |
|
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4597 |
sourceStreamFor:source |
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4598 |
"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
|
4599 |
|
1909 | 4600 |
|owner fileName aStream mgr validated| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4601 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4602 |
(owner := self owningClass) notNil ifTrue:[^ owner sourceStreamFor:source]. |
1909 | 4603 |
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
|
4604 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4605 |
"/ |
892
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4606 |
"/ if there is no SourceCodeManager, |
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4607 |
"/ or TryLocalSourceFirst is true, |
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4608 |
"/ 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
|
4609 |
"/ |
892
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4610 |
((mgr := self sourceCodeManager) isNil |
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4611 |
or:[TryLocalSourceFirst == true]) ifTrue:[ |
1712
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4612 |
fileName := Smalltalk getSourceFileName:source. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4613 |
fileName notNil ifTrue:[ |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4614 |
aStream := fileName asFilename readStream. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4615 |
] |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4616 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4617 |
|
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 |
aStream isNil ifTrue:[ |
1712
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4619 |
"/ |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4620 |
"/ hard case - there is no source file for this class |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4621 |
"/ (in the source-dir-path). |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4622 |
"/ |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4623 |
|
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4624 |
"/ |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4625 |
"/ look if my binary is from a dynamically loaded module, |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4626 |
"/ and, if so, look in the modules directory for the |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4627 |
"/ source file. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4628 |
"/ |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4629 |
ObjectFileLoader notNil ifTrue:[ |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4630 |
ObjectFileLoader loadedObjectHandlesDo:[:h | |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4631 |
|f classes| |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4632 |
|
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4633 |
aStream isNil ifTrue:[ |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4634 |
(classes := h classes) notNil ifTrue:[ |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4635 |
(classes includes:self) ifTrue:[ |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4636 |
f := h pathName. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4637 |
f := f asFilename directory. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4638 |
f := f construct:source. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4639 |
f exists ifTrue:[ |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4640 |
aStream := f readStream. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4641 |
]. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4642 |
]. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4643 |
]. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4644 |
] |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4645 |
]. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4646 |
]. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4647 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4648 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4649 |
aStream isNil ifTrue:[ |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4650 |
|
1712
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4651 |
"/ mhmh - still no source file. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4652 |
"/ If there is a SourceCodeManager, ask it to aquire the |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4653 |
"/ the source for my class, and return an open stream on it. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4654 |
"/ if that one does not know about the source, look in |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4655 |
"/ standard places |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4656 |
|
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4657 |
mgr notNil ifTrue:[ |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4658 |
aStream := mgr getSourceStreamFor:self. |
1935 | 4659 |
aStream notNil ifTrue:[ |
4660 |
(self validateSourceStream:aStream) ifFalse:[ |
|
2124 | 4661 |
('Class [info]: repositories source for `' |
1935 | 4662 |
, (self isMeta ifTrue:[self soleInstance name] |
4663 |
ifFalse:[name]) |
|
4664 |
, ''' is invalid.') infoPrintCR. |
|
4665 |
aStream close. |
|
4666 |
aStream := nil |
|
4667 |
] ifTrue:[ |
|
4668 |
validated := true. |
|
4669 |
]. |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4670 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4671 |
|
1712
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4672 |
aStream isNil ifTrue:[ |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4673 |
fileName := Smalltalk getSourceFileName:source. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4674 |
fileName notNil ifTrue:[ |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4675 |
aStream := fileName asFilename readStream. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4676 |
] |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4677 |
]. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4678 |
]. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4679 |
|
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4680 |
"/ |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4681 |
"/ final chance: try current directory |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4682 |
"/ |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4683 |
aStream isNil ifTrue:[ |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4684 |
aStream := source asFilename readStream. |
c01007eb733e
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
1711
diff
changeset
|
4685 |
]. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4686 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4687 |
|
1909 | 4688 |
(aStream notNil and:[validated not]) ifTrue:[ |
4689 |
(self validateSourceStream:aStream) ifFalse:[ |
|
2124 | 4690 |
('Class [warning]: source for ''' , self name , ''' is invalid. Take care.') errorPrintCR |
1909 | 4691 |
]. |
4692 |
]. |
|
773
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 |
^ 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
|
4694 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4695 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4696 |
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
|
4697 |
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
|
4698 |
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
|
4699 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4700 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4701 |
"Created: 10.11.1995 / 21:05:13 / cg" |
2124 | 4702 |
"Modified: 10.1.1997 / 15:36:26 / 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
|
4703 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4704 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4705 |
updateVersionMethodFor:newRevisionString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4706 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4707 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4708 |
"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
|
4709 |
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
|
4710 |
|
986 | 4711 |
|cls "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
|
4712 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4713 |
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
|
4714 |
self isMeta ifFalse:[ |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4715 |
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
|
4716 |
]. |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4717 |
|
773
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 |
"/ m := cls compiledMethodAt:#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
|
4719 |
"/ 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
|
4720 |
"/ 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
|
4721 |
"/ 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
|
4722 |
"/ |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4723 |
"/ (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
|
4724 |
"/ 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
|
4725 |
"/ 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
|
4726 |
|
1928 | 4727 |
MethodRedefinitionSignal handle:[:ex | |
4728 |
ex proceedWith:#keep |
|
4729 |
] do:[ |
|
4730 |
Class withoutUpdatingChangesDo:[ |
|
4731 |
Compiler compile:'version |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4732 |
^ ''' , 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
|
4733 |
' |
1928 | 4734 |
forClass:cls |
4735 |
inCategory:#documentation |
|
4736 |
notifying:nil |
|
4737 |
install:true |
|
4738 |
skipIfSame:false |
|
4739 |
silent:true. |
|
4740 |
] |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4741 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4742 |
"/ ('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
|
4743 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4744 |
^ 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
|
4745 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4746 |
"Created: 7.12.1995 / 20:42:22 / cg" |
1928 | 4747 |
"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
|
4748 |
! |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4749 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4750 |
validateSourceStream:aStream |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4751 |
"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
|
4752 |
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
|
4753 |
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
|
4754 |
|
1766 | 4755 |
|cls meta cannotCheckReason versionMethod info |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4756 |
versionFromCode versionFromSource oldPos pos src rev| |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4757 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4758 |
self isMeta ifTrue:[ |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4759 |
meta := self. cls := self soleInstance |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4760 |
] ifFalse:[ |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4761 |
cls := self. meta := self class |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4762 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4763 |
|
1766 | 4764 |
cannotCheckReason := nil. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4765 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4766 |
versionMethod := meta compiledMethodAt:#version. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4767 |
(versionMethod isNil |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4768 |
or:[versionMethod isExecutable not]) ifTrue:[ |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4769 |
versionMethod := cls compiledMethodAt:#version. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4770 |
(versionMethod isNil |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4771 |
or:[versionMethod isExecutable not]) ifTrue:[ |
1766 | 4772 |
cannotCheckReason := 'no version method'. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4773 |
] |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4774 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4775 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4776 |
"/ |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4777 |
"/ if its a method returning the string, |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4778 |
"/ thats the returned value |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4779 |
"/ |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4780 |
versionFromCode := cls version. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4781 |
versionFromCode isString ifFalse:[ |
1766 | 4782 |
cannotCheckReason := 'version method does not return a string' |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4783 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4784 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4785 |
"/ |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4786 |
"/ 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
|
4787 |
"/ 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
|
4788 |
"/ 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
|
4789 |
"/ 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
|
4790 |
"/ for the source ... |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4791 |
"/ |
1942 | 4792 |
versionMethod notNil ifTrue:[ |
4793 |
pos := versionMethod sourcePosition. |
|
4794 |
pos isInteger ifFalse:[ |
|
4795 |
"/ mhmh - either no version method, |
|
4796 |
"/ or updated due to a checkin. |
|
4797 |
"/ in any case, this should be a good source. |
|
4798 |
||
4799 |
^ true. |
|
4800 |
"/ cannotCheckReason := 'no source position for version-method' |
|
4801 |
] |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4802 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4803 |
|
1766 | 4804 |
cannotCheckReason notNil ifTrue:[ |
2124 | 4805 |
('Class [warning]: ' , cannotCheckReason) errorPrintCR. |
4806 |
'Class [info]: cannot validate source; trusting source' infoPrintCR. |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4807 |
^ true |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4808 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4809 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4810 |
oldPos := aStream position. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4811 |
aStream position:pos. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4812 |
src := aStream nextChunk. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4813 |
aStream position:oldPos. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4814 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4815 |
(src isNil or:[src isEmpty]) ifTrue:[ |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4816 |
"/ 'empty source for version-method' printCR. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4817 |
^ false |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4818 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4819 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4820 |
versionFromSource := Class revisionStringFromSource:src. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4821 |
versionFromSource = versionFromCode ifTrue:[^ true]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4822 |
|
1786 | 4823 |
versionFromSource isNil ifTrue:[^ false]. |
4824 |
||
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4825 |
"/ mhmh - check my binary version ... |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4826 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4827 |
info := Class revisionInfoFromString:versionFromSource. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4828 |
info notNil ifTrue:[ |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4829 |
rev := info at:#revision. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4830 |
rev = self binaryRevision ifTrue:[^ true]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4831 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4832 |
^ false |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4833 |
|
2124 | 4834 |
"Modified: 10.1.1997 / 15:36:51 / 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
|
4835 |
! ! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4836 |
|
1739 | 4837 |
!Class class methodsFor:'documentation'! |
662 | 4838 |
|
4839 |
version |
|
2481
bb9bc51ce5f6
hierarchy printing moved to superclass.
Claus Gittinger <cg@exept.de>
parents:
2477
diff
changeset
|
4840 |
^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.263 1997-03-22 13:14:21 cg Exp $' |
708
ba92b2a8477d
include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents:
707
diff
changeset
|
4841 |
! ! |
453 | 4842 |
Class initialize! |