author | werner |
Fri, 02 Apr 2004 13:30:22 +0200 | |
changeset 8285 | 53824703669c |
parent 8281 | 76b406c7cc2b |
child 8356 | 96c5195d52c7 |
permissions | -rw-r--r-- |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
7368 | 3 |
All Rights Reserved |
1 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
5340
cdc42cba8f01
add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents:
5296
diff
changeset
|
13 |
"{ Package: 'stx:libbasic' }" |
cdc42cba8f01
add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents:
5296
diff
changeset
|
14 |
|
719
c557a530f971
dont appending a chunk-separator to the initial copyright
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
15 |
ClassDescription subclass:#Class |
5849
4cc89ecfbbda
prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents:
5801
diff
changeset
|
16 |
instanceVariableNames:'name category classvars comment subclasses classFilename package |
7371
e6fccc3b935c
kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents:
7369
diff
changeset
|
17 |
revision environment signature attributes' |
6823 | 18 |
classVariableNames:'DefaultCategoryForSTV DefaultCategoryForVAGE |
19 |
DefaultCategoryForDolphin' |
|
5849
4cc89ecfbbda
prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents:
5801
diff
changeset
|
20 |
poolDictionaries:'' |
4cc89ecfbbda
prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents:
5801
diff
changeset
|
21 |
category:'Kernel-Classes' |
1 | 22 |
! |
23 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
24 |
Object subclass:#ClassAttributes |
7463 | 25 |
instanceVariableNames:'primitiveDefinitions primitiveVariables primitiveFunctions' |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
26 |
classVariableNames:'' |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
27 |
poolDictionaries:'' |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
28 |
privateIn:Class |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
29 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
30 |
|
1739 | 31 |
!Class class methodsFor:'documentation'! |
68 | 32 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
33 |
copyright |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
34 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
35 |
COPYRIGHT (c) 1989 by Claus Gittinger |
7368 | 36 |
All Rights Reserved |
527
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
37 |
|
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
38 |
This software is furnished under a license and may be used |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
39 |
only in accordance with the terms of that license and with the |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
40 |
inclusion of the above copyright notice. This software may not |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
41 |
be provided or otherwise made available to, or used by, any |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
42 |
other person. No title to or ownership of the software is |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
43 |
hereby transferred. |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
44 |
" |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
45 |
! |
7eedfdb0db62
try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents:
524
diff
changeset
|
46 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
47 |
documentation |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
48 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
49 |
Class adds more functionality to classes; minimum stuff has already |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
50 |
been defined in Behavior and ClassDescription; this adds naming, categories etc. |
68 | 51 |
|
1287 | 52 |
[Instance variables:] |
53 |
||
7368 | 54 |
name <Symbol> the classes name |
55 |
||
56 |
category <Symbol> the classes category |
|
57 |
||
58 |
classvars <String> the names of the class variables |
|
59 |
||
60 |
comment <String> the classes comment; either a string, |
|
61 |
a number specifying the offset in classFilename, or nil |
|
62 |
||
63 |
subclasses <Collection> cached collection of subclasses |
|
64 |
(currently unused - but will be soon) |
|
65 |
||
66 |
classFilename <String> the file (or nil) where the classes |
|
67 |
sources are found |
|
68 |
||
69 |
package <Symbol> the package, in which the class was defined |
|
70 |
(inserted by compilers) |
|
71 |
||
72 |
revision <String> revision string - inserted by stc |
|
73 |
||
74 |
environment <Symbol | nil> cached environment (i.e. Smalltalk or a namespace) |
|
75 |
||
76 |
signature <SmallInteger> the classes signature (used to detect obsolete |
|
77 |
or changed classes with binaryStorage) |
|
78 |
This is filled in lazy - i.e. upon the first signature query. |
|
79 |
||
7371
e6fccc3b935c
kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents:
7369
diff
changeset
|
80 |
attributes <Array | nil> describes primitiveIncludes, primitiveFunctions etc. |
e6fccc3b935c
kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents:
7369
diff
changeset
|
81 |
also a place to add additional attributes, |
7368 | 82 |
without a need to recompile all classes. |
1923
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
83 |
|
97b099fef985
optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
84 |
|
68 | 85 |
WARNING: layout known by compiler and runtime system |
1287 | 86 |
|
87 |
[author:] |
|
7368 | 88 |
Claus Gittinger |
1669 | 89 |
|
90 |
[see also:] |
|
7368 | 91 |
Behavior ClassDescription Metaclass |
68 | 92 |
" |
662 | 93 |
! ! |
68 | 94 |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
95 |
!Class class methodsFor:'accessing-flags'! |
362 | 96 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
97 |
tryLocalSourceFirst |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
98 |
^ TryLocalSourceFirst |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
99 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
100 |
"Created: 24.1.1996 / 19:55:35 / cg" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
101 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
102 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
103 |
tryLocalSourceFirst:aBoolean |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
104 |
TryLocalSourceFirst := aBoolean |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
105 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
106 |
"Created: 24.1.1996 / 19:55:35 / cg" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
107 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
108 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
109 |
updateChanges:aBoolean |
858 | 110 |
"turn on/off changes management. Return the prior value of the flag. |
111 |
This value is used as a default fallback - a querySignal handler may still |
|
112 |
decide to return something else." |
|
362 | 113 |
|
114 |
|prev| |
|
115 |
||
555 | 116 |
prev := UpdatingChanges. |
117 |
UpdatingChanges := aBoolean. |
|
362 | 118 |
^ prev |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
119 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
120 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
121 |
updatingChanges |
858 | 122 |
"return true if changes are recorded. |
123 |
The value returned here is the default fallback - a querySignal handler may still |
|
124 |
decide to return something else." |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
125 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
126 |
^ UpdatingChanges |
1 | 127 |
! ! |
128 |
||
1739 | 129 |
!Class class methodsFor:'helpers'! |
620 | 130 |
|
131 |
revisionInfoFromString:aString |
|
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
132 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
133 |
|
620 | 134 |
"return a dictionary filled with revision info. |
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
135 |
This extracts the relevant info from aString, asking |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
136 |
the sourceCode manager (if there is one)" |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
137 |
|
7754 | 138 |
|mgr| |
620 | 139 |
|
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
140 |
"/ |
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
141 |
"/ 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
|
142 |
"/ |
7755 | 143 |
(mgr := SourceCodeManager) isNil ifTrue:[ |
7748
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
144 |
"/ |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
145 |
"/ fallBack - assume CVS header |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
146 |
"/ |
7755 | 147 |
mgr := CVSSourceCodeManager |
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
148 |
]. |
7754 | 149 |
"/ |
7755 | 150 |
"/ care for standAlone apps which have no CVS (libbasic3) included |
7754 | 151 |
"/ |
152 |
mgr isNil ifTrue:[ |
|
7755 | 153 |
AbstractSourceCodeManager notNil ifTrue:[ |
154 |
^ AbstractSourceCodeManager revisionInfoFromRCSString:aString |
|
155 |
]. |
|
7754 | 156 |
^ nil |
157 |
]. |
|
158 |
^ mgr revisionInfoFromString:aString. |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
159 |
! |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
160 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
161 |
revisionStringFromSource:aMethodSourceString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
162 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
163 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
164 |
"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
|
165 |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
166 |
|lines line| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
167 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
168 |
lines := aMethodSourceString asCollectionOfLines. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
169 |
lines do:[:l | |
7368 | 170 |
|i| |
171 |
||
172 |
i := l indexOfSubCollection:'$Header: '. |
|
173 |
i ~~ 0 ifTrue:[ |
|
174 |
line := l copyFrom:i. |
|
175 |
i := line lastIndexOf:$$. |
|
176 |
i > 1 ifTrue:[ |
|
177 |
line := line copyTo:i. |
|
178 |
]. |
|
179 |
^ line |
|
180 |
] |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
181 |
]. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
182 |
^ nil |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
183 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
184 |
"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
|
185 |
"Modified: 16.10.1996 / 16:54:40 / cg" |
620 | 186 |
! ! |
187 |
||
3618
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
188 |
!Class class methodsFor:'misc'! |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
189 |
|
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
190 |
template:aCategoryString |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
191 |
"return a class-definition template" |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
192 |
|
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
193 |
^ 'NameOfSuperclass subclass:#NameOfClass |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
194 |
instanceVariableNames:''instVarName1 instVarName2'' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
195 |
classVariableNames:''classVarName1 classVarName2'' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
196 |
poolDictionaries:'''' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
197 |
category:''' , aCategoryString , '''' |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
198 |
|
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
199 |
"Created: / 19.6.1998 / 02:09:06 / cg" |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
200 |
! ! |
2ecf31e91023
added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
3617
diff
changeset
|
201 |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
202 |
!Class class methodsFor:'private'! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
203 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
204 |
flushSubclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
205 |
"throw away (forget) the cached subclass information, as created |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
206 |
by #subclassInfo. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
207 |
This is private protocol" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
208 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
209 |
SubclassInfo := nil. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
210 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
211 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
212 |
Class flushSubclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
213 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
214 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
215 |
"Modified: 22.1.1997 / 18:39:36 / cg" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
216 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
217 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
218 |
subclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
219 |
"build & return a dictionary, containing the set of subclass |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
220 |
for each class. This information is kept until explicitely flushed |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
221 |
by #flushSubclassInfo. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
222 |
This cache is used internally, for enumerators like #allSubclasses |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
223 |
or #allSubclassesDo:, to avoid repeated recursive walks over the class |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
224 |
hierarchy. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
225 |
This is private protocol." |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
226 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
227 |
|d| |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
228 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
229 |
SubclassInfo notNil ifTrue:[^ SubclassInfo]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
230 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
231 |
d := IdentityDictionary new. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
232 |
Smalltalk allClassesDo:[:aClass | |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
233 |
|superCls setToAddSubclass| |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
234 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
235 |
superCls := aClass superclass. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
236 |
superCls notNil ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
237 |
setToAddSubclass := d at:superCls ifAbsent:nil. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
238 |
setToAddSubclass isNil ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
239 |
d at:superCls put:(Set with:aClass). |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
240 |
] ifFalse:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
241 |
setToAddSubclass add:aClass |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
242 |
] |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
243 |
] |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
244 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
245 |
SubclassInfo := d. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
246 |
^ d |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
247 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
248 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
249 |
Class subclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
250 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
251 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
252 |
"Modified: 22.1.1997 / 18:44:59 / cg" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
253 |
! ! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
254 |
|
1739 | 255 |
!Class class methodsFor:'queries'! |
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
256 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
257 |
isBuiltInClass |
1266 | 258 |
"return true if this class is known by the run-time-system. |
259 |
Here, true is returned for myself, false for subclasses." |
|
260 |
||
1179
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
261 |
^ self == Class class or:[self == Class] |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
262 |
|
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
263 |
"Created: 15.4.1996 / 17:17:13 / cg" |
1266 | 264 |
"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
|
265 |
! ! |
3e0f32177af4
allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
266 |
|
7261 | 267 |
!Class methodsFor:'Compatibility-Dolphin'! |
6823 | 268 |
|
269 |
defaultCategoryForDolphinClasses |
|
270 |
^ DefaultCategoryForDolphin ? 'Dolphin classes'. |
|
271 |
! |
|
272 |
||
273 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames |
|
274 |
"{ Pragma: +optSpace }" |
|
275 |
||
276 |
"this method allows fileIn of Dolphin classes " |
|
277 |
||
278 |
^ self subclass:t |
|
7368 | 279 |
instanceVariableNames:f |
280 |
classVariableNames:d |
|
281 |
poolDictionaries:s |
|
282 |
category:(self defaultCategoryForDolphinClasses) |
|
283 |
classInstanceVariableNames:classInstanceVariableNames |
|
6823 | 284 |
|
285 |
"Modified: / 15.6.1998 / 21:31:34 / cg" |
|
286 |
"Modified: / 18.3.1999 / 18:16:11 / stefan" |
|
287 |
! |
|
288 |
||
289 |
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames |
|
290 |
"{ Pragma: +optSpace }" |
|
291 |
||
292 |
"this method allows fileIn of Dolphin classes " |
|
293 |
||
294 |
^ self variableSubclass:t |
|
7368 | 295 |
instanceVariableNames:f |
296 |
classVariableNames:d |
|
297 |
poolDictionaries:s |
|
298 |
category:(self defaultCategoryForDolphinClasses) |
|
299 |
classInstanceVariableNames:classInstanceVariableNames |
|
6823 | 300 |
|
301 |
"Modified: / 15.6.1998 / 21:31:34 / cg" |
|
302 |
"Modified: / 18.3.1999 / 18:16:11 / stefan" |
|
303 |
! ! |
|
304 |
||
7261 | 305 |
!Class methodsFor:'Compatibility-ST/V and V''Age'! |
6225 | 306 |
|
307 |
defaultCategoryForSTVorVAGEClasses |
|
308 |
|cat app| |
|
309 |
||
310 |
DefaultApplicationQuerySignal isHandled ifTrue:[ |
|
7368 | 311 |
app := DefaultApplicationQuerySignal query. |
312 |
app notNil ifTrue:[ |
|
313 |
cat := 'Applications-' , app name. |
|
314 |
] ifFalse:[ |
|
315 |
cat := DefaultCategoryForVAGE ? 'V''Age classes'. |
|
316 |
]. |
|
6225 | 317 |
] ifFalse:[ |
7368 | 318 |
cat := DefaultCategoryForSTV ? 'ST/V classes'. |
6225 | 319 |
]. |
320 |
||
321 |
^ cat |
|
322 |
! |
|
323 |
||
324 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s |
|
325 |
"{ Pragma: +optSpace }" |
|
326 |
||
327 |
"this method allows fileIn of ST/V and V'Age classes |
|
328 |
(which seem to have no category)" |
|
329 |
||
330 |
^ self subclass:t |
|
7368 | 331 |
instanceVariableNames:f |
332 |
classVariableNames:d |
|
333 |
poolDictionaries:s |
|
334 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 335 |
|
336 |
"Modified: / 15.6.1998 / 21:31:34 / cg" |
|
337 |
"Modified: / 18.3.1999 / 18:16:11 / stefan" |
|
338 |
! |
|
339 |
||
340 |
variableByteSubclass:t classVariableNames:d poolDictionaries:s |
|
341 |
"{ Pragma: +optSpace }" |
|
342 |
||
343 |
"this method allows fileIn of ST/V and V'Age variable byte classes |
|
344 |
(which seem to have no category and no instvars)" |
|
345 |
||
346 |
^ self variableByteSubclass:t |
|
7368 | 347 |
instanceVariableNames:'' |
348 |
classVariableNames:d |
|
349 |
poolDictionaries:s |
|
350 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 351 |
|
352 |
"Modified: / 15.6.1998 / 21:31:38 / cg" |
|
353 |
"Modified: / 18.3.1999 / 18:16:21 / stefan" |
|
354 |
! |
|
355 |
||
356 |
variableLongSubclass:t classVariableNames:d poolDictionaries:s |
|
357 |
"{ Pragma: +optSpace }" |
|
358 |
||
359 |
"this method allows fileIn of ST/V and V'Age variable long (32bit integers) classes |
|
360 |
(which seem to have no category and no instvars)" |
|
361 |
||
362 |
^ self variableLongSubclass:t |
|
7368 | 363 |
instanceVariableNames:'' |
364 |
classVariableNames:d |
|
365 |
poolDictionaries:s |
|
366 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 367 |
! |
368 |
||
369 |
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s |
|
370 |
"{ Pragma: +optSpace }" |
|
371 |
||
372 |
"this method allows fileIn of ST/V and V'Age variable pointer classes |
|
373 |
(which seem to have no category)" |
|
374 |
||
375 |
^ self variableSubclass:t |
|
7368 | 376 |
instanceVariableNames:f |
377 |
classVariableNames:d |
|
378 |
poolDictionaries:s |
|
379 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 380 |
|
381 |
"Modified: / 15.6.1998 / 21:31:41 / cg" |
|
382 |
"Modified: / 18.3.1999 / 18:16:33 / stefan" |
|
383 |
! |
|
384 |
||
385 |
variableWordSubclass:t classVariableNames:d poolDictionaries:s |
|
386 |
"{ Pragma: +optSpace }" |
|
387 |
||
388 |
"this method allows fileIn of ST/V and V'Age variable word (16bit integers) classes |
|
389 |
(which seem to have no category and no instvars)" |
|
390 |
||
391 |
^ self variableWordSubclass:t |
|
7368 | 392 |
instanceVariableNames:'' |
393 |
classVariableNames:d |
|
394 |
poolDictionaries:s |
|
395 |
category:(self defaultCategoryForSTVorVAGEClasses) |
|
6225 | 396 |
! ! |
397 |
||
7261 | 398 |
!Class methodsFor:'Compatibility-ST80'! |
5190 | 399 |
|
400 |
fileOutSourceOn:aStream |
|
401 |
self fileOutOn:aStream withTimeStamp:false |
|
402 |
||
403 |
"Created: 20.6.1997 / 17:18:14 / cg" |
|
404 |
"Modified: 20.6.1997 / 17:18:26 / cg" |
|
405 |
! |
|
406 |
||
6723 | 407 |
rename:newName |
408 |
"same as renameTo: - for ST80 compatibility" |
|
409 |
||
410 |
^ Smalltalk renameClass:self to:newName. |
|
411 |
"/ ^ self renameTo:newName |
|
412 |
||
413 |
"Created: / 18.6.1998 / 22:08:45 / cg" |
|
414 |
! ! |
|
415 |
||
7261 | 416 |
!Class methodsFor:'Compatibility-VW'! |
6136 | 417 |
|
5190 | 418 |
isVisualStartable |
419 |
"return true, if this is an application class, |
|
420 |
which can be started via #open" |
|
421 |
||
422 |
^ false |
|
423 |
||
424 |
"Created: / 27.10.1997 / 16:42:05 / cg" |
|
425 |
! ! |
|
426 |
||
1 | 427 |
!Class methodsFor:'accessing'! |
428 |
||
6731 | 429 |
addChangeRecordForClass:aClass andNotifyChangeOf:aspect |
430 |
"writes a change record and notifies dependents." |
|
431 |
||
432 |
|namespace| |
|
433 |
||
434 |
self addChangeRecordForClass:aClass. |
|
435 |
||
436 |
aClass changed:#definition. |
|
437 |
||
438 |
namespace := aClass nameSpace. |
|
439 |
namespace changed:#classDefinition with:aClass. |
|
440 |
namespace ~~ Smalltalk ifTrue:[ |
|
7368 | 441 |
Smalltalk changed:#classDefinition with:aClass. |
6731 | 442 |
]. |
443 |
namespace changed:aspect with:aClass. |
|
444 |
namespace ~~ Smalltalk ifTrue:[ |
|
7368 | 445 |
Smalltalk changed:aspect with:aClass. |
6731 | 446 |
]. |
447 |
! |
|
448 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
449 |
addClassVarName:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
450 |
"add a class variable if not already there and initialize it with nil. |
3220
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
451 |
Also writes a change record and notifies dependents." |
555 | 452 |
|
453 |
(self classVarNames includes:aString) ifFalse:[ |
|
7368 | 454 |
self classVariableString:(self classVariableString , ' ' , aString). |
455 |
Class withoutUpdatingChangesDo:[ |
|
456 |
self withAllSubclasses do:[:cls| |
|
457 |
cls recompileMethodsAccessingAnyClassvarOrGlobal: |
|
458 |
(Array with:aString asSymbol) |
|
459 |
]. |
|
460 |
]. |
|
461 |
self addChangeRecordForClass:self andNotifyChangeOf:#classVariables. |
|
555 | 462 |
] |
463 |
||
3220
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
464 |
"Created: / 29.10.1995 / 19:40:51 / cg" |
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
465 |
"Modified: / 23.1.1998 / 15:46:23 / stefan" |
555 | 466 |
! |
467 |
||
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
468 |
allPrivateClasses |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
469 |
"{ Pragma: +optSpace }" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
470 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
471 |
"return a collection of all private classes and private-private classes. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
472 |
The classes are in any order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
473 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
474 |
^ self privateClassesOrAll:true |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
475 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
476 |
! |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
477 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
478 |
category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
479 |
"return the category of the class. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
480 |
The returned value may be a string or symbol." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
481 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
482 |
|owner| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
483 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
484 |
(owner := self owningClass) notNil ifTrue:[^ owner category]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
485 |
^ category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
486 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
487 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
488 |
Point category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
489 |
Dictionary category |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
490 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
491 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
492 |
"Modified: 15.10.1996 / 21:20:01 / cg" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
493 |
"Created: 1.4.1997 / 15:23:47 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
494 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
495 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
496 |
category:aStringOrSymbol |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
497 |
"set the category of the class to be the argument, aStringOrSymbol" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
498 |
|
7579
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
499 |
|ns| |
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
500 |
|
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
501 |
self setCategory:aStringOrSymbol. |
7579
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
502 |
Project addChangeRecordForClass:self. |
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
503 |
ns := self nameSpace. |
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
504 |
ns changed:#organization. |
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
505 |
ns ~~ Smalltalk ifTrue:[ |
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
506 |
Smalltalk changed:#organization. |
272f62f6e2a1
send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents:
7517
diff
changeset
|
507 |
] |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
508 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
509 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
510 |
classFilename |
4744 | 511 |
"return the name of the file from which the class was compiled." |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
512 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
513 |
|owner| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
514 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
515 |
(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
|
516 |
^ classFilename |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
517 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
518 |
"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
|
519 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
520 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
521 |
classVarAt:aSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
522 |
"return the value of a class variable. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
523 |
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
|
524 |
this may change." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
525 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
526 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
527 |
this hides the (current) implementation of classVariables |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
528 |
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
|
529 |
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
|
530 |
no classPools yet. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
531 |
" |
6731 | 532 |
^ Smalltalk at:(self globalKeyForClassVar:aSymbol) |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
533 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
534 |
|
5707
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
535 |
classVarAt:aSymbol ifAbsent:exceptionBlock |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
536 |
"return the value of a class variable. |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
537 |
Currently, this returns nil if there is no such classvar - |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
538 |
this may change." |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
539 |
|
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
540 |
" |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
541 |
this hides the (current) implementation of classVariables |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
542 |
from the outside world. Currently, classvars are stored in |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
543 |
the Smalltalk dictionary with a funny name, since there are |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
544 |
no classPools yet. |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
545 |
" |
6731 | 546 |
^ Smalltalk at:(self globalKeyForClassVar:aSymbol) ifAbsent:exceptionBlock |
5707
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
547 |
! |
0b7652a19caf
change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents:
5703
diff
changeset
|
548 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
549 |
classVarAt:aSymbol put:something |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
550 |
"store something in a classvariable. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
551 |
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
|
552 |
classVar exists - this may change." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
553 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
554 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
555 |
this hides the (current) implementation of classVariables |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
556 |
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
|
557 |
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
|
558 |
no classPools yet. |
457
41c73cbee305
change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents:
453
diff
changeset
|
559 |
" |
6731 | 560 |
Smalltalk at:(self globalKeyForClassVar:aSymbol) put:something. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
561 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
562 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
563 |
classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
564 |
"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
|
565 |
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
|
566 |
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
|
567 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
568 |
classvars isNil ifTrue:[ |
7368 | 569 |
^ #() |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
570 |
]. |
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
571 |
classvars isString ifTrue:[ |
7368 | 572 |
classvars := classvars asCollectionOfWords asArray collect:[:varName| varName asSymbol]. |
573 |
^ classvars |
|
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
574 |
]. |
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
575 |
|
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
576 |
^ classvars |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
577 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
578 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
579 |
Object classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
580 |
Float classVarNames |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
581 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
582 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
583 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
584 |
classVariableString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
585 |
"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
|
586 |
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
|
587 |
returned string." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
588 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
589 |
classvars isNil ifTrue:[^ '']. |
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
590 |
classvars isString ifTrue:[ |
7368 | 591 |
^ classvars |
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
592 |
]. |
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
593 |
|
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
594 |
^ classvars asStringWith:(Character space) |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
595 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
596 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
597 |
Object classVariableString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
598 |
Float classVariableString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
599 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
600 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
601 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
602 |
classVariableString:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
603 |
"set the classes classvarnames string; |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
604 |
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
|
605 |
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
|
606 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
607 |
|prevVarNames varNames any| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
608 |
|
7517 | 609 |
(aString ~= self classVariableString) ifTrue:[ |
610 |
prevVarNames := self classVarNames asOrderedCollection. |
|
611 |
classvars := aString. |
|
612 |
varNames := self classVarNames. |
|
613 |
||
614 |
"new ones get initialized to nil; |
|
615 |
- old ones are nilled and removed from Smalltalk" |
|
616 |
any := false. |
|
617 |
||
618 |
varNames do:[:aName | |
|
619 |
(prevVarNames includes:aName) ifFalse:[ |
|
620 |
"a new one" |
|
621 |
self classVarAt:aName put:nil. |
|
622 |
any := true. |
|
623 |
] ifTrue:[ |
|
624 |
prevVarNames remove:aName |
|
625 |
] |
|
626 |
]. |
|
627 |
"left overs are gone" |
|
628 |
prevVarNames do:[:aName | |
|
629 |
self classVarAt:aName put:nil. |
|
630 |
Smalltalk removeKey:(self name , ':' , aName) asSymbol. |
|
631 |
]. |
|
632 |
any ifTrue:[ |
|
633 |
Smalltalk changed:#classVariables with:self |
|
634 |
]. |
|
453 | 635 |
] |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
636 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
637 |
"Modified: 2.4.1997 / 00:16:05 / stefan" |
453 | 638 |
! |
639 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
640 |
comment |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
641 |
"return the comment (aString) of the class" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
642 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
643 |
|stream string| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
644 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
645 |
"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
|
646 |
position within the classes sourcefile ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
647 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
648 |
comment isNumber ifTrue:[ |
7368 | 649 |
classFilename notNil ifTrue:[ |
650 |
stream := self sourceStream. |
|
651 |
stream notNil ifTrue:[ |
|
652 |
stream position1Based:comment. |
|
653 |
string := String readFrom:stream onError:''. |
|
654 |
stream close. |
|
655 |
^ string |
|
656 |
]. |
|
657 |
^ nil |
|
658 |
] |
|
557
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 |
^ comment |
555 | 661 |
|
662 |
" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
663 |
Object comment |
7054
685d359f9847
code rewritten to be independent of stream zero-base
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
664 |
RunArray comment |
555 | 665 |
" |
666 |
! |
|
667 |
||
7128 | 668 |
comment:aStringOrNil |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
669 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
670 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
671 |
"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
|
672 |
create a change record and notify dependents." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
673 |
|
865
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
674 |
|oldComment newComment| |
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
675 |
|
7128 | 676 |
newComment := aStringOrNil. |
677 |
(aStringOrNil notNil and:[aStringOrNil withoutSeparators isEmpty]) ifTrue:[ |
|
7368 | 678 |
newComment := nil |
865
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
679 |
]. |
0cfc2bd91232
clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents:
858
diff
changeset
|
680 |
comment ~= newComment ifTrue:[ |
7368 | 681 |
oldComment := self comment. |
682 |
comment := newComment. |
|
683 |
self addChangeRecordForClassComment:self. |
|
684 |
self changed:#comment with:oldComment. |
|
685 |
Smalltalk changed:#classComment with:self. |
|
555 | 686 |
] |
687 |
! |
|
688 |
||
2444 | 689 |
environment |
690 |
"return the namespace I am contained in; ST-80 compatible name" |
|
691 |
||
692 |
^ self nameSpace |
|
693 |
! |
|
694 |
||
6731 | 695 |
globalKeyForClassVar:aStringOrSymbol |
696 |
"this helps to encapsulate the (current) implementation of classVariables |
|
697 |
from the outside world. Currently, classvars are stored in |
|
698 |
the Smalltalk dictionary with a funny name, since there are |
|
699 |
no classPools yet. |
|
700 |
" |
|
701 |
^ (self name , ':' , aStringOrSymbol) asSymbol |
|
702 |
! |
|
703 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
704 |
name |
6657 | 705 |
"return the name of the class. |
706 |
This returns a symbol (but notice, that other smalltalks might return a string)." |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
707 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
708 |
^ name |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
709 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
710 |
"Created: 1.4.1997 / 15:24:32 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
711 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
712 |
|
1919 | 713 |
nameSpace |
2070
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
714 |
"return the namespace I am contained in; |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
715 |
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
|
716 |
for public classes, Smalltalk is returned." |
ddaa32666cc1
avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents:
2068
diff
changeset
|
717 |
|
7321 | 718 |
|idx nsName e| |
719 |
||
720 |
"/ cached in environment |
|
721 |
environment isNil ifTrue:[ |
|
7368 | 722 |
e := Smalltalk. "/ default |
723 |
||
724 |
"/ due to the implementation, extract this from my name |
|
725 |
"/ (physically, all classes are found in Smalltalk) |
|
726 |
||
727 |
idx := name lastIndexOf:$:. |
|
728 |
idx ~~ 0 ifTrue:[ |
|
729 |
(name at:idx-1) == $: ifTrue:[ |
|
730 |
nsName := name copyTo:(idx - 2). |
|
731 |
e := Smalltalk at:nsName asSymbol. |
|
732 |
] |
|
733 |
]. |
|
734 |
environment := e. |
|
1919 | 735 |
]. |
2493
ba34c6aac597
cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents:
2491
diff
changeset
|
736 |
^ environment |
ba34c6aac597
cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents:
2491
diff
changeset
|
737 |
|
3661 | 738 |
"Modified: / 20.7.1998 / 14:21:36 / cg" |
1919 | 739 |
! |
740 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
741 |
package |
3165
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
742 |
"return the package-id of the class" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
743 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
744 |
|owner| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
745 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
746 |
(owner := self owningClass) notNil ifTrue:[^ owner package]. |
5562 | 747 |
^ package ? '' |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
748 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
749 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
750 |
Object package |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
751 |
" |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
752 |
|
3951 | 753 |
"Modified: / 29.12.1998 / 01:15:50 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
754 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
755 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
756 |
package:aStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
757 |
"set the package of the class." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
758 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
759 |
package := aStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
760 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
761 |
|
4740 | 762 |
packageInfo |
763 |
"return the package-info of the class - or nil. |
|
764 |
The packageManager contains information relevant to the package, |
|
765 |
to which this class belongs - especially, things like pathes to |
|
766 |
resources, additional files etc. can be optioned this way. |
|
767 |
A packageInfo loosely relates to ehat a classLoader is in Java. |
|
768 |
Experimental." |
|
769 |
||
4742 | 770 |
|packageId prj handle t| |
4740 | 771 |
|
772 |
packageId := self package. |
|
773 |
packageId notNil ifTrue:[ |
|
7368 | 774 |
prj := Project projectWithId:packageId. |
775 |
prj notNil ifTrue:[^ prj]. |
|
776 |
||
777 |
"/ |
|
778 |
"/ intermediate kludge (will be removed) |
|
779 |
"/ search for a loaded class library and extract |
|
780 |
"/ information from it ... |
|
781 |
"/ |
|
782 |
handle := ObjectFileLoader loadedObjectHandles |
|
783 |
detect:[:h | |cls| |
|
784 |
cls := h classes firstIfEmpty:nil. |
|
785 |
cls notNil and:[cls package = packageId] |
|
786 |
] |
|
787 |
ifNone:nil. |
|
788 |
||
789 |
handle notNil ifTrue:[ |
|
790 |
prj := Project new. |
|
791 |
prj name:packageId. |
|
792 |
prj directory:(handle pathName asFilename directory pathName). |
|
793 |
prj package:packageId. |
|
794 |
t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'. |
|
795 |
prj repositoryModule:(t first). |
|
796 |
prj repositoryDirectory:(packageId copyFrom:t first size + 2). |
|
797 |
prj isLoaded:true. |
|
798 |
^ prj |
|
799 |
] |
|
4740 | 800 |
]. |
801 |
^ nil |
|
802 |
||
803 |
" |
|
804 |
Object packageInfo |
|
805 |
OSI::FTAMOperation packageInfo |
|
806 |
" |
|
807 |
! |
|
808 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
809 |
primitiveDefinitions:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
810 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
811 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
812 |
"set the primitiveDefinition string" |
555 | 813 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
814 |
(self isPrivate) ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
815 |
self error:'private classes cannot have their own primitiveDefinitions'. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
816 |
]. |
5800
a4386f928cf0
setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents:
5770
diff
changeset
|
817 |
self setPrimitiveDefinitions:aString. |
555 | 818 |
self addChangeRecordForPrimitiveDefinitions:self. |
819 |
||
820 |
"Created: 29.10.1995 / 19:41:39 / cg" |
|
821 |
! |
|
822 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
823 |
primitiveDefinitionsString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
824 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
825 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
826 |
"return the primitiveDefinition string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
827 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
828 |
|owner| |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
829 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
830 |
(owner := self owningClass) notNil ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
831 |
^ owner primitiveDefinitionsString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
832 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
833 |
^ self getSourceChunkAttribute:#primitiveDefinitions |
555 | 834 |
|
835 |
" |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
836 |
Object primitiveDefinitionsString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
837 |
String primitiveDefinitionsString |
555 | 838 |
" |
839 |
! |
|
840 |
||
5875 | 841 |
primitiveDefinitionsStringOrDefault |
842 |
"return the primitiveDefinition string or a default" |
|
843 |
||
844 |
^ self primitiveDefinitionsString ? '%{ |
|
845 |
||
846 |
/* |
|
847 |
* includes, defines, structure definitions |
|
848 |
* and typedefs come here. |
|
849 |
*/ |
|
850 |
||
851 |
%}' |
|
852 |
||
853 |
" |
|
854 |
Object primitiveDefinitionsStringOrDefault |
|
855 |
String primitiveDefinitionsStringOrDefault |
|
856 |
ExternalStream primitiveDefinitionsStringOrDefault |
|
857 |
" |
|
858 |
! |
|
859 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
860 |
primitiveFunctions:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
861 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
862 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
863 |
"set the primitiveFunction string" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
864 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
865 |
(self isPrivate) ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
866 |
self error:'private classes cannot have their own primitiveFunctions'. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
867 |
]. |
5800
a4386f928cf0
setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents:
5770
diff
changeset
|
868 |
self setPrimitiveFunctions:aString. |
555 | 869 |
self addChangeRecordForPrimitiveFunctions:self. |
870 |
||
871 |
"Created: 29.10.1995 / 19:41:48 / cg" |
|
872 |
! |
|
873 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
874 |
primitiveFunctionsString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
875 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
876 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
877 |
"return the primitiveFunctions string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
878 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
879 |
|owner| |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
880 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
881 |
(owner := self owningClass) notNil ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
882 |
^ owner primitiveFunctionsString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
883 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
884 |
^ self getSourceChunkAttribute:#primitiveFunctions |
557
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 |
|
5875 | 887 |
primitiveFunctionsStringOrDefault |
888 |
"return the primitiveFunction string or a default" |
|
889 |
||
890 |
^ self primitiveFunctionsString ? '%{ |
|
891 |
||
892 |
/* |
|
893 |
* any local C (helper) functions |
|
894 |
* come here (please, define as static) |
|
895 |
*/ |
|
896 |
||
897 |
%}' |
|
898 |
||
899 |
" |
|
900 |
Object primitiveFunctionsStringOrDefault |
|
901 |
String primitiveFunctionsStringOrDefault |
|
902 |
ExternalStream primitiveFunctionsStringOrDefault |
|
903 |
" |
|
904 |
! |
|
905 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
906 |
primitiveVariables:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
907 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
908 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
909 |
"set the primitiveVariable string" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
910 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
911 |
(self isPrivate) ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
912 |
self error:'private classes cannot have their own primitiveVariables'. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
913 |
]. |
5800
a4386f928cf0
setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents:
5770
diff
changeset
|
914 |
self setPrimitiveVariables:aString. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
915 |
self addChangeRecordForPrimitiveVariables:self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
916 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
917 |
"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
|
918 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
919 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
920 |
primitiveVariablesString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
921 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
922 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
923 |
"return the primitiveVariables string or nil" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
924 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
925 |
|owner| |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
926 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
927 |
(owner := self owningClass) notNil ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
928 |
^ owner primitiveVariablesString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
929 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
930 |
^ self getSourceChunkAttribute:#primitiveVariables |
555 | 931 |
! |
932 |
||
5875 | 933 |
primitiveVariablesStringOrDefault |
934 |
"return the primitiveVariable string or a default" |
|
935 |
||
936 |
^ self primitiveVariablesString ? '%{ |
|
937 |
||
938 |
/* |
|
939 |
* any local C variables |
|
940 |
* come here (please, define as static) |
|
941 |
*/ |
|
942 |
||
943 |
%}' |
|
944 |
||
945 |
" |
|
946 |
Object primitiveVariablesStringOrDefault |
|
947 |
String primitiveVariablesStringOrDefault |
|
948 |
ExternalStream primitiveVariablesStringOrDefault |
|
949 |
" |
|
950 |
! |
|
951 |
||
1739 | 952 |
privateClasses |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
953 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
954 |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
955 |
"return a collection of my private classes (if any). |
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
956 |
The classes are in any order." |
1739 | 957 |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
958 |
^ self privateClassesOrAll:false |
1739 | 959 |
|
960 |
" |
|
961 |
Object privateClasses |
|
2718
f7b5e3bffd78
sort privateClasses by name, to avoid undefined ordering
Claus Gittinger <cg@exept.de>
parents:
2712
diff
changeset
|
962 |
ObjectMemory privateClasses |
f7b5e3bffd78
sort privateClasses by name, to avoid undefined ordering
Claus Gittinger <cg@exept.de>
parents:
2712
diff
changeset
|
963 |
UILayoutTool privateClasses |
1739 | 964 |
" |
965 |
||
3495
31ae10035c74
skip obsolete leftover private classes when enumerating.
Claus Gittinger <cg@exept.de>
parents:
3494
diff
changeset
|
966 |
"Modified: / 29.5.1998 / 23:23:18 / cg" |
1739 | 967 |
! |
968 |
||
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
969 |
privateClassesAt:aClassNameStringOrSymbol |
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; nil otherwise" |
973 |
||
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
974 |
|nmSym| |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
975 |
|
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
976 |
nmSym := (self name , '::' , aClassNameStringOrSymbol) asSymbolIfInterned. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
977 |
nmSym isNil ifTrue:[ |
7368 | 978 |
"/ no such symbol - there cannot be a corresponding private class |
979 |
^ nil |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
980 |
]. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
981 |
|
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
982 |
^ Smalltalk at:nmSym. |
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
983 |
|
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
984 |
"Modified: 26.6.1997 / 11:44:04 / cg" |
1707 | 985 |
! |
986 |
||
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
987 |
privateClassesAt:aClassNameStringOrSymbol put:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
988 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
989 |
|
2719
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
990 |
"add a private class" |
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
991 |
|
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
992 |
self classVarAt:(':' , aClassNameStringOrSymbol) put:aClass |
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
993 |
|
92fb0f7eac26
oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents:
2718
diff
changeset
|
994 |
"Modified: 26.6.1997 / 11:44:12 / cg" |
1707 | 995 |
! |
996 |
||
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
997 |
privateClassesOrAll:allOfThem |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
998 |
"{ Pragma: +optSpace }" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
999 |
|
4495
4804e3e33d76
tuned #privateClasses access
Claus Gittinger <cg@exept.de>
parents:
4400
diff
changeset
|
1000 |
"return a collection of my direct private classes (if any) |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1001 |
or direct plus indirect private classes (if allOfThem). |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1002 |
An empty collection if there are none. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1003 |
The classes are in any order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1004 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1005 |
|classes myName myNamePrefix myNamePrefixLen| |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1006 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1007 |
myName := self name. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1008 |
myNamePrefix := myName , '::'. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1009 |
myNamePrefixLen := myNamePrefix size. |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1010 |
|
4575 | 1011 |
Smalltalk keysDo:[:nm | |
7368 | 1012 |
|cls| |
1013 |
||
1014 |
(nm startsWith:myNamePrefix) ifTrue:[ |
|
1015 |
(allOfThem |
|
1016 |
or:[(nm indexOf:$: startingAt:myNamePrefixLen + 1) == 0]) ifTrue:[ |
|
1017 |
cls := Smalltalk at:nm. |
|
1018 |
||
1019 |
(cls isBehavior and:[cls isMeta not]) ifTrue:[ |
|
1020 |
classes isNil ifTrue:[ |
|
1021 |
classes := Set new:10. |
|
1022 |
]. |
|
1023 |
classes add:cls. |
|
1024 |
] |
|
1025 |
] |
|
1026 |
] |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1027 |
]. |
4575 | 1028 |
|
4578 | 1029 |
^ classes ? #() |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1030 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1031 |
" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1032 |
UILayoutTool privateClassesOrAll:true |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1033 |
UILayoutTool privateClassesOrAll:false |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1034 |
" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1035 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1036 |
"Modified: / 29.5.1998 / 23:23:18 / cg" |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1037 |
! |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1038 |
|
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1039 |
privateClassesSorted |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1040 |
"{ Pragma: +optSpace }" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1041 |
|
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1042 |
"return a collection of my private classes (if any). |
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1043 |
The classes are sorted by inheritance." |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1044 |
|
7894 | 1045 |
|classes pivateClassesOf| |
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1046 |
|
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1047 |
classes := self privateClasses. |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1048 |
(classes size > 0) ifTrue:[ |
7894 | 1049 |
classes := classes asOrderedCollection. |
1050 |
classes sort:[:a :b | a name < b name]. |
|
1051 |
||
1052 |
pivateClassesOf := IdentityDictionary new. |
|
1053 |
classes do:[:each | pivateClassesOf at:each put:(each allPrivateClasses)]. |
|
1054 |
||
1055 |
classes topologicalSort:[:a :b | |
|
1056 |
"/ a must come before b iff: |
|
1057 |
"/ b is a subclass of a |
|
1058 |
"/ b has a private class which is a subclass of a |
|
7084
e53302e0134b
oops - must also sort private classes according
Claus Gittinger <cg@exept.de>
parents:
7054
diff
changeset
|
1059 |
|
7894 | 1060 |
|mustComeBefore pivateClassesOfB| |
1061 |
||
1062 |
mustComeBefore := b isSubclassOf:a. |
|
1063 |
||
1064 |
pivateClassesOfB := pivateClassesOf at:b. |
|
1065 |
pivateClassesOfB do:[:eachClassInB | |
|
1066 |
mustComeBefore := mustComeBefore or:[eachClassInB isSubclassOf:a] |
|
1067 |
]. |
|
1068 |
mustComeBefore |
|
1069 |
]. |
|
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1070 |
]. |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1071 |
^ classes. |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1072 |
|
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1073 |
" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1074 |
Object privateClassesSorted |
5731 | 1075 |
NewSystemBrowser privateClassesSorted |
1076 |
NewSystemBrowser privateClasses |
|
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1077 |
" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1078 |
|
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1079 |
"Created: 22.3.1997 / 16:10:42 / cg" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1080 |
"Modified: 22.3.1997 / 16:11:20 / cg" |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1081 |
! |
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1082 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1083 |
removeClassVarName:aString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1084 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1085 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1086 |
"remove a class variable if not already there. |
5635
036069e1b8f7
change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents:
5614
diff
changeset
|
1087 |
Also writes a change record and notifies dependents." |
036069e1b8f7
change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents:
5614
diff
changeset
|
1088 |
|
6731 | 1089 |
|names newNames| |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1090 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1091 |
names := self classVarNames. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1092 |
(names includes:aString) ifTrue:[ |
7368 | 1093 |
newNames := ''. |
1094 |
names do:[:nm | nm ~= aString ifTrue:[newNames := newNames , nm , ' ']]. |
|
1095 |
self classVariableString:newNames withoutSpaces. |
|
1096 |
Class withoutUpdatingChangesDo:[ |
|
1097 |
self withAllSubclasses do:[:cls| |
|
1098 |
cls recompileMethodsAccessingAnyClassvarOrGlobal: |
|
1099 |
(Array with:aString asSymbol) |
|
1100 |
]. |
|
1101 |
]. |
|
1102 |
self addChangeRecordForClass:self andNotifyChangeOf:#classVariables. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1103 |
] |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1104 |
|
3220
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
1105 |
"Created: / 29.10.1995 / 19:42:08 / cg" |
923707e8d156
Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents:
3180
diff
changeset
|
1106 |
"Modified: / 23.1.1998 / 15:46:33 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1107 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1108 |
|
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1109 |
setCategory:aStringOrSymbol |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1110 |
"set the category of the class to be the argument, aStringOrSymbol" |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1111 |
|
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1112 |
aStringOrSymbol isNil ifTrue:[ |
7368 | 1113 |
category := aStringOrSymbol |
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1114 |
] ifFalse:[ |
7368 | 1115 |
category := aStringOrSymbol asSymbol |
5723
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1116 |
] |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1117 |
|
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1118 |
"Created: 1.4.1997 / 15:24:04 / stefan" |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1119 |
! |
af77f8b753cb
methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents:
5715
diff
changeset
|
1120 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1121 |
setClassFilename:aFilename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1122 |
"set the classes filename. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1123 |
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
|
1124 |
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
|
1125 |
is set here." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1126 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1127 |
classFilename := aFilename |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1128 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1129 |
"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
|
1130 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1131 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1132 |
setClassVariableString:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1133 |
"set the classes classvarnames string. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1134 |
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
|
1135 |
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
|
1136 |
NO change record is written." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1137 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1138 |
classvars := aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1139 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1140 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1141 |
setComment:aString |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1142 |
"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
|
1143 |
do NOT create a change record" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1144 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1145 |
comment := aString |
1 | 1146 |
! |
1147 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1148 |
setComment:com category:categoryStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1149 |
"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
|
1150 |
do NOT create a change record" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1151 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1152 |
|cat| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1153 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1154 |
comment := com. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1155 |
categoryStringOrSymbol isNil ifTrue:[ |
7368 | 1156 |
cat := '' |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1157 |
] ifFalse:[ |
7368 | 1158 |
cat := categoryStringOrSymbol |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1159 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1160 |
category := cat asSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1161 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1162 |
|
5248 | 1163 |
setEnvironment:aNamespace |
1164 |
"set the namespace I am contained in; ST-80 compatible name" |
|
1165 |
||
1166 |
environment := aNamespace |
|
1167 |
! |
|
1168 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1169 |
setPackage:aStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1170 |
"set the package of the class." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1171 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1172 |
package := aStringOrSymbol |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1173 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1174 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1175 |
source |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1176 |
"return the classes full source code" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1177 |
|
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
1178 |
|code aStream tmpFile| |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1179 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1180 |
" this is too slow for big classes ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1181 |
code := String new:1000. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1182 |
aStream := WriteStream on:code. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1183 |
self fileOutOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1184 |
" |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
1185 |
tmpFile := '__temp' asFilename. |
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
1186 |
[ |
7368 | 1187 |
aStream := tmpFile newReadWriteStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
1188 |
] on:FileStream openErrorSignal do:[:ex| |
7368 | 1189 |
self warn:'cannot create temporary file.'. |
1190 |
^ nil |
|
555 | 1191 |
]. |
1192 |
FileOutErrorSignal handle:[:ex | |
|
7368 | 1193 |
aStream nextPutAll:'"no source available"'. |
555 | 1194 |
] do:[ |
7368 | 1195 |
self fileOutOn:aStream. |
555 | 1196 |
]. |
1197 |
aStream close. |
|
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
1198 |
aStream := tmpFile readStreamOrNil. |
555 | 1199 |
aStream isNil ifTrue:[ |
7368 | 1200 |
self warn:'oops - cannot reopen temp file'. |
1201 |
^ nil |
|
555 | 1202 |
]. |
1203 |
code := aStream contents. |
|
1204 |
aStream close. |
|
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
1205 |
tmpFile remove. |
555 | 1206 |
^ code |
385 | 1207 |
! |
1208 |
||
689
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1209 |
sourceCodeManager |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1210 |
"return my source code manager. |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1211 |
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
|
1212 |
But future versions may support mixed reporitories" |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1213 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1214 |
|owner| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1215 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
1216 |
(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
|
1217 |
^ Smalltalk at:#SourceCodeManager |
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1218 |
|
d8f2044c6634
access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents:
686
diff
changeset
|
1219 |
"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
|
1220 |
"Modified: 15.10.1996 / 18:54:02 / cg" |
1 | 1221 |
! ! |
1222 |
||
5257 | 1223 |
!Class methodsFor:'adding & removing'! |
1 | 1224 |
|
2036
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1225 |
removeFromSystem |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1226 |
"ST-80 compatibility |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1227 |
remove myself from the system" |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1228 |
|
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1229 |
^ Smalltalk removeClass:self |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1230 |
|
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1231 |
"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
|
1232 |
! |
bedc0bb03129
changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
1233 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1234 |
unload |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1235 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1236 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1237 |
"if the receiver was autoloaded, unload and reinstall it as |
293 | 1238 |
autoloaded. Can be used to get rid of no longer needed autoloaded |
328 | 1239 |
classes. |
1240 |
(maybe, autoloaded classes should unload themselfes when no |
|
1241 |
longer needed - for example, after some delay when the last instance |
|
1242 |
is gone ...)" |
|
293 | 1243 |
|
4052 | 1244 |
|nm newClass| |
293 | 1245 |
|
216 | 1246 |
self wasAutoloaded ifFalse:[ |
7833 | 1247 |
" |
1248 |
can it be done ? |
|
1249 |
(all of my methods must have a source) |
|
1250 |
" |
|
1251 |
self instAndClassSelectorsAndMethodsDo:[:sel :aMethod | |
|
1252 |
aMethod source isNil ifTrue:[^false]. |
|
1253 |
aMethod hasPrimitiveCode ifTrue:[^ false]. |
|
1254 |
]. |
|
216 | 1255 |
]. |
1256 |
||
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1257 |
"/ cannot unload, if non-autoloaded subclasses exist ... |
283 | 1258 |
self allSubclassesDo:[:aClass | |
7833 | 1259 |
aClass wasAutoloaded ifFalse:[ |
1260 |
aClass isPrivate ifFalse:[ |
|
1261 |
self warn:('cannot unload ' , self name , ' (' , aClass name , ' requires it)'). |
|
1262 |
^ false. |
|
1263 |
] |
|
1264 |
] |
|
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1265 |
]. |
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1266 |
|
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1267 |
self allSubclassesDo:[:aClass | |
7833 | 1268 |
aClass wasAutoloaded ifTrue:[ |
1269 |
aClass unload |
|
1270 |
] ifFalse:[ |
|
1271 |
aClass removeFromSystem. |
|
1272 |
] |
|
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1273 |
]. |
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1274 |
self privateClasses do:[:aClass | |
7833 | 1275 |
aClass removeFromSystem. |
283 | 1276 |
]. |
1415 | 1277 |
Transcript showCR:'unloading ' , name , ' ...'. |
283 | 1278 |
|
5474
c7c69123fd48
care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents:
5464
diff
changeset
|
1279 |
"/ reinstall as autoloaded |
359 | 1280 |
Autoload removeClass:self. |
293 | 1281 |
nm := name. |
1282 |
Smalltalk at:nm put:nil. |
|
288 | 1283 |
ObjectMemory flushInlineCaches. |
1284 |
ObjectMemory flushMethodCache. |
|
4052 | 1285 |
newClass := Autoload addClass:nm inCategory:category. |
1286 |
newClass notNil ifTrue:[ |
|
7833 | 1287 |
newClass package:package |
4052 | 1288 |
]. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1289 |
Smalltalk flushCachedClasses. |
216 | 1290 |
^ true |
1291 |
||
1292 |
" |
|
1293 |
Clock open. |
|
1294 |
Clock unload. |
|
1295 |
ClockView unload. |
|
1296 |
Clock open |
|
1297 |
" |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1298 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1299 |
"Modified: 7.6.1996 / 09:15:05 / stefan" |
2675
bb724aff9c75
stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents:
2671
diff
changeset
|
1300 |
"Modified: 4.6.1997 / 14:48:02 / cg" |
1 | 1301 |
! ! |
1302 |
||
453 | 1303 |
!Class methodsFor:'binary storage'! |
1304 |
||
2477 | 1305 |
addGlobalsForBinaryStorageTo:globalDictionary |
453 | 1306 |
" |
1307 |
classPool == nil ifFalse: [ |
|
7368 | 1308 |
classPool associationsDo: [:assoc| |
1309 |
globalDictionary at: assoc put: self |
|
1310 |
] |
|
453 | 1311 |
] |
1312 |
" |
|
2477 | 1313 |
|
1314 |
"Created: 21.3.1997 / 15:40:45 / cg" |
|
453 | 1315 |
! |
1316 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1317 |
binaryClassDefinitionFrom:stream manager:manager |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1318 |
"retrieve a class as stored previously with |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1319 |
#storeBinaryClassOn:manager: |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1320 |
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
|
1321 |
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
|
1322 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1323 |
|superclassName name flags instvars classvars category classInstVars |
1756 | 1324 |
comment package superclassSig rev |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1325 |
newClass superClass methods cmethods formatID environment |
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1326 |
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
|
1327 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1328 |
"/ 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
|
1329 |
"/ the storing in #storeBinaryClassOn:manager: |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1330 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1331 |
"/ retrieve |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1332 |
"/ formatID |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1333 |
"/ superclasses name, |
944
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1334 |
"/ superclasses signature |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1335 |
"/ name, |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1336 |
"/ typeSymbol, |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1337 |
"/ instVarNames |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1338 |
"/ classVarNames |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1339 |
"/ category |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1340 |
"/ classInstVarNames |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1341 |
"/ comment |
1756 | 1342 |
"/ revision |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1343 |
"/ package |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1344 |
"/ name of owner, or nil |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1345 |
"/ classes methodDictionary |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1346 |
"/ methodDictionary |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1347 |
"/ number of private classes |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1348 |
"/ private classes, if any |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1349 |
|
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1350 |
formatID := manager nextObject. |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1351 |
formatID isInteger ifFalse:[ "/ backward compatibilty |
7368 | 1352 |
formatID := nil. |
1353 |
superclassName := formatID |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1354 |
] ifTrue:[ |
7368 | 1355 |
superclassName := manager nextObject. |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1356 |
]. |
944
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1357 |
superclassSig := manager nextObject. |
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1358 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1359 |
superclassName notNil ifTrue:[ |
7368 | 1360 |
superClass := Smalltalk at:superclassName ifAbsent:nil. |
1361 |
||
1362 |
superClass isNil ifTrue:[ |
|
1363 |
BinaryIOManager nonexistingClassSignal |
|
1364 |
raiseRequestWith:'non existent superclass (in binaryLoad)'. |
|
1365 |
^ nil |
|
1366 |
]. |
|
1367 |
||
1368 |
"/ ('loading superclass: ' , superclassName ) printNL. |
|
1369 |
superClass autoload. |
|
1370 |
superClass := Smalltalk at:superclassName. |
|
1371 |
||
1372 |
superclassSig ~= superClass signature ifTrue:[ |
|
1373 |
BinaryIOManager changedInstLayoutSignal |
|
1374 |
raiseRequestWith:'incompatible superclass (in binaryLoad)'. |
|
1375 |
^ nil |
|
1376 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1377 |
]. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1378 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1379 |
name := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1380 |
flags := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1381 |
instvars := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1382 |
instvars isNil ifTrue:[instvars := '']. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1383 |
classvars := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1384 |
classvars isNil ifTrue:[classvars := '']. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1385 |
category := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1386 |
classInstVars := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1387 |
classInstVars isNil ifTrue:[classInstVars := '']. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1388 |
comment := manager nextObject. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1389 |
package := manager nextObject. |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1390 |
formatID == 1 ifTrue:[ |
7368 | 1391 |
rev := manager nextObject. |
1392 |
ownerName := manager nextObject. |
|
1393 |
ownerName notNil ifTrue:[ |
|
1394 |
name := name copyFrom:(ownerName size + 2 + 1). |
|
1395 |
owner := Smalltalk at:ownerName. |
|
1396 |
] |
|
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1397 |
]. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1398 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1399 |
"/ 'got superName:' print. superclassName printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1400 |
"/ 'got name:' print. name printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1401 |
"/ 'got flags: ' print. flags printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1402 |
"/ 'got instvars: ' print. instvars printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1403 |
"/ 'got classvars: ' print. classvars printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1404 |
"/ 'got category: ' print. category printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1405 |
"/ 'got classInstvars: ' print. classInstVars printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1406 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1407 |
"/ ('create class: ' , name ) printNL. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1408 |
|
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1409 |
owner notNil ifTrue:[ |
7368 | 1410 |
environment := owner |
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1411 |
] ifFalse:[ |
7368 | 1412 |
environment := Class nameSpaceQuerySignal query. |
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1413 |
]. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1414 |
|
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1415 |
cls := superClass. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1416 |
superClass isNil ifTrue:[ |
7368 | 1417 |
cls := Object |
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1418 |
]. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1419 |
|
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1420 |
newClass := cls class |
7368 | 1421 |
name:name asSymbol |
1422 |
inEnvironment:environment |
|
1423 |
subclassOf:cls |
|
1424 |
instanceVariableNames:instvars |
|
1425 |
variable:false |
|
1426 |
words:false |
|
1427 |
pointers:true |
|
1428 |
classVariableNames:classvars |
|
1429 |
poolDictionaries:'' |
|
1430 |
category:category |
|
1431 |
comment:comment |
|
1432 |
changed:false |
|
1433 |
classInstanceVariableNames:classInstVars. |
|
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1434 |
|
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1435 |
newClass isNil ifTrue:[ |
7368 | 1436 |
^ nil. |
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1437 |
]. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1438 |
|
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1439 |
superClass isNil ifTrue:[ |
7368 | 1440 |
newClass setSuperclass:nil. |
1441 |
newClass class setSuperclass:Class. |
|
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1442 |
]. |
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1443 |
|
1759 | 1444 |
"/ Transcript showCR:'loaded ' , name , ' in ' , environment name. |
1445 |
||
1802
f9148cfae747
handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents:
1786
diff
changeset
|
1446 |
newClass flags:flags. |
453 | 1447 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1448 |
"/ retrieve class methods |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1449 |
cmethods := MethodDictionary binaryFullDefinitionFrom:stream manager:manager. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1450 |
"/ retrieve inst methods |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1451 |
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
|
1452 |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1453 |
formatID == 1 ifTrue:[ |
7368 | 1454 |
"/ privateClasses |
1455 |
nPrivate := manager nextObject. |
|
1456 |
nPrivate timesRepeat:[ |
|
1457 |
Class nameSpaceQuerySignal |
|
1458 |
answer:newClass |
|
1459 |
do:[ |
|
1460 |
privateClass := manager nextObject |
|
1461 |
] |
|
1462 |
] |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1463 |
]. |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1464 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1465 |
(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
|
1466 |
newClass isNil ifTrue:[ |
7368 | 1467 |
^ nil |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1468 |
]. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1469 |
|
1756 | 1470 |
owner notNil ifTrue:[ |
7368 | 1471 |
newClass setCategory:nil. |
1756 | 1472 |
] ifFalse:[ |
7368 | 1473 |
newClass setPackage:package. |
1756 | 1474 |
]. |
6077
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
1475 |
newClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | mthd setPackage:package]. |
1756 | 1476 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1477 |
newClass methodDictionary:methods. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1478 |
newClass class methodDictionary:cmethods. |
3951 | 1479 |
|
1480 |
newClass initializeWithAllPrivateClasses. |
|
1481 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1482 |
^ newClass |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1483 |
|
3951 | 1484 |
"Created: / 8.10.1996 / 17:57:02 / cg" |
1485 |
"Modified: / 16.2.1999 / 10:09:22 / cg" |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1486 |
"Modified: / 18.3.1999 / 18:15:58 / stefan" |
872 | 1487 |
! |
1488 |
||
1489 |
storeBinaryClassOn:stream manager:manager |
|
1490 |
"store a classes complete description (i.e. including methods). |
|
1491 |
However, the superclass chain is not stored - at load time, that must |
|
1492 |
be either present or autoloadable." |
|
1493 |
||
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
1494 |
|s sig owner superclass privateClasses nPrivate| |
872 | 1495 |
|
1496 |
stream nextPut: manager codeForClass. |
|
1497 |
||
1498 |
"/ the following order must correlate to |
|
1499 |
"/ the storing in #binaryDefinitionFrom:manager: |
|
1500 |
||
1501 |
"/ store |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1502 |
"/ format ID |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1503 |
"/ superclasses name |
944
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1504 |
"/ superclasses signature |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1505 |
"/ name |
872 | 1506 |
"/ typeSymbol, |
1507 |
"/ instVarNames |
|
1508 |
"/ classVarNames |
|
1509 |
"/ category |
|
1510 |
"/ classInstVarNames |
|
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1511 |
"/ comment |
902
2e1c740a255f
also store the package in binaryClassStore
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1512 |
"/ package |
1756 | 1513 |
"/ revision |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1514 |
"/ name of owner, or nil |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1515 |
"/ classes methodDictionary |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1516 |
"/ methodDictionary |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1517 |
"/ # of privateClass names |
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1518 |
"/ privateClasses, if any |
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1519 |
|
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1520 |
1 storeBinaryOn:stream manager:manager. "/ formatID |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1521 |
|
1756 | 1522 |
owner := self owningClass. |
1523 |
||
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
1524 |
superclass := self superclass. |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1525 |
superclass isNil ifTrue:[ |
7368 | 1526 |
s := nil. |
1527 |
sig := 0. |
|
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1528 |
] ifFalse:[ |
7368 | 1529 |
s := superclass name. |
1530 |
sig := superclass signature. |
|
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1531 |
]. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1532 |
s storeBinaryOn:stream manager:manager. |
944
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1533 |
sig storeBinaryOn:stream manager:manager. |
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1534 |
|
872 | 1535 |
name storeBinaryOn:stream manager:manager. |
1536 |
flags storeBinaryOn:stream manager:manager. |
|
3951 | 1537 |
(instvars isNil or:[instvars isEmpty]) ifTrue:[ |
7368 | 1538 |
s := nil |
872 | 1539 |
] ifFalse:[ |
7368 | 1540 |
s := self instanceVariableString |
872 | 1541 |
]. |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1542 |
s storeBinaryOn:stream manager:manager. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1543 |
|
5514
0db3f902e1df
keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents:
5474
diff
changeset
|
1544 |
(classvars isNil or:[classvars isEmpty]) ifTrue:[ |
7368 | 1545 |
s := nil |
872 | 1546 |
] ifFalse:[ |
7368 | 1547 |
s := self classVariableString |
872 | 1548 |
]. |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1549 |
s storeBinaryOn:stream manager:manager. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1550 |
|
1756 | 1551 |
"/ the category |
1552 |
owner notNil ifTrue:[ |
|
7368 | 1553 |
nil storeBinaryOn:stream manager:manager. |
1756 | 1554 |
] ifFalse:[ |
7368 | 1555 |
category storeBinaryOn:stream manager:manager. |
1759 | 1556 |
]. |
1557 |
||
1558 |
"/ the classInstVarString |
|
1559 |
s := self class instanceVariableString. |
|
1560 |
(s notNil and:[s isEmpty]) ifTrue:[ |
|
7368 | 1561 |
s := nil |
872 | 1562 |
]. |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1563 |
s storeBinaryOn:stream manager:manager. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1564 |
|
1756 | 1565 |
"/ the comment |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1566 |
s := comment. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1567 |
manager sourceMode == #discard ifTrue:[ |
7368 | 1568 |
s := nil |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1569 |
]. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1570 |
s storeBinaryOn:stream manager:manager. |
1756 | 1571 |
|
1572 |
"/ the revision, package & owner |
|
1573 |
owner notNil ifTrue:[ |
|
7368 | 1574 |
nil storeBinaryOn:stream manager:manager. |
1575 |
nil storeBinaryOn:stream manager:manager. |
|
1576 |
owner name storeBinaryOn:stream manager:manager. |
|
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1577 |
] ifFalse:[ |
7368 | 1578 |
package storeBinaryOn:stream manager:manager. |
1579 |
revision storeBinaryOn:stream manager:manager. |
|
1580 |
nil storeBinaryOn:stream manager:manager. |
|
1748
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1581 |
]. |
5cb3ceffa216
more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents:
1747
diff
changeset
|
1582 |
|
944
841e99b1a73a
check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1583 |
"/ |
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1584 |
"/ store class method dictionary and methods |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1585 |
"/ |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1586 |
self class methodDictionary storeFullBinaryDefinitionOn:stream manager:manager. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1587 |
"/ store inst method dictionary and methods |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1588 |
self methodDictionary storeFullBinaryDefinitionOn:stream manager:manager. |
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
1589 |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1590 |
"/ |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1591 |
"/ names of private classes |
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1592 |
"/ |
2484
05bd2cc43192
#privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents:
2482
diff
changeset
|
1593 |
privateClasses := self privateClassesSorted. |
4022 | 1594 |
(nPrivate := privateClasses size) storeBinaryOn:stream manager:manager. |
1595 |
nPrivate > 0 ifTrue:[ |
|
7368 | 1596 |
privateClasses do:[:aClass | |
1597 |
aClass storeBinaryClassOn:stream manager:manager |
|
1598 |
] |
|
1747
e6323406510c
added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents:
1746
diff
changeset
|
1599 |
]. |
872 | 1600 |
|
1601 |
" |
|
1602 |
|bos| |
|
1603 |
||
1604 |
bos := BinaryObjectStorage onNew: (Filename named: 'FBrowser.cls') writeStream. |
|
1605 |
bos nextPutClasses:(Array with:FileBrowser). |
|
1606 |
bos close. |
|
1607 |
" |
|
1608 |
" |
|
1609 |
|bos cls| |
|
1610 |
||
1611 |
bos := BinaryObjectStorage onOld: (Filename named: 'FBrowser.cls') readStream. |
|
1612 |
cls := bos next. |
|
1613 |
bos close. |
|
1614 |
cls open. |
|
1615 |
" |
|
1616 |
||
3788
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
1617 |
"Modified: / 7.6.1996 / 13:39:02 / stefan" |
3951 | 1618 |
"Modified: / 16.2.1999 / 07:07:00 / cg" |
872 | 1619 |
! |
1620 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1621 |
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
|
1622 |
"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
|
1623 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1624 |
| string | |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1625 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1626 |
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
|
1627 |
stream nextNumber: 2 put: string size. |
2463
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1628 |
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
|
1629 |
"/ string do: [:char| stream nextPut: char asciiValue] |
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1630 |
|
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1631 |
"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
|
1632 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1633 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1634 |
storeBinaryDefinitionOn: stream manager: manager |
1259 | 1635 |
"store the receiver in a binary format on stream. |
1636 |
This is an internal interface for binary storage mechanism. |
|
1637 |
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
|
1638 |
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
|
1639 |
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
|
1640 |
restore time. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1641 |
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
|
1642 |
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
|
1643 |
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
|
1644 |
(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
|
1645 |
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
|
1646 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1647 |
|varnames n sz| |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1648 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1649 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1650 |
output the signature |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1651 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1652 |
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
|
1653 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1654 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1655 |
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
|
1656 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1657 |
varnames := self allInstVarNames. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1658 |
n := varnames size. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1659 |
n == 0 ifTrue:[ |
8102
e0537422e2d3
Use the ANSI-blessed #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
8085
diff
changeset
|
1660 |
sz := 0 |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1661 |
] ifFalse:[ |
8102
e0537422e2d3
Use the ANSI-blessed #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
8085
diff
changeset
|
1662 |
sz := varnames inject:0 into:[:sum :nm | sum + nm size]. |
e0537422e2d3
Use the ANSI-blessed #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
8085
diff
changeset
|
1663 |
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
|
1664 |
]. |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1665 |
stream nextNumber:2 put:sz. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1666 |
varnames keysAndValuesDo:[:i :nm | |
8102
e0537422e2d3
Use the ANSI-blessed #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
8085
diff
changeset
|
1667 |
stream nextPutBytes:(nm size) from:nm startingAt:1. |
2463
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1668 |
"/ nm do:[:c | |
8102
e0537422e2d3
Use the ANSI-blessed #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
8085
diff
changeset
|
1669 |
"/ stream nextPut:c codePoint |
2463
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1670 |
"/ ]. |
8102
e0537422e2d3
Use the ANSI-blessed #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
8085
diff
changeset
|
1671 |
i ~~ n ifTrue:[stream nextPut:(Character space codePoint)] |
900
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1672 |
]. |
138ea0c188ee
also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
1673 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1674 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1675 |
output my name |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1676 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1677 |
stream nextNumber:2 put:name size. |
2463
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1678 |
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
|
1679 |
"/ name do:[:c| |
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1680 |
"/ stream nextPut:c asciiValue |
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1681 |
"/ ] |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1682 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1683 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1684 |
|s| |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1685 |
s := WriteStream on:ByteArray new. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1686 |
Rectangle storeBinaryOn:s. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1687 |
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
|
1688 |
" |
1259 | 1689 |
|
2463
b0937b570306
save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
1690 |
"Modified: 19.3.1997 / 18:47:10 / cg" |
453 | 1691 |
! ! |
1692 |
||
1 | 1693 |
!Class methodsFor:'changes management'! |
1694 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1695 |
addChangeRecordForChangeCategory |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1696 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1697 |
|
6097 | 1698 |
"add a category change" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1699 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1700 |
Class updateChangeFileQuerySignal query ifTrue:[ |
7368 | 1701 |
self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category. |
6097 | 1702 |
]. |
1703 |
||
1704 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1705 |
Project notNil ifTrue:[ |
|
7368 | 1706 |
UpdateChangeListQuerySignal query ifTrue:[ |
1707 |
Project addClassDefinitionChangeFor:self |
|
1708 |
] |
|
2256 | 1709 |
] |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1710 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1711 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1712 |
addChangeRecordForClass:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1713 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1714 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1715 |
"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
|
1716 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1717 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1718 |
self writingChangePerform:#addChangeRecordForClass:to: with:aClass. |
6166 | 1719 |
]. |
1720 |
||
1721 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1722 |
Project notNil ifTrue:[ |
|
7368 | 1723 |
UpdateChangeListQuerySignal query ifTrue:[ |
1724 |
Project addClassDefinitionChangeFor:aClass |
|
1725 |
] |
|
2256 | 1726 |
] |
1727 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1728 |
"Modified: / 24.1.1997 / 19:09:41 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1729 |
"Modified: / 18.3.1999 / 18:14:04 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1730 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1731 |
|
620 | 1732 |
addChangeRecordForClassCheckIn:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1733 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1734 |
|
620 | 1735 |
"append a class-was-checkedIn-record to the changes file" |
1736 |
||
1938 | 1737 |
|rv| |
1738 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1739 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1740 |
rv := aClass revision. |
1741 |
rv isNil ifTrue:[rv := '???']. |
|
1742 |
||
1743 |
self |
|
1744 |
writingChangeWithTimeStamp:false |
|
1745 |
perform:#addInfoRecord:to: |
|
1746 |
with:('checkin ' , aClass name , ' (' , rv , ')'). |
|
2256 | 1747 |
] |
620 | 1748 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1749 |
"Created: / 18.11.1995 / 17:04:58 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1750 |
"Modified: / 24.1.1997 / 19:11:55 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1751 |
"Modified: / 18.3.1999 / 18:14:14 / stefan" |
620 | 1752 |
! |
1753 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1754 |
addChangeRecordForClassComment:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1755 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1756 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1757 |
"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
|
1758 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1759 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1760 |
self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass. |
6166 | 1761 |
]. |
1762 |
||
1763 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1764 |
Project notNil ifTrue:[ |
|
7368 | 1765 |
UpdateChangeListQuerySignal query ifTrue:[ |
1766 |
Project addClassCommentChangeFor:aClass |
|
1767 |
] |
|
2256 | 1768 |
] |
1769 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1770 |
"Modified: / 24.1.1997 / 19:09:59 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1771 |
"Modified: / 18.3.1999 / 18:14:23 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1772 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1773 |
|
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1774 |
addChangeRecordForClassContainerRemove:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1775 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1776 |
|
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1777 |
"append a container-was-removed-record to the changes file" |
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1778 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1779 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1780 |
self |
1781 |
writingChangeWithTimeStamp:false |
|
1782 |
perform:#addInfoRecord:to: |
|
1783 |
with:('removed source container of ' , aClass name). |
|
2256 | 1784 |
] |
1785 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1786 |
"Created: / 11.9.1996 / 15:37:19 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1787 |
"Modified: / 24.1.1997 / 19:12:05 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1788 |
"Modified: / 18.3.1999 / 18:14:31 / stefan" |
1658
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1789 |
! |
5b68e6cd567a
added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents:
1651
diff
changeset
|
1790 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1791 |
addChangeRecordForClassFileOut:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1792 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1793 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1794 |
"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
|
1795 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1796 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1797 |
self |
1798 |
writingChangeWithTimeStamp:false |
|
1799 |
perform:#addInfoRecord:to: |
|
1800 |
with:('fileOut ' , aClass name). |
|
2256 | 1801 |
] |
1802 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1803 |
"Modified: / 24.1.1997 / 19:12:14 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1804 |
"Modified: / 18.3.1999 / 18:14:36 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
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 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1812 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1813 |
self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass. |
6166 | 1814 |
]. |
1815 |
||
1816 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1817 |
Project notNil ifTrue:[ |
|
7368 | 1818 |
UpdateChangeListQuerySignal query ifTrue:[ |
1819 |
Project addInstVarDefinitionChangeFor:aClass class |
|
1820 |
] |
|
2256 | 1821 |
] |
1822 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1823 |
"Modified: / 24.1.1997 / 19:10:18 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1824 |
"Modified: / 18.3.1999 / 18:14:43 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1825 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1826 |
|
7179 | 1827 |
addChangeRecordForClassRemove |
1828 |
"{ Pragma: +optSpace }" |
|
1829 |
||
1830 |
"add a class-remove-record to the changes file" |
|
1831 |
||
1832 |
UpdateChangeFileQuerySignal query ifTrue:[ |
|
7368 | 1833 |
self writingChangePerform:#addChangeRecordForClassRemove:to: with:self. |
7179 | 1834 |
]. |
1835 |
||
1836 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1837 |
Project notNil ifTrue:[ |
|
7368 | 1838 |
UpdateChangeListQuerySignal query ifTrue:[ |
1839 |
Project addClassRemoveChange:self |
|
1840 |
] |
|
7179 | 1841 |
] |
1842 |
||
1843 |
"Modified: / 24.1.1997 / 19:10:25 / cg" |
|
1844 |
"Modified: / 18.3.1999 / 18:14:53 / stefan" |
|
1845 |
! |
|
1846 |
||
6166 | 1847 |
addChangeRecordForClassRemove:oldClassName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1848 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1849 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1850 |
"add a class-remove-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1851 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1852 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1853 |
self writingChangePerform:#addChangeRecordForClassRemove:to: with:self. |
6166 | 1854 |
]. |
1855 |
||
1856 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1857 |
Project notNil ifTrue:[ |
|
7368 | 1858 |
UpdateChangeListQuerySignal query ifTrue:[ |
1859 |
Project addClassRemoveChange:self |
|
1860 |
] |
|
2256 | 1861 |
] |
1862 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1863 |
"Modified: / 24.1.1997 / 19:10:25 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1864 |
"Modified: / 18.3.1999 / 18:14:53 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1865 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1866 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1867 |
addChangeRecordForClassRename:oldName to:newName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1868 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1869 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1870 |
"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
|
1871 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1872 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1873 |
self writingChangeDo:[:aStream | |
1874 |
self addChangeRecordForClassRename:oldName to:newName to:aStream |
|
1875 |
] |
|
6166 | 1876 |
]. |
1877 |
||
1878 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1879 |
Project notNil ifTrue:[ |
|
7368 | 1880 |
UpdateChangeListQuerySignal query ifTrue:[ |
1881 |
Project addClassRenameChangeFrom:oldName to:newName |
|
1882 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1883 |
] |
1846 | 1884 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1885 |
"Modified: / 24.1.1997 / 19:10:35 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1886 |
"Modified: / 18.3.1999 / 18:14:59 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1887 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1888 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1889 |
addChangeRecordForPrimitiveDefinitions:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1890 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1891 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1892 |
"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
|
1893 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1894 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1895 |
self writingChangePerform:#addChangeRecordForPrimitiveDefinitions:to: with:aClass. |
6166 | 1896 |
]. |
1897 |
||
1898 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1899 |
Project notNil ifTrue:[ |
|
7368 | 1900 |
UpdateChangeListQuerySignal query ifTrue:[ |
1901 |
Project addPrimitiveDefinitionsChangeFor:aClass |
|
1902 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1903 |
] |
2206 | 1904 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1905 |
"Modified: / 20.1.1997 / 12:36:10 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1906 |
"Modified: / 18.3.1999 / 18:15:04 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1907 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1908 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1909 |
addChangeRecordForPrimitiveFunctions:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1910 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1911 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1912 |
"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
|
1913 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1914 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1915 |
self writingChangePerform:#addChangeRecordForPrimitiveFunctions:to: with:aClass. |
6166 | 1916 |
]. |
1917 |
||
1918 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1919 |
Project notNil ifTrue:[ |
|
7368 | 1920 |
UpdateChangeListQuerySignal query ifTrue:[ |
1921 |
Project addPrimitiveFunctionsChangeFor:aClass |
|
1922 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1923 |
] |
2206 | 1924 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1925 |
"Modified: / 20.1.1997 / 12:36:13 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1926 |
"Modified: / 18.3.1999 / 18:15:09 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1927 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1928 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1929 |
addChangeRecordForPrimitiveVariables:aClass |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1930 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1931 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1932 |
"add a primitiveVariables-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1933 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1934 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1935 |
self writingChangePerform:#addChangeRecordForPrimitiveVariables:to: with:aClass. |
6166 | 1936 |
]. |
1937 |
||
1938 |
"this test allows a smalltalk without Projects/ChangeSets" |
|
1939 |
Project notNil ifTrue:[ |
|
7368 | 1940 |
UpdateChangeListQuerySignal query ifTrue:[ |
1941 |
Project addPrimitiveVariablesChangeFor:aClass |
|
1942 |
] |
|
666
6d4175de8c55
fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents:
663
diff
changeset
|
1943 |
] |
2206 | 1944 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1945 |
"Modified: / 20.1.1997 / 12:36:16 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1946 |
"Modified: / 18.3.1999 / 18:15:14 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1947 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1948 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1949 |
addChangeRecordForSnapshot:aFileName |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1950 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1951 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1952 |
"add a snapshot-record to the changes file" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1953 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1954 |
UpdateChangeFileQuerySignal query ifTrue:[ |
7368 | 1955 |
self |
1956 |
writingChangeWithTimeStamp:false |
|
1957 |
perform:#addChangeRecordForSnapshot:to: |
|
1958 |
with:aFileName. |
|
2256 | 1959 |
] |
1960 |
||
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1961 |
"Modified: / 24.1.1997 / 19:12:25 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1962 |
"Modified: / 18.3.1999 / 18:15:20 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1963 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1964 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1965 |
addChangeRecordForSnapshot:aFileName to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1966 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
1967 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1968 |
"add a snapshot-record to aStream" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
1969 |
|
6166 | 1970 |
self addInfoRecord:('snapshot ' , aFileName) to:aStream |
2256 | 1971 |
|
4055
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1972 |
"Modified: / 24.1.1997 / 19:11:08 / cg" |
599e73eed11f
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
4052
diff
changeset
|
1973 |
"Modified: / 18.3.1999 / 18:15:30 / stefan" |
2917 | 1974 |
! ! |
1975 |
||
1824 | 1976 |
!Class methodsFor:'enumerating'! |
1977 |
||
3997 | 1978 |
allPrivateClassesDo:aBlock |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1979 |
"evaluate aBlock on all of my private classes (if any). |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1980 |
Evaluation is in no particular order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1981 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1982 |
self allPrivateClasses do:aBlock |
3997 | 1983 |
! |
1984 |
||
1824 | 1985 |
privateClassesDo:aBlock |
5715
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
1986 |
"evaluate aBlock on all of my (immediate) private classes (if any). |
4400
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1987 |
Evaluation is in no particular order." |
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1988 |
|
e6eda296bb31
common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents:
4375
diff
changeset
|
1989 |
self privateClasses do:aBlock |
5715
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
1990 |
! |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
1991 |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1992 |
subclassesDo:aBlock |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1993 |
"evaluate the argument, aBlock for all immediate subclasses. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1994 |
This will only enumerate globally known classes - for anonymous |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1995 |
behaviors, you have to walk over all instances of Behavior." |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1996 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1997 |
|coll| |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1998 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
1999 |
"/ use cached information (avoid class hierarchy search) |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2000 |
"/ if possible |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2001 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2002 |
SubclassInfo isNil ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2003 |
Class subclassInfo |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2004 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2005 |
SubclassInfo notNil ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2006 |
coll := SubclassInfo at:self ifAbsent:nil. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2007 |
coll notNil ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2008 |
coll do:aBlock. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2009 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2010 |
^ self |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2011 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2012 |
|
8285 | 2013 |
coll := OrderedCollection new. |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2014 |
Smalltalk allClassesDo:[:aClass | |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2015 |
(aClass superclass == self) ifTrue:[ |
8285 | 2016 |
coll add:aClass |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2017 |
] |
8285 | 2018 |
]. |
2019 |
||
2020 |
SubclassInfo notNil ifTrue:[ |
|
2021 |
SubclassInfo at:self put:coll. |
|
2022 |
]. |
|
2023 |
||
2024 |
coll do:aBlock. |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2025 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2026 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2027 |
Collection subclassesDo:[:c | Transcript showCR:(c name)] |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2028 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2029 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2030 |
"Modified: 22.1.1997 / 18:44:01 / cg" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2031 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
2032 |
|
5715
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2033 |
withAllPrivateClassesDo:aBlock |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2034 |
"evaluate aBlock on myself and all of my private classes (if any). |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2035 |
This recurses into private classes of private classes. |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2036 |
Evaluation is in no particular order." |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2037 |
|
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2038 |
aBlock value:self. |
f69c58deb07e
added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents:
5707
diff
changeset
|
2039 |
self allPrivateClasses do:aBlock |
1824 | 2040 |
! ! |
2041 |
||
1 | 2042 |
!Class methodsFor:'fileIn interface'! |
2043 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2044 |
primitiveDefinitions |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2045 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2046 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2047 |
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
|
2048 |
unprocessed contents in the classes primitiveDefinitions section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2049 |
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
|
2050 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2051 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2052 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2053 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2054 |
"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
|
2055 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2056 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2057 |
primitiveFunctions |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2058 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2059 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2060 |
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
|
2061 |
unprocessed contents in the classes primitiveFunctions section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2062 |
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
|
2063 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2064 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2065 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2066 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2067 |
"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
|
2068 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2069 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2070 |
primitiveVariables |
958
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2071 |
"this method allows fileIn of classes with primitive code. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2072 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2073 |
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
|
2074 |
unprocessed contents in the classes primitiveVariables section. |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2075 |
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
|
2076 |
editable and especially: not lost when filing out the class." |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2077 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2078 |
^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables: |
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2079 |
|
50ae31c8deca
commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents:
956
diff
changeset
|
2080 |
"Modified: 10.2.1996 / 12:47:28 / cg" |
1 | 2081 |
! ! |
2082 |
||
2083 |
!Class methodsFor:'fileOut'! |
|
2084 |
||
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2085 |
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2086 |
"append an expression on aStream, which defines myself." |
238 | 2087 |
|
5344
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2088 |
self |
7368 | 2089 |
basicFileOutDefinitionOn:aStream |
2090 |
withNameSpace:forceNameSpace |
|
2091 |
withPackage:true |
|
5344
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2092 |
|
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2093 |
! |
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2094 |
|
6520
430a6d467003
fileout private classes (no namespace prefix)
Claus Gittinger <cg@exept.de>
parents:
6409
diff
changeset
|
2095 |
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:showPackage |
5344
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2096 |
"append an expression on aStream, which defines myself." |
90ff886b8085
separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2097 |
|
7617 | 2098 |
self class |
2099 |
basicFileOutDefinitionOf:self |
|
2100 |
on:aStream |
|
2101 |
withNameSpace:forceNameSpace withPackage:showPackage |
|
1707 | 2102 |
! |
2103 |
||
2104 |
basicFileOutInstvarTypeKeywordOn:aStream |
|
2105 |
"a helper for fileOutDefinition" |
|
2106 |
||
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2107 |
|isVar superclass| |
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2108 |
|
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
2109 |
superclass := self superclass. |
1707 | 2110 |
superclass isNil ifTrue:[ |
7368 | 2111 |
isVar := self isVariable |
1707 | 2112 |
] ifFalse:[ |
7368 | 2113 |
"I cant remember what this is for ?" |
2114 |
isVar := (self isVariable and:[superclass isVariable not]) |
|
1707 | 2115 |
]. |
2116 |
||
3920
0c1b9b2fa23b
added longlong indexed instvars;
Claus Gittinger <cg@exept.de>
parents:
3788
diff
changeset
|
2117 |
aStream nextPutAll:(self firstDefinitionSelectorPart). |
1707 | 2118 |
|
2119 |
"Created: 11.10.1996 / 18:57:29 / cg" |
|
1 | 2120 |
! |
2121 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2122 |
fileOut |
894
138c21732ab9
more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2123 |
"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
|
2124 |
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
|
2125 |
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
|
2126 |
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
|
2127 |
case of errors (for example: disk full). |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2128 |
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
|
2129 |
sourceFile may not be rewritten." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2130 |
|
7693 | 2131 |
|dirName nm fileName| |
2132 |
||
2133 |
nm := (Smalltalk fileNameForClass:self name) , '.st'. |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2134 |
|
139 | 2135 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2136 |
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
|
2137 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2138 |
Project notNil ifTrue:[ |
7693 | 2139 |
dirName := Project currentProjectDirectory |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2140 |
] ifFalse:[ |
7693 | 2141 |
dirName := Filename currentDirectory |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2142 |
]. |
3788
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2143 |
fileName := (dirName asFilename construct:nm). |
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2144 |
fileName makeLegalFilename. |
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2145 |
|
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2146 |
self fileOutAs:fileName name. |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2147 |
|
2771 | 2148 |
"/ " |
2149 |
"/ add a change record; that way, administration is much easier, |
|
2150 |
"/ since we can see in that changeBrowser, which changes have |
|
2151 |
"/ already found their way into a sourceFile and which must be |
|
2152 |
"/ applied again |
|
2153 |
"/ " |
|
2154 |
"/ self addChangeRecordForClassFileOut:self |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2155 |
|
3788
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2156 |
"Modified: / 7.6.1996 / 09:14:43 / stefan" |
ea7d4f4a2ba6
convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents:
3750
diff
changeset
|
2157 |
"Modified: / 27.8.1998 / 02:02:57 / cg" |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2158 |
! |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2159 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2160 |
fileOutAllMethodsOn:aStream |
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2161 |
self fileOutAllMethodsOn:aStream methodFilter:nil |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2162 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2163 |
"Created: 15.10.1996 / 11:13:00 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2164 |
"Modified: 22.3.1997 / 16:12:17 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2165 |
! |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2166 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2167 |
fileOutAllMethodsOn:aStream methodFilter:methodFilter |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2168 |
|collectionOfCategories| |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2169 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2170 |
collectionOfCategories := self class categories asSortedCollection. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2171 |
collectionOfCategories notNil ifTrue:[ |
7368 | 2172 |
collectionOfCategories do:[:aCategory | |
2173 |
self class fileOutCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2174 |
aStream cr |
|
2175 |
] |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2176 |
]. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2177 |
collectionOfCategories := self categories asSortedCollection. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2178 |
collectionOfCategories notNil ifTrue:[ |
7368 | 2179 |
collectionOfCategories do:[:aCategory | |
2180 |
self fileOutCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2181 |
aStream cr |
|
2182 |
] |
|
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2183 |
]. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2184 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2185 |
self privateClassesSorted do:[:aClass | |
7368 | 2186 |
aClass fileOutAllMethodsOn:aStream methodFilter:methodFilter |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2187 |
]. |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2188 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2189 |
"Created: 15.10.1996 / 11:13:00 / cg" |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2190 |
"Modified: 22.3.1997 / 16:12:17 / cg" |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2191 |
! |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2192 |
|
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2193 |
fileOutAs:fileNameString |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2194 |
"create a file consisting of all methods in myself in |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2195 |
sourceForm, from which the class can be reconstructed (by filing in). |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2196 |
The given fileName should be a full path, including suffix. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2197 |
Care is taken, to not clobber any existing file in |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2198 |
case of errors (for example: disk full). |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2199 |
Also, since the classes methods need a valid sourcefile, the current |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2200 |
sourceFile may not be rewritten." |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2201 |
|
2958
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
2202 |
|aStream fileName newFileName savFilename needRename |
2553
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2203 |
mySourceFileName sameFile s mySourceFileID anySourceRef| |
4993919699a3
separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents:
2544
diff
changeset
|
2204 |
|
3750
d544994a1c3e
in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents:
3702
diff
changeset
|
2205 |
self isLoaded ifFalse:[ |
8281
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2206 |
^ FileOutErrorSignal |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2207 |
raiseRequestWith:self |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2208 |
errorString:' - will not fileOut unloaded class: ', self name |
3750
d544994a1c3e
in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents:
3702
diff
changeset
|
2209 |
]. |
d544994a1c3e
in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents:
3702
diff
changeset
|
2210 |
|
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2211 |
fileName := fileNameString asFilename. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2212 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2213 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2214 |
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
|
2215 |
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
|
2216 |
and, if that worked rename afterwards ... |
153 | 2217 |
" |
1116
a3c136969f7c
got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents:
1113
diff
changeset
|
2218 |
(fileName exists) ifTrue:[ |
8281
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2219 |
sameFile := false. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2220 |
|
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2221 |
"/ check carefully - maybe, my source does not really come from that |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2222 |
"/ file (i.e. all of my methods have their source as string) |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2223 |
|
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2224 |
anySourceRef := false. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2225 |
self instAndClassMethodsDo:[:m | |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2226 |
m sourcePosition notNil ifTrue:[ |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2227 |
anySourceRef := true |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2228 |
] |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2229 |
]. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2230 |
|
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2231 |
anySourceRef ifTrue:[ |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2232 |
s := self sourceStream. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2233 |
s notNil ifTrue:[ |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2234 |
mySourceFileID := s pathName asFilename info id. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2235 |
sameFile := (fileName info id) == mySourceFileID. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2236 |
s close. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2237 |
] ifFalse:[ |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2238 |
classFilename notNil ifTrue:[ |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2239 |
" |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2240 |
check for overwriting my current source file |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2241 |
this is not allowed, since it would clobber my methods source |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2242 |
file ... you have to save it to some other place. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2243 |
This happens if you ask for a fileOut into the source-directory |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2244 |
(from which my methods get their source) |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2245 |
" |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2246 |
mySourceFileName := Smalltalk getSourceFileName:classFilename. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2247 |
sameFile := (fileNameString = mySourceFileName). |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2248 |
sameFile ifFalse:[ |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2249 |
mySourceFileName notNil ifTrue:[ |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2250 |
sameFile := (fileName info id) == (mySourceFileName asFilename info id) |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2251 |
] |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2252 |
]. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2253 |
] |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2254 |
]. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2255 |
]. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2256 |
|
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2257 |
sameFile ifTrue:[ |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2258 |
^ FileOutErrorSignal |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2259 |
raiseRequestWith:fileNameString |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2260 |
errorString:(' - may not overwrite sourcefile:', fileNameString) |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2261 |
]. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2262 |
|
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2263 |
savFilename := Filename newTemporary. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2264 |
fileName copyTo:savFilename. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2265 |
newFileName := fileName withSuffix:'new'. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2266 |
needRename := true |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2267 |
] ifFalse:[ |
8281
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2268 |
"/ another possible trap: if my sourceFileName is |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2269 |
"/ the same as the written one AND the new files directory |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2270 |
"/ is along the sourcePath, we also need a temporary file |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2271 |
"/ first, to avoid accessing the newly written file. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2272 |
|
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2273 |
anySourceRef := false. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2274 |
self instAndClassMethodsDo:[:m | |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2275 |
|mSrc| |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2276 |
|
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2277 |
(mSrc := m sourceFilename) notNil ifTrue:[ |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2278 |
mSrc asFilename baseName = fileName baseName ifTrue:[ |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2279 |
anySourceRef := true |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2280 |
] |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2281 |
] |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2282 |
]. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2283 |
anySourceRef ifTrue:[ |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2284 |
newFileName := fileName withSuffix:'new'. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2285 |
needRename := true |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2286 |
] ifFalse:[ |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2287 |
newFileName := fileName. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2288 |
needRename := false |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2289 |
] |
1 | 2290 |
]. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2291 |
[ |
8281
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2292 |
aStream := newFileName writeStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2293 |
] on:FileStream openErrorSignal do:[:ex| |
8281
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2294 |
savFilename notNil ifTrue:[ |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2295 |
savFilename delete |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2296 |
]. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2297 |
^ FileOutErrorSignal |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2298 |
raiseRequestWith:newFileName name |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2299 |
errorString:(' - cannot create file:', newFileName name) |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2300 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2301 |
self fileOutOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2302 |
aStream close. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2303 |
|
199 | 2304 |
" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2305 |
finally, replace the old-file |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2306 |
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
|
2307 |
we have to do a copy ... |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2308 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2309 |
needRename ifTrue:[ |
8281
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2310 |
newFileName copyTo:fileName. |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2311 |
newFileName delete |
2958
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
2312 |
]. |
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
2313 |
savFilename notNil ifTrue:[ |
8281
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2314 |
savFilename delete |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2315 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2316 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2317 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2318 |
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
|
2319 |
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
|
2320 |
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
|
2321 |
applied again |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2322 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2323 |
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
|
2324 |
|
3180
1c225dd8c5b2
care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2325 |
"Modified: / 7.6.1996 / 09:14:43 / stefan" |
1c225dd8c5b2
care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2326 |
"Created: / 16.4.1997 / 20:44:05 / cg" |
3750
d544994a1c3e
in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents:
3702
diff
changeset
|
2327 |
"Modified: / 12.8.1998 / 11:14:56 / cg" |
1753
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2328 |
! |
fc2ff98b99f7
fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents:
1748
diff
changeset
|
2329 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2330 |
fileOutClassInstVarDefinitionOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2331 |
"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
|
2332 |
|
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8267
diff
changeset
|
2333 |
self class |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8267
diff
changeset
|
2334 |
fileOutClassInstVarDefinitionOn:aStream |
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8267
diff
changeset
|
2335 |
withNameSpace:false |
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2336 |
! |
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2337 |
|
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2338 |
fileOutClassInstVarDefinitionOn:aStream withNameSpace:withNameSpace |
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2339 |
"append an expression to define my classInstanceVariables on aStream" |
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2340 |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2341 |
|anySuperClassInstVar| |
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2342 |
|
5296
12a5de62fef7
class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents:
5257
diff
changeset
|
2343 |
self isLoaded ifFalse:[ |
7368 | 2344 |
^ self basicFileOutDefinitionOn:aStream withNameSpace:withNameSpace |
5296
12a5de62fef7
class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents:
5257
diff
changeset
|
2345 |
]. |
12a5de62fef7
class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents:
5257
diff
changeset
|
2346 |
|
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2347 |
withNameSpace ifTrue:[ |
7368 | 2348 |
self name printOn:aStream. |
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2349 |
] ifFalse:[ |
7368 | 2350 |
self printClassNameOn:aStream. |
4375
857f5ac00d2b
oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents:
4359
diff
changeset
|
2351 |
]. |
3338
0423dac35a45
dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
2352 |
aStream nextPutAll:' class instanceVariableNames:'''. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2353 |
self class printInstVarNamesOn:aStream indent:8. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2354 |
aStream nextPutAll:''''. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2355 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2356 |
"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
|
2357 |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2358 |
anySuperClassInstVar := false. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2359 |
self allSuperclassesDo:[:aSuperClass | |
7368 | 2360 |
aSuperClass class instVarNames do:[:ignored | anySuperClassInstVar := true]. |
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2361 |
]. |
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2362 |
|
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2363 |
aStream cr; cr; nextPut:(Character doubleQuote); cr; space. |
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2364 |
anySuperClassInstVar ifFalse:[ |
7368 | 2365 |
aStream |
2366 |
nextPutLine:'No other class instance variables are inherited by this class.'. |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2367 |
] ifTrue:[ |
7368 | 2368 |
aStream |
2369 |
nextPutLine:'The following class instance variables are inherited by this class:'. |
|
2370 |
aStream cr. |
|
2371 |
self allSuperclassesDo:[:aSuperClass | |
|
2372 |
aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '. |
|
2373 |
aStream nextPutLine:(aSuperClass class instanceVariableString). |
|
2374 |
]. |
|
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2375 |
|
556 | 2376 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2377 |
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
|
2378 |
|
3338
0423dac35a45
dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
2379 |
"Created: / 10.12.1995 / 16:31:25 / cg" |
0423dac35a45
dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents:
3248
diff
changeset
|
2380 |
"Modified: / 1.4.1997 / 16:00:33 / stefan" |
5235
e21657631d7a
definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents:
5225
diff
changeset
|
2381 |
"Modified: / 3.2.2000 / 23:05:28 / cg" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2382 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2383 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2384 |
fileOutCommentOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2385 |
"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
|
2386 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2387 |
|comment s| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2388 |
|
2011
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
2389 |
self printClassNameOn:aStream. |
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
2390 |
aStream nextPutAll:' comment:'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2391 |
(comment := self comment) isNil ifTrue:[ |
7368 | 2392 |
s := '''''' |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2393 |
] ifFalse:[ |
7368 | 2394 |
s := comment storeString |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2395 |
]. |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2396 |
aStream nextPutAllAsChunk:s. |
1063
b45a722a10c3
oops - forgot excla after comment-chunk
Claus Gittinger <cg@exept.de>
parents:
989
diff
changeset
|
2397 |
aStream nextPutChunkSeparator. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2398 |
aStream cr |
988
b17239b51874
double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2399 |
|
2011
9a382deb44d7
suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
2400 |
"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
|
2401 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2402 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2403 |
fileOutDefinitionOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2404 |
"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
|
2405 |
|
2059
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2406 |
^ 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
|
2407 |
|
c58962259667
care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents:
2049
diff
changeset
|
2408 |
"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
|
2409 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2410 |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2411 |
fileOutIn:aDirectoryName |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2412 |
"create a file 'class.st' consisting of all methods in self in |
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2413 |
directory aDirectoryName (ignoring any directory setting in |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2414 |
the current project). |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2415 |
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
|
2416 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2417 |
|aStream fileName| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2418 |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2419 |
fileName := (Smalltalk fileNameForClass:self name), '.st'. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2420 |
[ |
7368 | 2421 |
aStream := (aDirectoryName asFilename construct:fileName) writeStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2422 |
] on:FileStream openErrorSignal do:[:ex| |
7368 | 2423 |
^ FileOutErrorSignal |
2424 |
raiseRequestWith:fileName |
|
2425 |
errorString:(' - cannot create file:', fileName) |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2426 |
]. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2427 |
self fileOutOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2428 |
aStream close |
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2429 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2430 |
" |
7368 | 2431 |
self fileOutIn:'/tmp' |
2432 |
self fileOutIn:'/tmp/doesNotExistBla' |
|
2433 |
self fileOutIn:'/tmp' asFilename |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2434 |
" |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2435 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
2436 |
"Modified: 19.9.1997 / 00:03:53 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2437 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2438 |
|
555 | 2439 |
fileOutOn:aStream |
2440 |
"file out my definition and all methods onto aStream" |
|
2441 |
||
2442 |
^ self fileOutOn:aStream withTimeStamp:true |
|
2443 |
||
2444 |
"Created: 15.11.1995 / 12:53:32 / cg" |
|
2046 | 2445 |
"Modified: 3.1.1997 / 17:50:28 / cg" |
555 | 2446 |
! |
2447 |
||
2448 |
fileOutOn:aStream withTimeStamp:stampIt |
|
3339
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2449 |
"file out my definition and all methods onto aStream. |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2450 |
If stampIt is true, a timeStamp comment is prepended." |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2451 |
|
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2452 |
self fileOutOn:aStream withTimeStamp:stampIt withInitialize:true |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2453 |
|
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2454 |
"Modified: / 13.3.1998 / 12:23:02 / cg" |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2455 |
! |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2456 |
|
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2457 |
fileOutOn:aStream withTimeStamp:stampIt withInitialize:initIt |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2458 |
"file out my definition and all methods onto aStream. |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2459 |
If stampIt is true, a timeStamp comment is prepended. |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2460 |
If initIt is true, and the class implements a class-initialize method, |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2461 |
append a corresponding doIt expression for initialization." |
555 | 2462 |
|
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2463 |
self |
7368 | 2464 |
fileOutOn:aStream |
2465 |
withTimeStamp:stampIt |
|
2466 |
withInitialize:initIt |
|
2467 |
withDefinition:true |
|
2468 |
methodFilter:nil |
|
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2469 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2470 |
"Created: / 15.11.1995 / 12:53:06 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2471 |
"Modified: / 1.4.1997 / 16:01:05 / stefan" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2472 |
"Modified: / 13.3.1998 / 12:23:59 / cg" |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2473 |
! |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2474 |
|
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2475 |
fileOutOn:aStream withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2476 |
"file out my definition and all methods onto aStream. |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2477 |
If stampIt is true, a timeStamp comment is prepended. |
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2478 |
If initIt is true, and the class implements a class-initialize method, |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2479 |
append a corresponding doIt expression for initialization. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2480 |
The order by which the fileOut is done is used to put the version string at the end. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2481 |
Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move" |
4733
c0f5ef2bac18
additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents:
4667
diff
changeset
|
2482 |
|
8212 | 2483 |
|encoder any16Bit| |
8164 | 2484 |
|
2485 |
any16Bit := |
|
2486 |
self methodDictionary |
|
2487 |
contains:[:m | |
|
2488 |
|src| |
|
2489 |
||
2490 |
src := m source ? ''. |
|
2491 |
(src contains:[:ch | ch asciiValue > 16rFF]) |
|
2492 |
]. |
|
2493 |
any16Bit ifFalse:[ |
|
2494 |
any16Bit := |
|
2495 |
self class methodDictionary |
|
2496 |
contains:[:m | |
|
2497 |
|src| |
|
2498 |
||
2499 |
src := m source ? ''. |
|
2500 |
(src contains:[:ch | ch asciiValue > 16rFF]) |
|
2501 |
]. |
|
2502 |
]. |
|
8212 | 2503 |
any16Bit ifTrue:[ |
2504 |
encoder := CharacterEncoder encoderForUTF8. |
|
8075 | 2505 |
]. |
8051
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2506 |
^ self |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2507 |
fileOutOn:aStream |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2508 |
withTimeStamp:stampIt |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2509 |
withInitialize:initIt |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2510 |
withDefinition:withDefinition |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2511 |
methodFilter:methodFilter |
8075 | 2512 |
encoder:encoder |
8051
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2513 |
! |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2514 |
|
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2515 |
fileOutOn:outStreamArg withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter encoder:encoderOrNil |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2516 |
"file out my definition and all methods onto aStream. |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2517 |
If stampIt is true, a timeStamp comment is prepended. |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2518 |
If initIt is true, and the class implements a class-initialize method, |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2519 |
append a corresponding doIt expression for initialization. |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2520 |
The order by which the fileOut is done is used to put the version string at the end. |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2521 |
Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move" |
510f2dd4b771
use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents:
7894
diff
changeset
|
2522 |
|
8230 | 2523 |
self class |
2524 |
fileOutOn:outStreamArg |
|
2525 |
withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition |
|
2526 |
methodFilter:methodFilter encoder:encoderOrNil |
|
2527 |
||
555 | 2528 |
|
3339
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2529 |
"Created: / 15.11.1995 / 12:53:06 / cg" |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2530 |
"Modified: / 1.4.1997 / 16:01:05 / stefan" |
6864210a1c27
added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents:
3338
diff
changeset
|
2531 |
"Modified: / 13.3.1998 / 12:23:59 / cg" |
555 | 2532 |
! |
2533 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2534 |
fileOutPrimitiveDefinitionsOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2535 |
"append primitive defs (if any) to aStream." |
555 | 2536 |
|
2537 |
|s| |
|
2538 |
||
2539 |
" |
|
2540 |
primitive definitions - if any |
|
2541 |
" |
|
2542 |
(s := self primitiveDefinitionsString) notNil ifTrue:[ |
|
7368 | 2543 |
aStream nextPutChunkSeparator. |
2544 |
self printClassNameOn:aStream. |
|
2545 |
aStream nextPutAll:' primitiveDefinitions'; |
|
2546 |
nextPutChunkSeparator; |
|
2547 |
cr. |
|
2548 |
aStream nextPutAll:s. |
|
2549 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
555 | 2550 |
]. |
2551 |
(s := self primitiveVariablesString) notNil ifTrue:[ |
|
7368 | 2552 |
aStream nextPutChunkSeparator. |
2553 |
self printClassNameOn:aStream. |
|
2554 |
aStream nextPutAll:' primitiveVariables'; |
|
2555 |
nextPutChunkSeparator; |
|
2556 |
cr. |
|
2557 |
aStream nextPutAll:s. |
|
2558 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
555 | 2559 |
]. |
2088
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
2560 |
|
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
2561 |
"Modified: 8.1.1997 / 17:45:40 / cg" |
555 | 2562 |
! |
2563 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2564 |
fileOutPrimitiveSpecsOn:aStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2565 |
"append primitive defs (if any) to aStream." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2566 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2567 |
|s| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2568 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2569 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2570 |
primitive definitions - if any |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2571 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2572 |
self fileOutPrimitiveDefinitionsOn:aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2573 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2574 |
primitive functions - if any |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2575 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2576 |
(s := self primitiveFunctionsString) notNil ifTrue:[ |
7368 | 2577 |
aStream nextPutChunkSeparator. |
2578 |
self printClassNameOn:aStream. |
|
2579 |
aStream nextPutAll:' primitiveFunctions'; |
|
2580 |
nextPutChunkSeparator; |
|
2581 |
cr. |
|
2582 |
aStream nextPutAll:s. |
|
2583 |
aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2584 |
]. |
2088
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
2585 |
|
d7e8d0bce74f
care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents:
2072
diff
changeset
|
2586 |
"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
|
2587 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
2588 |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2589 |
!Class methodsFor:'fileOut-binary'! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2590 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2591 |
binaryFileOut |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2592 |
"create a file 'class.cls' (in the current projects fileOut-directory), |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2593 |
consisting of all methods in myself in a portable binary format. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2594 |
The methods source is saved by reference |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2595 |
to the classes sourceFile if there is any. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2596 |
That sourcefile needs to be present after reload in order to be |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2597 |
browsable." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2598 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2599 |
self binaryFileOutWithSourceMode:#reference |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2600 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2601 |
"Modified: 5.1.1997 / 15:40:05 / cg" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2602 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2603 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2604 |
binaryFileOutOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2605 |
"append a binary representation of myself to aStream" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2606 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2607 |
self binaryFileOutOn:aStream sourceMode:#reference |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2608 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2609 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2610 |
binaryFileOutOn:aStream sourceMode:sourceMode |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2611 |
"append a binary representation of myself to aStream in |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2612 |
a portable binary format. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2613 |
The argument controls how sources are to be saved: |
7368 | 2614 |
#keep - include the source |
2615 |
#reference - include a reference to the sourceFile |
|
2616 |
#discard - dont save sources. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2617 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2618 |
With #reference, the sourceFile needs to be present after reload |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2619 |
in order to be browsable." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2620 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2621 |
|bos| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2622 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2623 |
bos := BinaryObjectStorage onNew:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2624 |
bos sourceMode:sourceMode. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2625 |
bos nextPutClasses:(Array with:self). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2626 |
bos close. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2627 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2628 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2629 |
binaryFileOutWithSourceMode:sourceMode |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2630 |
"create a file 'class.cls' (in the current projects fileOut-directory), |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2631 |
consisting of all methods in myself in a portable binary format. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2632 |
The argument controls how sources are to be saved: |
7693 | 2633 |
#keep - include the source |
2634 |
#reference - include a reference to the sourceFile |
|
2635 |
#discard - dont save sources. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2636 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2637 |
With #reference, the sourceFile needs to be present after reload |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2638 |
in order to be browsable." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2639 |
|
7693 | 2640 |
|fileName dirName| |
2641 |
||
2642 |
fileName := (Smalltalk fileNameForClass:self name) , '.cls'. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2643 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2644 |
Project notNil ifTrue:[ |
7693 | 2645 |
dirName := Project currentProjectDirectory |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2646 |
] ifFalse:[ |
7693 | 2647 |
dirName := '.' |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2648 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2649 |
fileName := dirName asFilename construct:fileName. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2650 |
fileName makeLegalFilename. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2651 |
fileName := fileName name. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2652 |
self binaryFileOutWithSourceMode:sourceMode as:fileName. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2653 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2654 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2655 |
binaryFileOutWithSourceMode:sourceMode as:fileNameString |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2656 |
"create a file fileNameString, |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2657 |
consisting of all methods in myself in a portable binary format. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2658 |
The argument controls how sources are to be saved: |
7368 | 2659 |
#keep - include the source |
2660 |
#reference - include a reference to the sourceFile |
|
2661 |
#discard - dont save sources. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2662 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2663 |
With #reference, the sourceFile needs to be present after reload |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2664 |
in order to be browsable." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2665 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2666 |
|fileName aStream| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2667 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2668 |
fileName := fileNameString asFilename. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2669 |
fileName makeLegalFilename. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2670 |
|
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2671 |
[ |
7368 | 2672 |
aStream := fileName newReadWriteStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2673 |
] on:FileStream openErrorSignal do:[:ex| |
7368 | 2674 |
^ FileOutErrorSignal |
2675 |
raiseRequestWith:fileName name |
|
2676 |
errorString:(' - cannot create file:', fileName name) |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2677 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2678 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2679 |
aStream binary. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2680 |
self binaryFileOutOn:aStream sourceMode:sourceMode. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2681 |
aStream close. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2682 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2683 |
"Created: / 29.12.1998 / 21:38:38 / cg" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2684 |
! ! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2685 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2686 |
!Class methodsFor:'fileOut-xml'! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2687 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2688 |
fileOutXML |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2689 |
"create a file 'class.xml' consisting of all methods in myself in |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2690 |
XML sourceForm. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2691 |
If the current project is not nil, create the file in the projects |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2692 |
directory. Care is taken, to not clobber any existing file in |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2693 |
case of errors (for example: disk full)" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2694 |
|
7693 | 2695 |
|dirName nm fileName| |
2696 |
||
2697 |
nm := (Smalltalk fileNameForClass:self name) , '.xml'. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2698 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2699 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2700 |
this test allows a smalltalk to be built without Projects/ChangeSets |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2701 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2702 |
Project notNil ifTrue:[ |
7693 | 2703 |
dirName := Project currentProjectDirectory |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2704 |
] ifFalse:[ |
7693 | 2705 |
dirName := Filename currentDirectory |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2706 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2707 |
fileName := (dirName asFilename construct:nm). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2708 |
fileName makeLegalFilename. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2709 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2710 |
self fileOutXMLAs:fileName. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2711 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2712 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2713 |
Class fileOutXML |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2714 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2715 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2716 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2717 |
fileOutXMLAllDefinitionsOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2718 |
"append xml expressions on aStream, which defines myself and all of my private classes." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2719 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2720 |
self fileOutXMLDefinitionOn:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2721 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2722 |
"/ here, the full nameSpace prefixes are output, |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2723 |
"/ to avoid confusing stc |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2724 |
"/ (which otherwise could not find the correct superclass) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2725 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2726 |
FileOutNameSpaceQuerySignal answer:true do:[ |
7368 | 2727 |
self privateClassesSorted do:[:aClass | |
2728 |
aClass fileOutXMLAllDefinitionsOn:aStream |
|
2729 |
] |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2730 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2731 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2732 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2733 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2734 |
|
5464 | 2735 |
fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter |
2736 |
|collectionOfCategories| |
|
2737 |
||
2738 |
collectionOfCategories := self class categories asSortedCollection. |
|
2739 |
collectionOfCategories notNil ifTrue:[ |
|
7368 | 2740 |
collectionOfCategories do:[:aCategory | |
2741 |
self class fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2742 |
aStream cr |
|
2743 |
] |
|
5464 | 2744 |
]. |
2745 |
collectionOfCategories := self categories asSortedCollection. |
|
2746 |
collectionOfCategories notNil ifTrue:[ |
|
7368 | 2747 |
collectionOfCategories do:[:aCategory | |
2748 |
self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2749 |
aStream cr |
|
2750 |
] |
|
5464 | 2751 |
]. |
2752 |
||
2753 |
self privateClassesSorted do:[:aClass | |
|
7368 | 2754 |
aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter |
5464 | 2755 |
]. |
2756 |
||
2757 |
! |
|
2758 |
||
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2759 |
fileOutXMLAs:fileNameOrString |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2760 |
"create a file consisting of all methods in myself in |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2761 |
XML sourceForm. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2762 |
The given fileName should be a full path, including suffix." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2763 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2764 |
|aStream fileName| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2765 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2766 |
self isLoaded ifFalse:[ |
8281
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2767 |
^ FileOutErrorSignal |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2768 |
raiseRequestWith:self |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2769 |
errorString:' - will not fileOut unloaded class: ', self name |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2770 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2771 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2772 |
fileName := fileNameOrString asFilename. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2773 |
[ |
8281
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2774 |
aStream := fileName writeStream. |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2775 |
] on:FileStream openErrorSignal do:[:ex| |
8281
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2776 |
^ FileOutErrorSignal |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2777 |
raiseRequestWith:fileName name |
76b406c7cc2b
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
8277
diff
changeset
|
2778 |
errorString:(' - cannot create file: ', fileName name) |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2779 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2780 |
self fileOutXMLOn:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2781 |
aStream close. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2782 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2783 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2784 |
Class fileOutXMLAs:'test.xml' |
7089
c4a27118cc2a
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7084
diff
changeset
|
2785 |
Class fileOutXMLAs:'/blaDoesNotExist/test.xml' |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2786 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2787 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2788 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2789 |
fileOutXMLDefinitionOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2790 |
"append an xml expression on aStream, which defines myself." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2791 |
|
6703 | 2792 |
|varNames| |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2793 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2794 |
aStream nextPutLine:'<class>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2795 |
|
5464 | 2796 |
aStream nextPutAll:' <name>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2797 |
aStream nextPutAll:(self nameWithoutPrefix). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2798 |
aStream nextPutLine:'</name>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2799 |
|
5464 | 2800 |
aStream nextPutAll:' <environment>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2801 |
aStream nextPutAll:(self nameSpace name). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2802 |
aStream nextPutLine:'</environment>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2803 |
|
5464 | 2804 |
aStream nextPutAll:' <super>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2805 |
aStream nextPutAll:(self theNonMetaclass superclass name). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2806 |
aStream nextPutLine:'</super>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2807 |
|
5464 | 2808 |
aStream nextPutAll:' <private>'. |
2809 |
aStream nextPutAll:(self isPrivate printString). |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2810 |
aStream nextPutLine:'</private>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2811 |
|
5464 | 2812 |
aStream nextPutAll:' <indexed-type>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2813 |
aStream nextPutAll:'none'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2814 |
aStream nextPutLine:'</indexed-type>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2815 |
|
5464 | 2816 |
aStream nextPutAll:' <inst-vars>'. |
2817 |
varNames := self instVarNames. |
|
2818 |
varNames size > 0 ifTrue:[ |
|
7368 | 2819 |
aStream cr. |
2820 |
varNames do:[:nm | |
|
2821 |
aStream nextPutAll:' <name>'. |
|
2822 |
aStream nextPutAll:nm. |
|
2823 |
aStream nextPutLine:'</name>'. |
|
2824 |
]. |
|
2825 |
aStream nextPutAll:' '. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2826 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2827 |
aStream nextPutLine:'</inst-vars>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2828 |
|
5464 | 2829 |
aStream nextPutAll:' <class-inst-vars>'. |
2830 |
varNames := self class instVarNames. |
|
2831 |
varNames size > 0 ifTrue:[ |
|
7368 | 2832 |
aStream cr. |
2833 |
varNames do:[:nm | |
|
2834 |
aStream nextPutAll:' <name>'. |
|
2835 |
aStream nextPutAll:nm. |
|
2836 |
aStream nextPutLine:'</name>'. |
|
2837 |
]. |
|
2838 |
aStream nextPutAll:' '. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2839 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2840 |
aStream nextPutLine:'</class-inst-vars>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2841 |
|
5464 | 2842 |
aStream nextPutAll:' <imports>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2843 |
aStream nextPutAll:''. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2844 |
aStream nextPutLine:'</imports>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2845 |
|
5464 | 2846 |
aStream nextPutAll:' <category>'. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2847 |
aStream nextPutAll:self category. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2848 |
aStream nextPutLine:'</category>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2849 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2850 |
aStream nextPutLine:'</class>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2851 |
|
5464 | 2852 |
varNames := self classVarNames. |
2853 |
varNames size > 0 ifTrue:[ |
|
7368 | 2854 |
varNames do:[:nm | |
2855 |
aStream nextPutLine:'<static>'. |
|
2856 |
aStream nextPutAll:' <name>'. |
|
2857 |
aStream nextPutAll:nm. |
|
2858 |
aStream nextPutLine:'</name>'. |
|
2859 |
aStream nextPutAll:' <environment>'. |
|
2860 |
aStream nextPutAll:self name. |
|
2861 |
aStream nextPutLine:'</environment>'. |
|
2862 |
aStream nextPutLine:'</static>'. |
|
2863 |
]. |
|
5464 | 2864 |
]. |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2865 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2866 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2867 |
fileOutXMLOn:aStream |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2868 |
"WARNING: untested first version. Not for general use (yet) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2869 |
file out my definition and all methods onto aStream in XML format." |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2870 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2871 |
self |
7368 | 2872 |
fileOutXMLOn:aStream |
2873 |
withTimeStamp:true |
|
2874 |
withInitialize:true |
|
2875 |
withDefinition:true |
|
2876 |
methodFilter:nil |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2877 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2878 |
! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2879 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2880 |
fileOutXMLOn:aStream withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2881 |
"WARNING: untested first version. Not for general use (yet) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2882 |
file out my definition and all methods onto aStream in XML format. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2883 |
If stampIt is true, a timeStamp comment is prepended. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2884 |
If initIt is true, and the class implements a class-initialize method, |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2885 |
append a corresponding doIt expression for initialization. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2886 |
The order by which the fileOut is done is used to put the version string at the end. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2887 |
Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2888 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2889 |
|collectionOfCategories copyrightMethod copyrightText comment meta| |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2890 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2891 |
self isLoaded ifFalse:[ |
7368 | 2892 |
^ FileOutErrorSignal |
2893 |
raiseRequestWith:self |
|
2894 |
errorString:' - will not fileOut unloaded class: ', self name |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2895 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2896 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2897 |
meta := self class. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2898 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2899 |
aStream nextPutLine:'<?xml version="1.0"?>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2900 |
aStream nextPutLine:'<st-source>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2901 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2902 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2903 |
if there is a copyright method, add a copyright element at the beginning, |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2904 |
taking the string from the copyright method. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2905 |
We cannot do this unconditionally - that would lead to my copyrights |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2906 |
being put on your code ;-). |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2907 |
On the other hand: I want every file created by myself to have the |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2908 |
copyright string at the beginning be preserved .... even if the |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2909 |
code was edited in the browser and filedOut. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2910 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2911 |
(copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[ |
7368 | 2912 |
" |
2913 |
get the copyright methods source, |
|
2914 |
and insert at beginning. |
|
2915 |
" |
|
2916 |
copyrightText := copyrightMethod source. |
|
2917 |
copyrightText isNil ifTrue:[ |
|
2918 |
" |
|
2919 |
no source available - trigger an error |
|
2920 |
" |
|
2921 |
FileOutErrorSignal |
|
2922 |
raiseRequestWith:' - no source for class: '. |
|
2923 |
^ self |
|
2924 |
]. |
|
2925 |
" |
|
2926 |
strip off the selector-line |
|
2927 |
" |
|
2928 |
copyrightText := copyrightText asCollectionOfLines asStringCollection. |
|
2929 |
copyrightText := copyrightText copyFrom:2 to:(copyrightText size). |
|
2930 |
[copyrightText last isEmpty] whileTrue:[ |
|
2931 |
copyrightText := copyrightText copyWithoutLast:1. |
|
2932 |
]. |
|
2933 |
(copyrightText first = '"') ifTrue:[ |
|
2934 |
(copyrightText last = '"') ifTrue:[ |
|
2935 |
copyrightText := copyrightText copyFrom:2 to:(copyrightText size - 1). |
|
2936 |
] |
|
2937 |
]. |
|
2938 |
copyrightText := copyrightText asString. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2939 |
|
7368 | 2940 |
aStream nextPutAll:'<copyright>'. |
2941 |
self fileOutXMLString:copyrightText on:aStream. |
|
2942 |
aStream nextPutLine:'</copyright>'. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2943 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2944 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2945 |
stampIt ifTrue:[ |
7368 | 2946 |
"/ |
2947 |
"/ first, a timestamp |
|
2948 |
"/ |
|
2949 |
aStream nextPutAll:'<time-stamp>'. |
|
2950 |
self fileOutXMLString:(Smalltalk timeStampString) on:aStream. |
|
2951 |
aStream nextPutLine:'</time-stamp>'. |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2952 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2953 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2954 |
withDefinition ifTrue:[ |
7368 | 2955 |
"/ |
2956 |
"/ then the definition |
|
2957 |
"/ |
|
2958 |
self fileOutXMLAllDefinitionsOn:aStream. |
|
2959 |
"/ |
|
2960 |
"/ a comment - if any |
|
2961 |
"/ |
|
2962 |
(comment := self comment) notNil ifTrue:[ |
|
2963 |
aStream nextPutLine:'<comment>'. |
|
2964 |
aStream nextPutAll:'<class-id>'. |
|
2965 |
aStream nextPutAll:(self name). |
|
2966 |
aStream nextPutLine:'</class-id>'. |
|
2967 |
aStream nextPutLine:'</comment>'. |
|
2968 |
]. |
|
2969 |
"/ |
|
2970 |
"/ primitive definitions - if any |
|
2971 |
"/ |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2972 |
"/ self fileOutPrimitiveSpecsOn:aStream. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2973 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2974 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2975 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2976 |
"/ methods from all categories in metaclass (i.e. class methods) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2977 |
"/ EXCEPT: the version method is placed at the very end, to |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2978 |
"/ avoid sourcePosition-shifts when checked out later. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2979 |
"/ (RCS expands this string, so its size is not constant) |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2980 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2981 |
collectionOfCategories := meta categories asSortedCollection. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2982 |
collectionOfCategories notNil ifTrue:[ |
7368 | 2983 |
collectionOfCategories do:[:aCategory | |
2984 |
meta fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2985 |
] |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2986 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2987 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2988 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2989 |
"/ methods from all categories in myself |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2990 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2991 |
collectionOfCategories := self categories asSortedCollection. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2992 |
collectionOfCategories notNil ifTrue:[ |
7368 | 2993 |
collectionOfCategories do:[:aCategory | |
2994 |
self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream. |
|
2995 |
] |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2996 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2997 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2998 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
2999 |
"/ any private classes' methods |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3000 |
"/ |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3001 |
self privateClassesSorted do:[:aClass | |
7368 | 3002 |
aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter |
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3003 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3004 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3005 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3006 |
initIt ifTrue:[ |
7368 | 3007 |
"/ |
3008 |
"/ optionally an initialize message |
|
3009 |
"/ |
|
3010 |
(meta includesSelector:#initialize) ifTrue:[ |
|
3011 |
aStream nextPutLine:'<initialize>'. |
|
3012 |
aStream nextPutAll:'<class-id>'. |
|
3013 |
aStream nextPutAll:(self name). |
|
3014 |
aStream nextPutLine:'</class-id>'. |
|
3015 |
aStream nextPutLine:'</initialize>'. |
|
3016 |
] |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3017 |
]. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3018 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3019 |
aStream nextPutLine:'</st-source>'. |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3020 |
|
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3021 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3022 |
Class |
7368 | 3023 |
fileOutXMLOn:'test.xml' asFilename writeStream |
3024 |
withTimeStamp:true |
|
3025 |
withInitialize:true |
|
3026 |
withDefinition:true |
|
3027 |
methodFilter:nil |
|
5374
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3028 |
" |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3029 |
! ! |
df453d2c7390
first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents:
5370
diff
changeset
|
3030 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3031 |
!Class methodsFor:'printOut'! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3032 |
|
2482 | 3033 |
htmlDocumentation |
7227
5df22f2ffebc
htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents:
7222
diff
changeset
|
3034 |
self obsoleteMethodWarning:'use HTMLDocGenerator htmlDocOf:'. |
5df22f2ffebc
htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents:
7222
diff
changeset
|
3035 |
|
2482 | 3036 |
^ HTMLDocGenerator htmlDocOf:self |
3037 |
||
3038 |
"Created: 22.3.1997 / 14:18:23 / cg" |
|
3039 |
! |
|
3040 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3041 |
printClassVarNamesOn:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3042 |
"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
|
3043 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3044 |
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
|
3045 |
! |
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 |
printFullHierarchyOn:aStream indent:indent |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3048 |
"print myself and all subclasses on aStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3049 |
recursively calls itself to print subclasses. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3050 |
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
|
3051 |
|
1996
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3052 |
|nm| |
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3053 |
|
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3054 |
nm := self name. |
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3055 |
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
|
3056 |
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
|
3057 |
aStream nextPutLine:')'. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3058 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3059 |
(self subclasses sort:[:a :b | a name < b name]) do:[:aSubclass | |
7368 | 3060 |
aSubclass printFullHierarchyOn:aStream indent:(indent + 2) |
557
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 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3063 |
"|printStream| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3064 |
printStream := Printer new. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3065 |
Object printFullHierarchyOn:printStream indent:0. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3066 |
printStream close" |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3067 |
|
1996
9048e53f76d8
use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents:
1994
diff
changeset
|
3068 |
"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
|
3069 |
! |
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 |
printOutDefinitionOn:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3072 |
"print out my definition" |
1 | 3073 |
|
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
3074 |
|comment s superclass| |
333 | 3075 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3076 |
aPrintStream nextPutAll:'class '; bold; nextPutLine:self name; normal. |
1 | 3077 |
aPrintStream nextPutAll:'superclass '. |
6394
492964c0fd9b
instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents:
6386
diff
changeset
|
3078 |
superclass := self superclass. |
1 | 3079 |
superclass isNil ifTrue:[ |
7368 | 3080 |
s := 'Object' |
1 | 3081 |
] ifFalse:[ |
7368 | 3082 |
s := superclass name |
1 | 3083 |
]. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3084 |
aPrintStream nextPutLine:s. |
1 | 3085 |
|
3086 |
aPrintStream nextPutAll:'instance Variables '. |
|
3087 |
self printInstVarNamesOn:aPrintStream indent:21. |
|
3088 |
aPrintStream cr. |
|
3089 |
||
3090 |
aPrintStream nextPutAll:'class Variables '. |
|
3091 |
self printClassVarNamesOn:aPrintStream indent:21. |
|
3092 |
aPrintStream cr. |
|
3093 |
||
3094 |
category notNil ifTrue:[ |
|
7368 | 3095 |
aPrintStream nextPutAll:'category '; |
3096 |
nextPutLine:(category printString). |
|
1 | 3097 |
]. |
3098 |
||
193 | 3099 |
(comment := self comment) notNil ifTrue:[ |
7368 | 3100 |
aPrintStream cr; nextPutLine:'comment:'; italic; nextPutLine:comment; normal |
1 | 3101 |
] |
733
983d045c17f5
make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
3102 |
|
983d045c17f5
make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
3103 |
"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
|
3104 |
"Modified: 9.11.1996 / 00:13:37 / cg" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3105 |
"Modified: 1.4.1997 / 16:01:26 / stefan" |
1 | 3106 |
! |
3107 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3108 |
printOutOn:aPrintStream |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3109 |
"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
|
3110 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3111 |
|collectionOfCategories| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3112 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3113 |
self printOutDefinitionOn:aPrintStream. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3114 |
aPrintStream cr. |
3937 | 3115 |
collectionOfCategories := self class categories asSortedCollection. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3116 |
collectionOfCategories notNil ifTrue:[ |
7368 | 3117 |
aPrintStream nextPutLine:'class protocol'. |
3118 |
aPrintStream cr. |
|
3119 |
collectionOfCategories do:[:aCategory | |
|
3120 |
self class printOutCategory:aCategory on:aPrintStream |
|
3121 |
] |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3122 |
]. |
3937 | 3123 |
collectionOfCategories := self categories asSortedCollection. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3124 |
collectionOfCategories notNil ifTrue:[ |
7368 | 3125 |
aPrintStream nextPutLine:'instance protocol'. |
3126 |
aPrintStream cr. |
|
3127 |
collectionOfCategories do:[:aCategory | |
|
3128 |
self printOutCategory:aCategory on:aPrintStream |
|
3129 |
] |
|
555 | 3130 |
] |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3131 |
|
3937 | 3132 |
"Modified: / 25.11.1998 / 12:40:31 / cg" |
5938
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3133 |
! |
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3134 |
|
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3135 |
storeOn:aStream |
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3136 |
"append my name only - expects class to be there, when restoring" |
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3137 |
|
3217017b7ff4
changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents:
5875
diff
changeset
|
3138 |
aStream nextPutAll:self name |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3139 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3140 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3141 |
!Class methodsFor:'private-accessing'! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3142 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3143 |
attributes |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3144 |
"return the extra class attributes or nil" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3145 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3146 |
attributes isArray ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3147 |
attributes := ClassAttributes new fromSTCPrimitiveArray:attributes. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3148 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3149 |
^ attributes |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3150 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3151 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3152 |
attributes:aClassAttributesObject |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3153 |
"set the extra class attributes" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3154 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3155 |
attributes := aClassAttributesObject |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3156 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3157 |
|
7486 | 3158 |
classAttributes |
3159 |
"return the extra class attributes or nil" |
|
3160 |
||
3161 |
attributes isArray ifTrue:[ |
|
3162 |
attributes := ClassAttributes new fromSTCPrimitiveArray:attributes. |
|
3163 |
]. |
|
3164 |
^ attributes |
|
3165 |
! |
|
3166 |
||
3167 |
classAttributes:aClassAttributesObject |
|
3168 |
"set the extra class attributes" |
|
3169 |
||
3170 |
attributes := aClassAttributesObject |
|
3171 |
! |
|
3172 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3173 |
getAttribute:aKey |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3174 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3175 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3176 |
"get an attribute (by symbolic key)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3177 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3178 |
attributes isNil ifTrue:[ ^ nil]. |
7486 | 3179 |
^ self classAttributes perform:aKey asSymbol |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3180 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3181 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3182 |
getSourceChunkAttribute:aKey |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3183 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3184 |
|
7472 | 3185 |
|pos stream string| |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3186 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3187 |
pos := self getAttribute:aKey. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3188 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3189 |
"the attribute is either a string, or an integer specifying the |
7472 | 3190 |
position within the classes sourcefile ..." |
3191 |
||
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3192 |
pos isNumber ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3193 |
"/ classFilename notNil ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3194 |
stream := self sourceStream. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3195 |
stream notNil ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3196 |
stream position0Based:pos. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3197 |
string := stream nextChunk. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3198 |
stream close. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3199 |
^ string |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3200 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3201 |
"/ ]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3202 |
^ nil |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3203 |
]. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3204 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3205 |
^ pos |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3206 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3207 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3208 |
setAttribute:key to:aValue |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3209 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3210 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3211 |
attributes isNil ifTrue:[ |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3212 |
attributes := ClassAttributes new. |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3213 |
]. |
7486 | 3214 |
self classAttributes perform:(key , ':') asSymbol with:aValue |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3215 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3216 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3217 |
setPrimitiveDefinitions:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3218 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3219 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3220 |
"set the primitiveDefinition string (no change notifications)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3221 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3222 |
^ self setAttribute:#primitiveDefinitions to:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3223 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3224 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3225 |
setPrimitiveFunctions:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3226 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3227 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3228 |
"set the primitiveFunction string (no change notifications)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3229 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3230 |
^ self setAttribute:#primitiveFunctions to:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3231 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3232 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3233 |
setPrimitiveVariables:aString |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3234 |
"{ Pragma: +optSpace }" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3235 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3236 |
"set the primitiveVariable string (no change notifications)" |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3237 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3238 |
^ self setAttribute:#primitiveVariables to:aString |
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3239 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3240 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3241 |
setSuperclass:aClass |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3242 |
"set the superclass of the receiver. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3243 |
this method is for special uses only - there will be no recompilation |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3244 |
and no change record written here. Also, if the receiver class has |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3245 |
already been in use, future operation of the system is not guaranteed to |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3246 |
be correct, since no caches are flushed. |
8072
e7542f2dbb9c
flush cached subclassInfo whenever a superclass changes
Claus Gittinger <cg@exept.de>
parents:
8051
diff
changeset
|
3247 |
Therefore: do NOT use it; use #superclass: (or flush the caches, at least)." |
e7542f2dbb9c
flush cached subclassInfo whenever a superclass changes
Claus Gittinger <cg@exept.de>
parents:
8051
diff
changeset
|
3248 |
|
e7542f2dbb9c
flush cached subclassInfo whenever a superclass changes
Claus Gittinger <cg@exept.de>
parents:
8051
diff
changeset
|
3249 |
SubclassInfo := nil. "/ flush it |
e7542f2dbb9c
flush cached subclassInfo whenever a superclass changes
Claus Gittinger <cg@exept.de>
parents:
8051
diff
changeset
|
3250 |
superclass := aClass |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3251 |
! ! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
3252 |
|
7258 | 3253 |
!Class methodsFor:'private-changes management'! |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3254 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3255 |
addChangeRecordForChangeCategory:category to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3256 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3257 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3258 |
"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
|
3259 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3260 |
self printClassNameOn:aStream. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3261 |
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
|
3262 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3263 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3264 |
"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
|
3265 |
"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
|
3266 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3267 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3268 |
addChangeRecordForClass:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3269 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3270 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3271 |
"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
|
3272 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3273 |
aClass isLoaded ifTrue:[ |
7368 | 3274 |
aClass basicFileOutDefinitionOn:aStream withNameSpace:true. |
3275 |
aStream nextPutChunkSeparator. |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3276 |
] |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3277 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3278 |
"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
|
3279 |
"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
|
3280 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3281 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3282 |
addChangeRecordForClassComment:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3283 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3284 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3285 |
"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
|
3286 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3287 |
aClass fileOutCommentOn:aStream. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3288 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3289 |
"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
|
3290 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3291 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3292 |
addChangeRecordForClassInstvars:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3293 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3294 |
|
5225
d74b4c895376
comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents:
5190
diff
changeset
|
3295 |
"append an instvars-record to aStream" |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3296 |
|
8277
357428ca03c5
classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents:
8267
diff
changeset
|
3297 |
aClass class fileOutClassInstVarDefinitionOn:aStream withNameSpace:true. |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3298 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3299 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3300 |
|
7179 | 3301 |
addChangeRecordForClassRemove:oldClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3302 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3303 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3304 |
"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
|
3305 |
|
7179 | 3306 |
aStream nextPutAll:('Smalltalk removeClass:' , oldClass name). |
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3307 |
aStream nextPutChunkSeparator. |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3308 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3309 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3310 |
addChangeRecordForClassRename:oldName to:newName to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3311 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3312 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3313 |
"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
|
3314 |
|
1846 | 3315 |
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
|
3316 |
aStream nextPutChunkSeparator. |
1846 | 3317 |
|
3318 |
"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
|
3319 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3320 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3321 |
addChangeRecordForPrimitiveDefinitions:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3322 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3323 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3324 |
"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
|
3325 |
|
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3326 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveDefinitions:'''; |
7368 | 3327 |
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
|
3328 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3329 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3330 |
"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
|
3331 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3332 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3333 |
addChangeRecordForPrimitiveFunctions:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3334 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3335 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3336 |
"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
|
3337 |
|
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3338 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveFunctions:'''; |
7368 | 3339 |
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
|
3340 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3341 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3342 |
"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
|
3343 |
! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3344 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3345 |
addChangeRecordForPrimitiveVariables:aClass to:aStream |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3346 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3347 |
|
1113
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3348 |
"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
|
3349 |
|
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3350 |
aStream nextPutAll:aClass name; nextPutLine:' primitiveVariables:'''; |
7368 | 3351 |
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
|
3352 |
aStream nextPutChunkSeparator. |
1951
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3353 |
|
2ece0b1e4710
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
1942
diff
changeset
|
3354 |
"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
|
3355 |
! ! |
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3356 |
|
1237 | 3357 |
!Class methodsFor:'protocol printOut'! |
3358 |
||
3359 |
printOutProtocolOn:aPrintStream |
|
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3360 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3361 |
|
1237 | 3362 |
|collectionOfCategories| |
3363 |
||
3364 |
self printOutDefinitionOn:aPrintStream. |
|
3365 |
aPrintStream cr. |
|
3937 | 3366 |
collectionOfCategories := self class categories asSortedCollection. |
1237 | 3367 |
collectionOfCategories notNil ifTrue:[ |
7368 | 3368 |
aPrintStream nextPutLine:'class protocol'. |
3369 |
aPrintStream cr. |
|
3370 |
collectionOfCategories do:[:aCategory | |
|
3371 |
self class printOutCategoryProtocol:aCategory on:aPrintStream |
|
3372 |
] |
|
1237 | 3373 |
]. |
3937 | 3374 |
collectionOfCategories := self categories asSortedCollection. |
1237 | 3375 |
collectionOfCategories notNil ifTrue:[ |
7368 | 3376 |
aPrintStream nextPutLine:'instance protocol'. |
3377 |
aPrintStream cr. |
|
3378 |
collectionOfCategories do:[:aCategory | |
|
3379 |
self printOutCategoryProtocol:aCategory on:aPrintStream |
|
3380 |
] |
|
1237 | 3381 |
] |
3382 |
||
3937 | 3383 |
"Modified: / 25.11.1998 / 12:40:38 / cg" |
1237 | 3384 |
! ! |
3385 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3386 |
!Class methodsFor:'queries'! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3387 |
|
8167 | 3388 |
classResources |
8185 | 3389 |
self isPrivate ifTrue:[ |
3390 |
^ self owningClass classResources |
|
3391 |
]. |
|
8167 | 3392 |
^ ResourcePack for:self |
3393 |
! |
|
3394 |
||
5545 | 3395 |
hasExtensions |
3396 |
"return true, if there are methods in the receiver, which belong to |
|
3397 |
a different package (i.e. package of class ~= package of method). |
|
3398 |
Those are class extensions, which must be treated specially when checking classes |
|
3399 |
into the sourceCode repository. (extensions are stored separate)" |
|
3400 |
||
6166 | 3401 |
|clsPkg defaultPkg| |
3402 |
||
3403 |
defaultPkg := Project defaultProject package. |
|
3404 |
clsPkg := self package. |
|
6077
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
3405 |
self instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
7368 | 3406 |
|mthdPkg| |
3407 |
||
3408 |
mthdPkg := mthd package. |
|
3409 |
mthdPkg ~= clsPkg ifTrue:[ |
|
3410 |
mthdPkg ~= defaultPkg ifTrue:[ |
|
3411 |
^ true |
|
3412 |
] |
|
3413 |
]. |
|
5545 | 3414 |
]. |
3415 |
^ false |
|
3416 |
||
3417 |
" |
|
3418 |
Smalltalk allClasses select:[:each | each hasExtensions] |
|
3419 |
" |
|
3420 |
! |
|
3421 |
||
5659 | 3422 |
hasExtensionsFrom:aPackageID |
3423 |
"return true, if there are methods in the receiver, which belong to |
|
3424 |
the package with aPackageID (i.e. package of class ~= package of method). |
|
3425 |
Those are class extensions, which must be treated specially when checking classes |
|
3426 |
into the sourceCode repository. (extensions are stored separate)" |
|
3427 |
||
6077
d777721e42c8
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6023
diff
changeset
|
3428 |
self instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
7368 | 3429 |
mthd package = aPackageID ifTrue:[^ true]. |
5659 | 3430 |
]. |
3431 |
^ false |
|
3432 |
||
3433 |
" |
|
3434 |
Smalltalk allClasses select:[:each | each hasExtensionsFrom:'stx:goodies/refactyBrowser'] |
|
3435 |
" |
|
3436 |
! |
|
3437 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3438 |
isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3439 |
"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
|
3440 |
(a real class, not just behavior); |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3441 |
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
|
3442 |
See also Behavior>>isBehavior." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3443 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3444 |
^ true |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3445 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3446 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3447 |
Point isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3448 |
1 isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3449 |
Behavior new isBehavior |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3450 |
Behavior new isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3451 |
Class new isBehavior |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3452 |
Class new isClass |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3453 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3454 |
! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3455 |
|
6723 | 3456 |
isStartableWithMain |
3457 |
"return true, if this is an application class, |
|
3458 |
which can be started via #main" |
|
3459 |
||
3460 |
^ self theMetaclass includesSelector:#main |
|
3461 |
||
3462 |
"Created: / 2.11.2001 / 09:37:01 / cg" |
|
3463 |
"Modified: / 2.11.2001 / 09:48:05 / cg" |
|
3464 |
! |
|
3465 |
||
2568
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3466 |
rootsOfTheWorld |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3467 |
"return a collection of classes which have a nil superclass" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3468 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3469 |
|set| |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3470 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3471 |
set := IdentitySet new. |
5581 | 3472 |
Smalltalk allClassesDo:[:aClass | |
7368 | 3473 |
aClass superclass isNil ifTrue:[set add:aClass] |
2568
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3474 |
]. |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3475 |
^ set asOrderedCollection |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3476 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3477 |
" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3478 |
Class rootsOfTheWorld |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3479 |
" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3480 |
|
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3481 |
"Modified: 18.4.1997 / 20:55:34 / cg" |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3482 |
! |
9b7a3a08b8ca
added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
3483 |
|
7435
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3484 |
subclasses |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3485 |
"return a collection of the direct subclasses of the receiver" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3486 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3487 |
|newColl| |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3488 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3489 |
"/ use cached information (avoid class hierarchy search) |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3490 |
"/ if possible |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3491 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3492 |
SubclassInfo notNil ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3493 |
newColl := SubclassInfo at:self ifAbsent:nil. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3494 |
newColl notNil ifTrue:[^ newColl asOrderedCollection] |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3495 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3496 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3497 |
newColl := OrderedCollection new. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3498 |
self subclassesDo:[:aClass | |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3499 |
newColl add:aClass |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3500 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3501 |
SubclassInfo notNil ifTrue:[ |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3502 |
SubclassInfo at:self put:newColl. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3503 |
]. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3504 |
^ newColl |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3505 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3506 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3507 |
Class flushSubclassInfo. |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3508 |
Collection subclasses |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3509 |
" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3510 |
|
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3511 |
"Modified: 22.1.1997 / 18:43:52 / cg" |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3512 |
! |
c5afb1b0fd1b
Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents:
7371
diff
changeset
|
3513 |
|
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3514 |
wasAutoloaded |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3515 |
"return true, if this class came into the system via an |
555 | 3516 |
autoload; false otherwise. |
3517 |
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
|
3518 |
Autoload. The interface here is for your convenience." |
555 | 3519 |
|
3520 |
^ 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
|
3521 |
|
840b03d131d7
category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents:
1107
diff
changeset
|
3522 |
"Modified: 21.3.1996 / 16:27:09 / cg" |
555 | 3523 |
! |
3524 |
||
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3525 |
whichClassDefinesClassVar:aVariableName |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3526 |
"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
|
3527 |
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
|
3528 |
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
|
3529 |
many throw away intermediate objects." |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3530 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3531 |
|cls| |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3532 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3533 |
cls := self. |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3534 |
[cls notNil] whileTrue:[ |
7368 | 3535 |
(cls classVarNames includes:aVariableName) ifTrue:[ ^ cls]. |
3536 |
cls := cls superclass |
|
556 | 3537 |
]. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3538 |
^ nil |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3539 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3540 |
" |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3541 |
StandardSystemView whichClassDefinesClassVar:'ErrorSignal' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3542 |
StandardSystemView whichClassDefinesClassVar:'Foo' |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3543 |
" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3544 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3545 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3546 |
!Class methodsFor:'renaming'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3547 |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3548 |
makePrivateIn:newOwner |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3549 |
"make a private class of newOwner from the receiver; |
5612 | 3550 |
the receiver must be a public class. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3551 |
Returns the new private class." |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3552 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3553 |
|sel newClass| |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3554 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3555 |
self owningClass notNil ifTrue:[ |
7368 | 3556 |
^ self |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3557 |
]. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3558 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3559 |
sel := self definitionSelectorPrivate. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3560 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3561 |
newClass := self superclass |
7368 | 3562 |
perform:sel |
3563 |
withArguments:(Array |
|
3564 |
with:(self nameWithoutPrefix asSymbol) |
|
3565 |
with:(self instanceVariableString) |
|
3566 |
with:(self classVariableString) |
|
3567 |
with:'' |
|
3568 |
with:newOwner). |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3569 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3570 |
"/ copy over methods ... |
6023 | 3571 |
ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class. |
3572 |
ClassBuilder copyInvalidatedMethodsFrom:self for:newClass. |
|
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3573 |
newClass class recompileInvalidatedMethods. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3574 |
newClass recompileInvalidatedMethods. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3575 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3576 |
newOwner changed:#newClass with:newClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3577 |
Smalltalk changed:#newClass with:newClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3578 |
|
2835 | 3579 |
self removeFromSystem. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3580 |
^ newClass |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3581 |
|
3494
23a6cf28b3a6
fixed makePrivate, if newOwner is in a nameSpace
Claus Gittinger <cg@exept.de>
parents:
3407
diff
changeset
|
3582 |
"Modified: / 29.5.1998 / 19:03:49 / cg" |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3583 |
! |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3584 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3585 |
makePublic |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3586 |
"make a public class from the receiver. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3587 |
The receiver must be a private class. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3588 |
Returns the new public class." |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3589 |
|
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3590 |
^ self makePublicIn:Smalltalk |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3591 |
! |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3592 |
|
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3593 |
makePublicIn:aNameSpace |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3594 |
"make a public class from the receiver. |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3595 |
The receiver must be a private class. |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3596 |
Returns the new public class." |
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3597 |
|
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3598 |
|sel owner newName newClass| |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3599 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3600 |
owner := self topOwningClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3601 |
owner isNil ifTrue:[^ self]. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3602 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3603 |
"/ first, create the public class ... |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3604 |
sel := self definitionSelector. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3605 |
|
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3606 |
Class nameSpaceQuerySignal answer:aNameSpace |
3044 | 3607 |
do:[ |
7368 | 3608 |
(aNameSpace isNil or:[aNameSpace == Smalltalk]) ifTrue:[ |
3609 |
newName := self nameWithoutPrefix |
|
3610 |
] ifFalse:[ |
|
3611 |
newName := aNameSpace name , '::' , self nameWithoutPrefix |
|
3612 |
]. |
|
3613 |
newClass := self superclass |
|
3614 |
perform:sel |
|
3615 |
withArguments:(Array |
|
3616 |
with:(newName asSymbol) |
|
3617 |
with:(self instanceVariableString) |
|
3618 |
with:(self classVariableString) |
|
3619 |
with:'' |
|
3620 |
with:(owner category)). |
|
3621 |
||
3622 |
"/ copy over methods ... |
|
3623 |
ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class. |
|
3624 |
ClassBuilder copyInvalidatedMethodsFrom:self for:newClass. |
|
3625 |
newClass class recompileInvalidatedMethods. |
|
3626 |
newClass recompileInvalidatedMethods. |
|
3044 | 3627 |
]. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3628 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3629 |
owner changed:#newClass with:newClass. |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3630 |
Smalltalk changed:#newClass with:newClass. |
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3631 |
(aNameSpace notNil and:[aNameSpace ~~ Smalltalk]) ifTrue:[ |
7368 | 3632 |
aNameSpace changed:#newClass with:newClass. |
5703
36c0ae8ba8d6
added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents:
5660
diff
changeset
|
3633 |
]. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3634 |
|
2835 | 3635 |
self removeFromSystem. |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3636 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3637 |
^ newClass |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3638 |
|
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3639 |
"Created: 23.6.1997 / 13:28:52 / cg" |
3044 | 3640 |
"Modified: 20.10.1997 / 21:43:38 / cg" |
2712
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3641 |
! |
32c381e81547
added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
3642 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3643 |
renameTo:newName |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3644 |
"change the name of the class. This does not write a change record." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3645 |
|
5863 | 3646 |
<resource:#obsolete> |
3647 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3648 |
|oldSym newSym| |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3649 |
|
2835 | 3650 |
"/ the code below is obsolete - it does not deal with |
3651 |
"/ classVariables, private classes and does not |
|
5863 | 3652 |
"/ recompile other classes in order to care for namespace |
2835 | 3653 |
"/ changes. |
3702 | 3654 |
"/ Please use Smalltalk>>renameClass:to:, |
3655 |
"/ which deals with all of that. |
|
3656 |
self obsoleteMethodWarning:'use Smalltalk>>renameClass:to:'. |
|
2835 | 3657 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3658 |
oldSym := name asSymbol. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3659 |
newSym := newName asSymbol. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3660 |
self setName:newSym. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3661 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3662 |
Smalltalk at:oldSym put:nil. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3663 |
Smalltalk removeKey:oldSym. "26.jun 93" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3664 |
Smalltalk at:newSym put:self. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3665 |
|
3702 | 3666 |
"Created: / 1.4.1997 / 15:27:53 / stefan" |
3667 |
"Modified: / 31.7.1998 / 15:21:34 / cg" |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3668 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3669 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3670 |
!Class methodsFor:'signature checking'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3671 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3672 |
classinstSizeFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3673 |
"for checking class compatibility: return some number based on |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3674 |
the classinstSize from a signature key (not always the real classinstsize)." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3675 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3676 |
^ (aSignature bitShift:-7) bitAnd:7 |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3677 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3678 |
"Created: 1.4.1997 / 15:23:01 / stefan" |
556 | 3679 |
! |
3680 |
||
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3681 |
instNameKeyFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3682 |
"for checking class compatibility: return a number based on the |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3683 |
names and order of the instance variables from a signature key." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3684 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3685 |
^ (aSignature bitShift:-14) bitAnd:16rFFFF |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3686 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3687 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3688 |
Point instNameKeyFromSignature:Point signature. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3689 |
Association instNameKeyFromSignature:Association signature. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3690 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3691 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3692 |
"Created: 1.4.1997 / 15:23:07 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3693 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3694 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3695 |
instSizeFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3696 |
"for checking class compatibility: return the some number based on |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3697 |
the instSize from a signature key (not always the real instSize)." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3698 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3699 |
^ aSignature bitAnd:16r7F |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3700 |
|
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3701 |
" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3702 |
Class instSizeFromSignature:Point signature. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3703 |
Class instSizeFromSignature:Association signature. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3704 |
Class instSizeFromSignature:Dictionary signature. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3705 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3706 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3707 |
"Created: 1.4.1997 / 15:23:15 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3708 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3709 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3710 |
instTypeFromSignature:aSignature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3711 |
"for checking class compatibility: return some number based on |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3712 |
the instType (i.e. variableBytes/Pointers etc.) from a signature key." |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3713 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3714 |
^ (aSignature bitShift:-10) bitAnd:(Class maskIndexType) |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3715 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3716 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3717 |
Class instTypeFromSignature:Object signature. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3718 |
Class instTypeFromSignature:Array signature. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3719 |
Class instTypeFromSignature:String signature. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3720 |
Class instTypeFromSignature:OrderedCollection signature. |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3721 |
" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3722 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3723 |
"Created: 1.4.1997 / 15:23:20 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3724 |
! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3725 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3726 |
signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3727 |
"return a signature number - this number is useful for a quick |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3728 |
check for changed classes, and is done in the binary-object loader, |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3729 |
and the dynamic class loader. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3730 |
Do NOT change the algorithm here - others may depend on it. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3731 |
Also, the algorithm may change - so never interpret the returned value |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3732 |
(if at all, use the access #XXXFromSignature: methods)" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3733 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3734 |
|value "{ Class: SmallInteger }" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3735 |
nameKey "{ Class: SmallInteger }" | |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3736 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3737 |
signature notNil ifTrue:[^ signature]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3738 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3739 |
value := self flags bitAnd:(Class maskIndexType). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3740 |
value := (value bitShift:3) + ((self class instSize - Class instSize) bitAnd:7). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3741 |
value := (value bitShift:7) + (self instSize bitAnd:16r7F). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3742 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3743 |
nameKey := 0. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3744 |
self allInstVarNames do:[:name | |
8102
e0537422e2d3
Use the ANSI-blessed #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
8085
diff
changeset
|
3745 |
nameKey := nameKey bitShift:1. |
e0537422e2d3
Use the ANSI-blessed #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
8085
diff
changeset
|
3746 |
(nameKey bitAnd:16r10000) ~~ 0 ifTrue:[ |
e0537422e2d3
Use the ANSI-blessed #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
8085
diff
changeset
|
3747 |
nameKey := nameKey bitXor:1. |
e0537422e2d3
Use the ANSI-blessed #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
8085
diff
changeset
|
3748 |
nameKey := nameKey bitAnd:16rFFFF. |
e0537422e2d3
Use the ANSI-blessed #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
8085
diff
changeset
|
3749 |
]. |
e0537422e2d3
Use the ANSI-blessed #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
8085
diff
changeset
|
3750 |
nameKey := (nameKey + (name at:1) codePoint) bitAnd:16rFFFF. |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3751 |
]. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3752 |
value := value + (nameKey bitShift:14). |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3753 |
signature := value. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3754 |
^ value |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3755 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3756 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3757 |
Array signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3758 |
ByteArray signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3759 |
View signature |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3760 |
" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3761 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3762 |
"Created: 1.4.1997 / 15:23:24 / stefan" |
557
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3763 |
! ! |
0d93da4afc03
previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents:
556
diff
changeset
|
3764 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3765 |
!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
|
3766 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3767 |
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
|
3768 |
"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
|
3769 |
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
|
3770 |
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
|
3771 |
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
|
3772 |
|
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
3773 |
|owner info c| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
3774 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
3775 |
(owner := self owningClass) notNil ifTrue:[^ owner binaryRevision]. |
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
3776 |
revision notNil ifTrue:[ |
7368 | 3777 |
c := revision first. |
3778 |
c == $$ ifTrue:[ |
|
3779 |
info := Class revisionInfoFromString:revision. |
|
3780 |
info isNil ifTrue:[^ '0']. |
|
3781 |
^ info at:#revision ifAbsent:'0'. |
|
3782 |
]. |
|
3783 |
c isDigit ifFalse:[ |
|
3784 |
^ '0' |
|
3785 |
]. |
|
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
3786 |
]. |
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
3787 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3788 |
^ 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
|
3789 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3790 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3791 |
Object binaryRevision |
953
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
3792 |
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
|
3793 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3794 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3795 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3796 |
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
|
3797 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3798 |
|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
|
3799 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3800 |
classes := Smalltalk allClasses |
7368 | 3801 |
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
|
3802 |
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
|
3803 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3804 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3805 |
"Created: 7.12.1995 / 10:58:47 / cg" |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
3806 |
"Modified: 1.4.1997 / 23:33:01 / stefan" |
2909 | 3807 |
"Modified: 9.9.1997 / 12:05:41 / cg" |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3808 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3809 |
|
5183 | 3810 |
currentSourceStream |
3811 |
"return an open stream on the current source of the receiver" |
|
3812 |
||
3813 |
|theWriteStream theCurrentSource| |
|
3814 |
||
8222
f2c454a9a038
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
8212
diff
changeset
|
3815 |
theWriteStream := String writeStream. |
5183 | 3816 |
Method flushSourceStreamCache. |
3817 |
self fileOutOn:theWriteStream withTimeStamp:false. |
|
3818 |
theCurrentSource := theWriteStream contents asString. |
|
3819 |
theWriteStream close. |
|
3820 |
^ theCurrentSource |
|
3821 |
||
3822 |
"Modified: 15.10.1996 / 18:59:40 / cg" |
|
3823 |
"Modified: 1.4.1997 / 14:33:12 / stefan" |
|
3824 |
! |
|
3825 |
||
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3826 |
localSourceStreamFor:sourceFile |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3827 |
"return an open stream on a local sourcefile, nil if that is not available" |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3828 |
|
5073 | 3829 |
|fileName info module dir fn package packageDir zar entry| |
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3830 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3831 |
"/ |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3832 |
"/ old: look in 'source/<filename>' |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3833 |
"/ this is still kept in order to find user-private |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3834 |
"/ classes in her currentDirectory. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3835 |
"/ |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3836 |
fileName := Smalltalk getSourceFileName:sourceFile. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3837 |
fileName notNil ifTrue:[ |
7368 | 3838 |
^ fileName asFilename readStreamOrNil. |
3165
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
3839 |
]. |
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
3840 |
|
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
3841 |
(package := self package) notNil ifTrue:[ |
7368 | 3842 |
"/ newest sceme ... |
3843 |
packageDir := package copyReplaceAll:$: with:$/. |
|
3844 |
packageDir := Smalltalk getPackageFileName:packageDir. |
|
3845 |
packageDir notNil ifTrue:[ |
|
3846 |
"/ present there ? |
|
3847 |
packageDir := packageDir asFilename. |
|
3848 |
(fn := packageDir construct:sourceFile) exists ifTrue:[ |
|
3849 |
^ fn readStreamOrNil. |
|
3850 |
]. |
|
5073 | 3851 |
|
7368 | 3852 |
"/ a source subdirectory ? |
3853 |
fn := (packageDir construct:'source') construct:sourceFile. |
|
3854 |
fn exists ifTrue:[ |
|
3855 |
^ fn readStreamOrNil. |
|
3856 |
]. |
|
3857 |
||
3858 |
"/ a zip-file ? |
|
3859 |
fn := (packageDir construct:'source.zip'). |
|
3860 |
fn exists ifTrue:[ |
|
3861 |
zar := ZipArchive oldFileNamed:fn. |
|
3862 |
zar notNil ifTrue:[ |
|
3863 |
entry := zar extract:sourceFile. |
|
3864 |
entry notNil ifTrue:[ |
|
3865 |
^ entry asString readStream |
|
3866 |
] |
|
3867 |
] |
|
3868 |
] |
|
3869 |
]. |
|
3870 |
||
3871 |
"/ will vanish ... |
|
3872 |
(package includes:$:) ifTrue:[ |
|
3873 |
package := package asString copyReplaceAll:$: with:$/ |
|
3874 |
] ifFalse:[ |
|
3875 |
package := 'stx/' , package |
|
3876 |
]. |
|
3877 |
fileName := Smalltalk getSourceFileName:(package , '/' , sourceFile). |
|
3878 |
fileName notNil ifTrue:[ |
|
3879 |
^ fileName asFilename readStreamOrNil. |
|
3880 |
]. |
|
3881 |
(package startsWith:'stx/') ifTrue:[ |
|
3882 |
fileName := Smalltalk getSourceFileName:((package copyFrom:5) , '/' , sourceFile). |
|
3883 |
fileName notNil ifTrue:[ |
|
3884 |
^ fileName asFilename readStreamOrNil. |
|
3885 |
] |
|
3886 |
] |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3887 |
]. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3888 |
|
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3889 |
"/ |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3890 |
"/ new: look in 'source/<module>/<package>/<filename> |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3891 |
"/ this makes the symbolic links to (or copy of) the source files |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3892 |
"/ obsolete. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3893 |
info := self packageSourceCodeInfo. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3894 |
info notNil ifTrue:[ |
7368 | 3895 |
module := info at:#module ifAbsent:nil. |
3896 |
module notNil ifTrue:[ |
|
3897 |
dir := info at:#directory ifAbsent:nil. |
|
3898 |
dir notNil ifTrue:[ |
|
3899 |
fn := (module asFilename construct:dir) construct:sourceFile. |
|
3900 |
fileName := Smalltalk getSourceFileName:(fn name). |
|
3901 |
fileName notNil ifTrue:[ |
|
3902 |
^ fileName asFilename readStreamOrNil. |
|
3903 |
]. |
|
3904 |
||
3905 |
"/ brand new: look for source/<module>/package.zip |
|
3906 |
"/ containing an entry for <filename> |
|
3907 |
||
3908 |
fn := (module asFilename construct:dir) withSuffix:'zip'. |
|
3909 |
fileName := Smalltalk getSourceFileName:(fn name). |
|
3910 |
fileName notNil ifTrue:[ |
|
3911 |
zar := ZipArchive oldFileNamed:fileName. |
|
3912 |
zar notNil ifTrue:[ |
|
3913 |
entry := zar extract:sourceFile. |
|
3914 |
entry notNil ifTrue:[ |
|
3915 |
^ entry asString readStream |
|
3916 |
] |
|
3917 |
] |
|
3918 |
]. |
|
3919 |
||
3920 |
"/ and also in source/source.zip ... |
|
3921 |
||
3922 |
fileName := Smalltalk getSourceFileName:'source.zip'. |
|
3923 |
fileName notNil ifTrue:[ |
|
3924 |
zar := ZipArchive oldFileNamed:fileName. |
|
3925 |
zar notNil ifTrue:[ |
|
3926 |
entry := zar extract:sourceFile. |
|
3927 |
entry notNil ifTrue:[ |
|
3928 |
^ entry asString readStream |
|
3929 |
] |
|
3930 |
] |
|
3931 |
]. |
|
3932 |
] |
|
3933 |
] |
|
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3934 |
]. |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3935 |
^ nil |
3165
b6bde90005a8
also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents:
3064
diff
changeset
|
3936 |
|
3657 | 3937 |
"Modified: / 18.7.1998 / 22:53:19 / cg" |
2955
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3938 |
! |
6411d359b747
Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents:
2917
diff
changeset
|
3939 |
|
7174
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
3940 |
nameOfVersionMethod |
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
3941 |
^ #version |
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
3942 |
! |
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
3943 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3944 |
packageSourceCodeInfo |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3945 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3946 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3947 |
"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
|
3948 |
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
|
3949 |
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
|
3950 |
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
|
3951 |
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
|
3952 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3953 |
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
|
3954 |
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
|
3955 |
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
|
3956 |
(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
|
3957 |
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
|
3958 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3959 |
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
|
3960 |
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
|
3961 |
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
|
3962 |
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
|
3963 |
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
|
3964 |
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
|
3965 |
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
|
3966 |
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
|
3967 |
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
|
3968 |
(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
|
3969 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3970 |
For example: |
8085 | 3971 |
'....(libbasic)' -> module: stx directory: libbasic library: libbasic |
3972 |
'....(stx:libbasic)' -> module: stx directory: libbasic library: libbasic |
|
3973 |
'....(stx:foo:libbfoo)' -> module: stx directory: foo library: libfoo |
|
3974 |
'....(aeg:libIECInterface)' -> module: aeg directory: libIECInterface library:libIECInterface |
|
3975 |
'....(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
|
3976 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3977 |
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
|
3978 |
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
|
3979 |
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
|
3980 |
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
|
3981 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3982 |
Caveat: |
8085 | 3983 |
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
|
3984 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3985 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
3986 |
|owner sourceInfo packageString idx1 idx2 |
4116 | 3987 |
moduleString directoryString libraryString components component1 component2 dirComponents mgr| |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3988 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
3989 |
(owner := self owningClass) notNil ifTrue:[^ owner packageSourceCodeInfo]. |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
3990 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3991 |
package isNil ifTrue:[^ nil]. |
8085 | 3992 |
package == (Project noProjectID) ifTrue:[^ nil]. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3993 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
3994 |
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
|
3995 |
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
|
3996 |
idx1 ~~ 0 ifTrue:[ |
8085 | 3997 |
idx2 := packageString indexOf:$) startingAt:idx1+1. |
3998 |
idx2 ~~ 0 ifTrue:[ |
|
3999 |
sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1 |
|
4000 |
] |
|
2453
603af5a4e0fc
handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents:
2444
diff
changeset
|
4001 |
] ifFalse:[ |
8085 | 4002 |
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
|
4003 |
]. |
2453
603af5a4e0fc
handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents:
2444
diff
changeset
|
4004 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4005 |
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
|
4006 |
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
|
4007 |
components size == 0 ifTrue:[ |
2958
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
4008 |
"/ moduleString := 'stx'. |
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
4009 |
"/ directoryString := libraryString := ''. |
8085 | 4010 |
^ nil |
2454 | 4011 |
]. |
4116 | 4012 |
|
4013 |
component1 := components at:1. |
|
2454 | 4014 |
components size == 1 ifTrue:[ |
8085 | 4015 |
"/ a single name given - the module becomes 'stx' or |
4016 |
"/ the very first directory component (if such a module exists). |
|
4017 |
"/ If the component includes slashes, its the directory |
|
4018 |
"/ otherwise the library. |
|
4019 |
"/ |
|
4020 |
dirComponents := Filename concreteClass components:component1. |
|
4021 |
(dirComponents size > 1 |
|
4022 |
and:[(mgr := self sourceCodeManager) notNil |
|
4023 |
and:[mgr checkForExistingModule:dirComponents first]]) ifTrue:[ |
|
4024 |
moduleString := dirComponents first. |
|
4025 |
directoryString := libraryString := (Filename fromComponents:(dirComponents copyFrom:2)) asString. |
|
4026 |
] ifFalse:[ |
|
4027 |
"/ non-existing; assume directory under the stx package. |
|
4028 |
moduleString := 'stx'. |
|
4029 |
(component1 startsWith:'stx/') ifTrue:[ |
|
4030 |
component1 := component1 copyFrom:5 |
|
4031 |
]. |
|
4032 |
directoryString := libraryString := component1. |
|
4033 |
]. |
|
4034 |
||
4035 |
(libraryString includes:$/) ifTrue:[ |
|
4036 |
libraryString := libraryString asFilename baseName |
|
4037 |
] |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4038 |
] ifFalse:[ |
8085 | 4039 |
component2 := components at:2. |
4040 |
components size == 2 ifTrue:[ |
|
4041 |
"/ two components - assume its the module and the directory; |
|
4042 |
"/ the library is assumed to be named after the directory |
|
4043 |
"/ except, if slashes are in the name; then the libraryname |
|
4044 |
"/ is the last component. |
|
4045 |
"/ |
|
4046 |
moduleString := component1. |
|
4047 |
directoryString := libraryString := component2. |
|
4048 |
(libraryString includes:$/) ifTrue:[ |
|
4049 |
libraryString := libraryString asFilename baseName |
|
4050 |
] |
|
4051 |
] ifFalse:[ |
|
4052 |
"/ all components given |
|
4053 |
moduleString := component1. |
|
4054 |
directoryString := component2. |
|
4055 |
libraryString := components at:3. |
|
4056 |
] |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4057 |
]. |
2454 | 4058 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4059 |
libraryString isEmpty ifTrue:[ |
8085 | 4060 |
directoryString notEmpty ifTrue:[ |
4061 |
libraryString := directoryString asFilename baseName |
|
4062 |
]. |
|
4063 |
libraryString isEmpty ifTrue:[ |
|
4064 |
"/ lets extract the library from the liblist file ... |
|
4065 |
libraryString := Smalltalk libraryFileNameOfClass:self. |
|
4066 |
libraryString isNil ifTrue:[^ nil]. |
|
4067 |
] |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4068 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4069 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4070 |
moduleString isEmpty ifTrue:[ |
8085 | 4071 |
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
|
4072 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4073 |
directoryString isEmpty ifTrue:[ |
8085 | 4074 |
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
|
4075 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4076 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4077 |
^ IdentityDictionary |
8085 | 4078 |
with:(#module->moduleString) |
4079 |
with:(#directory->directoryString) |
|
4080 |
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
|
4081 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4082 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4083 |
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
|
4084 |
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
|
4085 |
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
|
4086 |
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
|
4087 |
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
|
4088 |
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
|
4089 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4090 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4091 |
"Created: 4.11.1995 / 20:36:53 / cg" |
2958
ccfef4e0bd4a
use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents:
2955
diff
changeset
|
4092 |
"Modified: 19.9.1997 / 10:42:25 / cg" |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4093 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4094 |
|
7866 | 4095 |
resourceDirectory |
4096 |
"return the directory where my resource file is supposed to live. |
|
4097 |
Here, take the package and assume that a directory named 'resources' exists |
|
4098 |
in my package directory. |
|
4099 |
Return nil, if no such directory exists." |
|
4100 |
||
4101 |
|prjDir rsrcDir| |
|
4102 |
||
8267 | 4103 |
prjDir := Smalltalk projectDirectoryForPackage:self resourcePackage. |
7866 | 4104 |
|
4105 |
(prjDir notNil |
|
4106 |
and:[(prjDir := prjDir asFilename) exists |
|
4107 |
and:[(rsrcDir := prjDir construct:'resources') exists]]) ifTrue:[ |
|
4108 |
^ rsrcDir |
|
4109 |
]. |
|
4110 |
^ nil |
|
4111 |
||
4112 |
" |
|
4113 |
Object resourceDirectory |
|
4114 |
View resourceDirectory |
|
4115 |
ApplicationModel resourceDirectory |
|
4116 |
" |
|
4117 |
! |
|
4118 |
||
3248
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4119 |
resourcePackName |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4120 |
"return the name which is used as the fileNameBase of my resource file. |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4121 |
Notice, that this will undergo the same name translation process as |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4122 |
done with class-source file names. (see ResourcePack). |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4123 |
The default here is the classes name - this can be redefined in classes |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4124 |
which want use another classes resources (NewLauncher -> Launcher)." |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4125 |
|
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4126 |
^ self name |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4127 |
|
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4128 |
"Created: / 29.1.1998 / 22:20:12 / cg" |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4129 |
! |
99c249e6a797
provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents:
3229
diff
changeset
|
4130 |
|
8267 | 4131 |
resourcePackage |
4132 |
"return the package from where my resources are loaded. |
|
4133 |
By default, that is the classes package." |
|
4134 |
||
4135 |
^ self package |
|
4136 |
! |
|
4137 |
||
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4138 |
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
|
4139 |
"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
|
4140 |
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
|
4141 |
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
|
4142 |
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
|
4143 |
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
|
4144 |
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
|
4145 |
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
|
4146 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4147 |
|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
|
4148 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4149 |
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
|
4150 |
info notNil ifTrue:[ |
7368 | 4151 |
^ info at:#revision ifAbsent:nil |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4152 |
]. |
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4153 |
^ self binaryRevision |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4154 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4155 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4156 |
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
|
4157 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4158 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4159 |
"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
|
4160 |
"Modified: 12.12.1995 / 20:30:20 / cg" |
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4161 |
"Modified: 26.3.1997 / 00:14:00 / stefan" |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4162 |
! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4163 |
|
2582 | 4164 |
revisionDateString |
4165 |
"return the revision-Date of the class as a string. |
|
4166 |
This is extracted from the version string." |
|
4167 |
||
4168 |
|info| |
|
4169 |
||
4170 |
info := self revisionInfo. |
|
4171 |
info notNil ifTrue:[ |
|
7368 | 4172 |
^ info at:#date ifAbsent:'??/??/??' |
2582 | 4173 |
]. |
4174 |
^ '??/??/??' |
|
4175 |
||
4176 |
" |
|
4177 |
Object revisionDateString |
|
4178 |
" |
|
4179 |
||
4180 |
"Created: 23.4.1997 / 12:29:21 / cg" |
|
4181 |
! |
|
4182 |
||
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4183 |
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
|
4184 |
"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
|
4185 |
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
|
4186 |
The revisionInfo contains all or a subset of: |
7368 | 4187 |
#binaryRevision - the revision upon which the binary of this class is based |
4188 |
#revision - the revision upon which the class is based logically |
|
4189 |
(different, if a changed class was checked in, but not yet recompiled) |
|
4190 |
#user - the user who checked in the logical revision |
|
4191 |
#date - the date when the logical revision was checked in |
|
4192 |
#time - the time when the logical revision was checked in |
|
4193 |
#fileName - the classes source file name |
|
4194 |
#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
|
4195 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4196 |
|
2312
2eb583fcbd56
always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents:
2309
diff
changeset
|
4197 |
|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
|
4198 |
|
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 |
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
|
4200 |
vsnString notNil ifTrue:[ |
7368 | 4201 |
mgr := self sourceCodeManager. |
4202 |
mgr notNil ifTrue:[ |
|
4203 |
info := mgr revisionInfoFromString:vsnString |
|
4204 |
] ifFalse:[ |
|
4205 |
info := Class revisionInfoFromString:vsnString. |
|
4206 |
]. |
|
4207 |
info notNil ifTrue:[ |
|
4208 |
info at:#binaryRevision put:self binaryRevision. |
|
4209 |
] |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4210 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4211 |
^ 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
|
4212 |
|
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 |
" |
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 |
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
|
4215 |
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
|
4216 |
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
|
4217 |
" |
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 |
"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
|
4220 |
"Modified: 29.1.1997 / 18:59:12 / cg" |
2500
c217e646447e
'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents:
2493
diff
changeset
|
4221 |
"Modified: 26.3.1997 / 00:13:17 / stefan" |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
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 |
|
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 |
revisionString |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4225 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4226 |
|
773
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 |
"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
|
4228 |
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
|
4229 |
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
|
4230 |
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
|
4231 |
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
|
4232 |
|
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4233 |
|owner cls meta m src val| |
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4234 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4235 |
(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
|
4236 |
|
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 |
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
|
4238 |
|
6150
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4239 |
meta := self theMetaclass. |
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4240 |
cls := self theNonMetaclass. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4241 |
|
7174
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4242 |
m := meta compiledMethodAt:(self nameOfVersionMethod). |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4243 |
m isNil ifTrue:[ |
7368 | 4244 |
"/ no - do NEVER care for a version method on the instance side |
4245 |
"/ m := cls compiledMethodAt:(self nameOfVersionMethod). |
|
4246 |
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
|
4247 |
]. |
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 |
|
1102
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4249 |
m isExecutable ifTrue:[ |
7368 | 4250 |
"/ |
4251 |
"/ if its a method returning the string, |
|
4252 |
"/ thats the returned value |
|
4253 |
"/ |
|
4254 |
val := cls perform:(self nameOfVersionMethod). |
|
4255 |
val isString ifTrue:[^ val]. |
|
1102
6ed4f93420c6
dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents:
1063
diff
changeset
|
4256 |
]. |
773
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 |
|
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 |
"/ |
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 |
"/ 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
|
4260 |
"/ 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
|
4261 |
"/ 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
|
4262 |
"/ 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
|
4263 |
"/ 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
|
4264 |
"/ |
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 |
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
|
4266 |
src isNil ifTrue:[^ nil]. |
1811 | 4267 |
^ 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
|
4268 |
|
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 |
" |
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 |
Smalltalk allClassesDo:[:cls | |
7368 | 4271 |
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
|
4272 |
]. |
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 |
Number revisionString |
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4275 |
FileDirectory revisionString |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4276 |
Metaclass revisionString |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4277 |
" |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4278 |
|
5801 | 4279 |
"Created: / 29.10.1995 / 19:28:03 / cg" |
4280 |
"Modified: / 1.4.1997 / 23:37:25 / stefan" |
|
4281 |
"Modified: / 7.2.2001 / 18:03:39 / ps" |
|
6150
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4282 |
"Modified: / 5.11.2001 / 16:35:56 / cg" |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4283 |
! |
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 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4285 |
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
|
4286 |
"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
|
4287 |
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
|
4288 |
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
|
4289 |
(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
|
4290 |
|
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 |
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
|
4292 |
|
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 |
"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
|
4294 |
! |
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 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4296 |
setPackageFromRevision |
1843
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4297 |
"{ Pragma: +optSpace }" |
15df4adc5b70
some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
4298 |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4299 |
"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
|
4300 |
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
|
4301 |
(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
|
4302 |
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
|
4303 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4304 |
|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
|
4305 |
|
1756 | 4306 |
self owningClass notNil ifTrue:[^ self]. |
4307 |
||
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4308 |
mgr := self sourceCodeManager. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4309 |
mgr notNil ifTrue:[ |
7368 | 4310 |
info := mgr sourceInfoOfClass:self |
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4311 |
]. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4312 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4313 |
info notNil ifTrue:[ |
7368 | 4314 |
mod := info at:#module ifAbsent:nil. "/ stx, aeg, <your-organization> |
4315 |
dir := info at:#directory ifAbsent:nil. "/ libbasic, libtool ... |
|
4316 |
lib := info at:#library ifAbsent:dir. |
|
4317 |
||
4318 |
p := ''. |
|
4319 |
mod notNil ifTrue:[ |
|
4012
e87e53bc45a6
when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents:
3997
diff
changeset
|
4320 |
"/ mod ~= 'stx' ifTrue:[ |
7368 | 4321 |
p := p , mod |
4012
e87e53bc45a6
when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents:
3997
diff
changeset
|
4322 |
"/ ] |
7368 | 4323 |
]. |
4324 |
dir notNil ifTrue:[ |
|
4325 |
p notEmpty ifTrue:[p := p , ':']. |
|
4326 |
p := p , dir. |
|
4327 |
] ifFalse:[ |
|
4328 |
lib notNil ifTrue:[ |
|
4329 |
p notEmpty ifTrue:[p := p , ':']. |
|
4330 |
p := p , lib. |
|
4331 |
]. |
|
4332 |
]. |
|
4333 |
(p notEmpty and:[p ~= package]) ifTrue:[ |
|
2072
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4334 |
"/ package notNil ifTrue:[ |
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4335 |
"/ (name , ': changing packageID from ''' , package , ''' to ''' , p , '''') infoPrintCR. |
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4336 |
"/ ]. |
7368 | 4337 |
package := p. |
4338 |
||
4339 |
self methodDictionary do:[:aMethod | |
|
4340 |
aMethod package isNil ifTrue:[ |
|
4341 |
aMethod setPackage:p |
|
4342 |
] |
|
4343 |
] |
|
4344 |
]. |
|
937
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4345 |
]. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4346 |
^ self |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4347 |
|
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4348 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4349 |
MemoryMonitor autoload. |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4350 |
MemoryMonitor setPackageFromRevision |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4351 |
" |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4352 |
|
1461
dd25bb1e9973
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
1439
diff
changeset
|
4353 |
"Modified: 12.6.1996 / 11:49:31 / stefan" |
2072
e84dbf5e5424
removed package-change info message
Claus Gittinger <cg@exept.de>
parents:
2071
diff
changeset
|
4354 |
"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
|
4355 |
! |
f2243cbb7ae0
set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4356 |
|
8230 | 4357 |
sourceFileSuffix |
4358 |
^ self class sourceFileSuffix |
|
4359 |
! |
|
4360 |
||
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4361 |
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
|
4362 |
"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
|
4363 |
|
8149 | 4364 |
|owner source stream encoding| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4365 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4366 |
(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
|
4367 |
|
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 |
classFilename notNil ifTrue:[ |
8149 | 4369 |
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
|
4370 |
] ifFalse:[ |
8149 | 4371 |
source := (Smalltalk fileNameForClass:self) , '.st' |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4372 |
]. |
8149 | 4373 |
stream := self sourceStreamFor:source. |
4374 |
stream notNil ifTrue:[ |
|
4375 |
"/ see if its utf8 encoded... |
|
4376 |
encoding := SourceCodeManagerUtilities guessEncodingOfStream:stream. |
|
4377 |
(encoding notNil and:[encoding ~~ #'iso8859-1' and:[encoding ~~ #'ascii']]) ifTrue:[ |
|
4378 |
stream := EncodedStream stream:stream encoder:(CharacterEncoder encoderFor:encoding). |
|
4379 |
]. |
|
4380 |
]. |
|
4381 |
^ stream. |
|
953
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4382 |
! |
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4383 |
|
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4384 |
sourceStreamFor:source |
a3c14f2bf1e9
metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents:
944
diff
changeset
|
4385 |
"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
|
4386 |
|
6703 | 4387 |
|owner aStream mgr validated guessedFileName sep mod dir| |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4388 |
|
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4389 |
(owner := self owningClass) notNil ifTrue:[^ owner sourceStreamFor:source]. |
1909 | 4390 |
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
|
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 |
"/ |
892
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4393 |
"/ if there is no SourceCodeManager, |
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4394 |
"/ or TryLocalSourceFirst is true, |
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4395 |
"/ 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
|
4396 |
"/ |
892
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4397 |
((mgr := self sourceCodeManager) isNil |
2b680edcd115
optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents:
888
diff
changeset
|
4398 |
or:[TryLocalSourceFirst == true]) ifTrue:[ |
7368 | 4399 |
aStream := self localSourceStreamFor:source. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
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 |
aStream isNil ifTrue:[ |
7368 | 4403 |
"/ mhmh - still no source file. |
4404 |
"/ If there is a SourceCodeManager, ask it to aquire the |
|
4405 |
"/ the source for my class, and return an open stream on it. |
|
4406 |
"/ if that one does not know about the source, look in |
|
4407 |
"/ standard places |
|
4408 |
||
4409 |
mgr notNil ifTrue:[ |
|
4410 |
classFilename ~= source ifTrue:[ |
|
4411 |
sep := self package indexOfAny:'/\:'. |
|
4412 |
sep ~~ 0 ifTrue:[ |
|
4413 |
mod := package copyTo:sep - 1. |
|
4414 |
dir := package copyFrom:sep + 1. |
|
4415 |
aStream := mgr streamForClass:nil fileName:source revision:nil directory:dir module:mod cache:true. |
|
4416 |
]. |
|
4417 |
]. |
|
4418 |
aStream isNil ifTrue:[ |
|
4419 |
classFilename isNil ifTrue:[ |
|
4420 |
guessedFileName := (Smalltalk fileNameForClass:self) , '.st'. |
|
4421 |
self setClassFilename:guessedFileName. |
|
4422 |
]. |
|
4423 |
source asFilename baseName = classFilename asFilename baseName ifTrue:[ |
|
4424 |
aStream := mgr getSourceStreamFor:self. |
|
4425 |
] |
|
4426 |
]. |
|
4427 |
aStream notNil ifTrue:[ |
|
4428 |
(self validateSourceStream:aStream) ifFalse:[ |
|
4429 |
('Class [info]: repositories source for `' |
|
4430 |
, (self theNonMetaclass name) |
|
4431 |
, ''' is invalid.') infoPrintCR. |
|
4432 |
aStream close. |
|
4433 |
aStream := nil |
|
4434 |
] ifTrue:[ |
|
4435 |
validated := true. |
|
4436 |
]. |
|
4437 |
]. |
|
4438 |
] |
|
5116
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4439 |
]. |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4440 |
|
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4441 |
aStream isNil ifTrue:[ |
7368 | 4442 |
"/ |
4443 |
"/ hard case - there is no source file for this class |
|
4444 |
"/ (in the source-dir-path). |
|
4445 |
"/ |
|
4446 |
||
4447 |
"/ |
|
4448 |
"/ look if my binary is from a dynamically loaded module, |
|
4449 |
"/ and, if so, look in the modules directory for the |
|
4450 |
"/ source file. |
|
4451 |
"/ |
|
4452 |
ObjectFileLoader notNil ifTrue:[ |
|
4453 |
ObjectFileLoader loadedObjectHandlesDo:[:h | |
|
4454 |
|f classes| |
|
4455 |
||
4456 |
aStream isNil ifTrue:[ |
|
4457 |
(classes := h classes) size > 0 ifTrue:[ |
|
4458 |
(classes includes:self) ifTrue:[ |
|
4459 |
f := h pathName. |
|
4460 |
f := f asFilename directory. |
|
4461 |
f := f construct:source. |
|
4462 |
f exists ifTrue:[ |
|
4463 |
aStream := f readStreamOrNil. |
|
4464 |
]. |
|
4465 |
]. |
|
4466 |
]. |
|
4467 |
] |
|
4468 |
]. |
|
4469 |
]. |
|
5116
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4470 |
]. |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4471 |
|
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4472 |
"/ |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4473 |
"/ try along sourcePath |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4474 |
"/ |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4475 |
aStream isNil ifTrue:[ |
7368 | 4476 |
aStream := self localSourceStreamFor:source. |
5116
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4477 |
]. |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4478 |
|
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4479 |
"/ |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4480 |
"/ final chance: try current directory |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4481 |
"/ |
df218693a2dc
always try the sourceCodeManager first (even when fetching a package-
ca
parents:
5073
diff
changeset
|
4482 |
aStream isNil ifTrue:[ |
7368 | 4483 |
aStream := source asFilename readStreamOrNil. |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
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 |
|
1909 | 4486 |
(aStream notNil and:[validated not]) ifTrue:[ |
7368 | 4487 |
(self validateSourceStream:aStream) ifFalse:[ |
4488 |
(Smalltalk releaseIdentification = 'ST/X_free_demo_vsn') ifTrue:[ |
|
3401 | 4489 |
"/ ('Class [info]: source for ''' , self name , ''' is not available in the demo version.') infoPrintCR |
7368 | 4490 |
] ifFalse:[ |
4491 |
('Class [warning]: source for ''' , self name , ''' is invalid or stripped. Take care.') errorPrintCR |
|
4492 |
] |
|
4493 |
]. |
|
1909 | 4494 |
]. |
4744 | 4495 |
(aStream notNil and:[aStream isFileStream]) ifTrue:[ |
7368 | 4496 |
guessedFileName notNil ifTrue:[ |
4497 |
self setClassFilename:(aStream pathName asFilename baseName). |
|
4498 |
] |
|
4744 | 4499 |
]. |
773
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 |
^ 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
|
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 |
" |
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 |
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
|
4504 |
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
|
4505 |
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
|
4506 |
" |
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 |
|
3391 | 4508 |
"Created: / 10.11.1995 / 21:05:13 / cg" |
4509 |
"Modified: / 22.4.1998 / 19:20:50 / ca" |
|
6150
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4510 |
"Modified: / 5.11.2001 / 16:36:30 / cg" |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
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 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4513 |
updateVersionMethodFor:newRevisionString |
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 |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4516 |
"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
|
4517 |
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
|
4518 |
|
4667 | 4519 |
|cls mthd "vs m mgr"| |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4520 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4521 |
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
|
4522 |
self isMeta ifFalse:[ |
7368 | 4523 |
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
|
4524 |
]. |
1754
9ce8fd84ebe8
more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
4525 |
|
7174
a508fa893276
name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents:
7128
diff
changeset
|
4526 |
"/ m := cls compiledMethodAt:(self nameOfVersionMethod). |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4527 |
"/ 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
|
4528 |
"/ 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
|
4529 |
"/ 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
|
4530 |
"/ |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4531 |
"/ (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
|
4532 |
"/ 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
|
4533 |
"/ 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
|
4534 |
|
4606 | 4535 |
Class methodRedefinitionSignal answer:#keep do:[ |
7368 | 4536 |
Class withoutUpdatingChangesDo:[ |
4537 |
mthd := Compiler compile:(self nameOfVersionMethod) , ' |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4538 |
^ ''' , 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
|
4539 |
' |
7368 | 4540 |
forClass:cls |
4541 |
inCategory:#documentation |
|
4542 |
notifying:nil |
|
4543 |
install:true |
|
4544 |
skipIfSame:false |
|
4545 |
silent:true. |
|
4546 |
mthd notNil ifTrue:[ |
|
4547 |
mthd setPackage:self package |
|
4548 |
] |
|
4549 |
] |
|
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4550 |
]. |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4551 |
"/ ('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
|
4552 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4553 |
^ 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
|
4554 |
|
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4555 |
"Created: 7.12.1995 / 20:42:22 / cg" |
1928 | 4556 |
"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
|
4557 |
! |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4558 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4559 |
validateSourceStream:aStream |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4560 |
"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
|
4561 |
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
|
4562 |
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
|
4563 |
|
1766 | 4564 |
|cls meta cannotCheckReason versionMethod info |
7748
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4565 |
versionFromCode versionFromSource oldPos pos src rev |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4566 |
versionMethodsName| |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4567 |
|
6150
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4568 |
meta := self theMetaclass. |
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4569 |
cls := self theNonMetaclass. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4570 |
|
1766 | 4571 |
cannotCheckReason := nil. |
7748
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4572 |
versionMethodsName := self nameOfVersionMethod. |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4573 |
|
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4574 |
versionMethod := meta compiledMethodAt:versionMethodsName. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4575 |
(versionMethod isNil |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4576 |
or:[versionMethod isExecutable not]) ifTrue:[ |
7748
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4577 |
versionMethod := cls compiledMethodAt:versionMethodsName. |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4578 |
(versionMethod isNil |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4579 |
or:[versionMethod isExecutable not]) ifTrue:[ |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4580 |
cannotCheckReason := 'no valid version method'. |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4581 |
] |
2544
c3a2791de289
care for unloaded methods, when validating the source revision
Claus Gittinger <cg@exept.de>
parents:
2516
diff
changeset
|
4582 |
] ifFalse:[ |
7748
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4583 |
"/ |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4584 |
"/ if its a method returning the string, |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4585 |
"/ thats the returned value |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4586 |
"/ |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4587 |
versionFromCode := cls perform:versionMethodsName. |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4588 |
versionFromCode isString ifFalse:[ |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4589 |
cannotCheckReason := 'version method does not return a string' |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4590 |
]. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4591 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4592 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4593 |
"/ |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4594 |
"/ 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
|
4595 |
"/ 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
|
4596 |
"/ 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
|
4597 |
"/ 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
|
4598 |
"/ for the source ... |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4599 |
"/ |
1942 | 4600 |
versionMethod notNil ifTrue:[ |
7748
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4601 |
pos := versionMethod sourcePosition. |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4602 |
pos isInteger ifFalse:[ |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4603 |
"/ mhmh - either no version method, |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4604 |
"/ or updated due to a checkin. |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4605 |
"/ in any case, this should be a good source. |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4606 |
|
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4607 |
^ true. |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4608 |
"/ cannotCheckReason := 'no source position for version-method' |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4609 |
] |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4610 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4611 |
|
1766 | 4612 |
cannotCheckReason notNil ifTrue:[ |
7748
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4613 |
('Class [warning]: ' , cannotCheckReason , ' in ' , self name) infoPrintCR. |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4614 |
'Class [info]: cannot validate source; trusting source' infoPrintCR. |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4615 |
^ true |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4616 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4617 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4618 |
oldPos := aStream position. |
3371
1d8aa07c4b7f
care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents:
3365
diff
changeset
|
4619 |
Stream positionErrorSignal handle:[:ex | |
7748
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4620 |
'Class [info]: position error when accessing source' infoPrintCR. |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4621 |
^ false |
3371
1d8aa07c4b7f
care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents:
3365
diff
changeset
|
4622 |
] do:[ |
7748
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4623 |
aStream position1Based:pos. |
3371
1d8aa07c4b7f
care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents:
3365
diff
changeset
|
4624 |
]. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4625 |
src := aStream nextChunk. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4626 |
aStream position:oldPos. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4627 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4628 |
(src isNil or:[src isEmpty]) ifTrue:[ |
7748
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4629 |
'Class [info]: empty source for version-method' infoPrintCR. |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4630 |
^ false |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4631 |
]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4632 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4633 |
versionFromSource := Class revisionStringFromSource:src. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4634 |
versionFromSource = versionFromCode ifTrue:[^ true]. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4635 |
|
4784 | 4636 |
versionFromSource isNil ifTrue:[ |
7748
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4637 |
'Class [info]: version-from source is nil' infoPrintCR. |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4638 |
^ false |
4784 | 4639 |
]. |
1786 | 4640 |
|
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4641 |
"/ mhmh - check my binary version ... |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4642 |
|
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4643 |
info := Class revisionInfoFromString:versionFromSource. |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4644 |
info notNil ifTrue:[ |
7748
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4645 |
rev := info at:#revision. |
ddbe8a0cd8e5
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
7693
diff
changeset
|
4646 |
rev = self binaryRevision ifTrue:[^ true]. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4647 |
]. |
4784 | 4648 |
'Class [info]: source-version is different from binaryRevision' infoPrintCR. |
1765
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4649 |
^ false |
64e428dbb53d
validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
4650 |
|
6150
4f05c7815f4a
isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents:
6137
diff
changeset
|
4651 |
"Modified: / 5.11.2001 / 16:36:54 / cg" |
773
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4652 |
! ! |
1ff2f5af29cc
category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
4653 |
|
2666
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4654 |
!Class methodsFor:'special accessing'! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4655 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4656 |
setName:aString |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4657 |
"set the classes name - be careful, it will be still |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4658 |
in the Smalltalk dictionary - under another key. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4659 |
This is NOT for general use - see renameTo:" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4660 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4661 |
environment := nil. |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4662 |
name := aString |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4663 |
|
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4664 |
"Created: 1.4.1997 / 15:46:01 / stefan" |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4665 |
! ! |
7981b615b48a
Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents:
2659
diff
changeset
|
4666 |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4667 |
!Class::ClassAttributes methodsFor:'accessing'! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4668 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4669 |
primitiveDefinitions |
7463 | 4670 |
^ primitiveDefinitions |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4671 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4672 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4673 |
primitiveDefinitions:something |
7463 | 4674 |
primitiveDefinitions := something. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4675 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4676 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4677 |
primitiveFunctions |
7463 | 4678 |
^ primitiveFunctions |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4679 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4680 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4681 |
primitiveFunctions:something |
7463 | 4682 |
primitiveFunctions := something. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4683 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4684 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4685 |
primitiveVariables |
7463 | 4686 |
^ primitiveVariables |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4687 |
! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4688 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4689 |
primitiveVariables:something |
7463 | 4690 |
primitiveVariables := something. |
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4691 |
! ! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4692 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4693 |
!Class::ClassAttributes methodsFor:'conversion'! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4694 |
|
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4695 |
fromSTCPrimitiveArray:anArray |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4696 |
"for now, the stc compiler generates a 3-element primitive spec array |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4697 |
(it does not know anything about me). |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4698 |
This method is invoked to convert." |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4699 |
|
7463 | 4700 |
primitiveDefinitions := anArray at:1. |
4701 |
primitiveVariables := anArray at:2. |
|
4702 |
primitiveFunctions := anArray at:3. |
|
7369
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4703 |
! ! |
e8d914774426
primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents:
7368
diff
changeset
|
4704 |
|
1739 | 4705 |
!Class class methodsFor:'documentation'! |
662 | 4706 |
|
4707 |
version |
|
8285 | 4708 |
^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.471 2004-04-02 11:30:22 werner Exp $' |
708
ba92b2a8477d
include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents:
707
diff
changeset
|
4709 |
! ! |