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