author | Stefan Vogel <sv@exept.de> |
Fri, 10 Sep 1999 16:55:36 +0200 | |
changeset 4717 | db56d09f509a |
parent 4716 | e44df17fcbc7 |
child 4770 | 9a6dcf673683 |
permissions | -rw-r--r-- |
1 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
159 | 3 |
All Rights Reserved |
1 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
57 | 13 |
PeekableStream subclass:#PositionableStream |
973 | 14 |
instanceVariableNames:'collection position readLimit writeLimit' |
4405 | 15 |
classVariableNames:'ZeroPosition InvalidPositionErrorSignal ErrorDuringFileInSignal |
16 |
ChunkSeparator' |
|
973 | 17 |
poolDictionaries:'' |
18 |
category:'Streams' |
|
1 | 19 |
! |
20 |
||
1897 | 21 |
!PositionableStream class methodsFor:'documentation'! |
88 | 22 |
|
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
159 | 26 |
All Rights Reserved |
1 | 27 |
|
88 | 28 |
This software is furnished under a license and may be used |
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
10 | 36 |
|
88 | 37 |
documentation |
38 |
" |
|
39 |
Instances of PositionableStream allow positioning the read pointer. |
|
40 |
The PositionableStream class also adds methods for source-chunk reading |
|
41 |
and writing, and for filing-in/out of source code. |
|
3249
8401c3e42165
checkin to force re-checkout.
Claus Gittinger <cg@exept.de>
parents:
3184
diff
changeset
|
42 |
|
88 | 43 |
This is an abstract class. |
1295 | 44 |
|
4405 | 45 |
Compatibility Notice: |
46 |
For historical reasons, ST/X starts with a 1-position (i.e. as in collections), |
|
47 |
while ST-80 uses 0-based postions for streams and 1-based positions for collections. |
|
48 |
||
49 |
THIS CERTAINLY IS BAD. |
|
50 |
To allow for portable code, this method can be asked to return the initial position. |
|
51 |
(for code, which ought to execute under other systems, use: |
|
52 |
posZero := (PositionableStream class respondsTo:#zeroPosition) |
|
53 |
ifTrue:[PositionableStream zeroPosition] |
|
54 |
ifFalse:[0] |
|
55 |
||
1295 | 56 |
[author:] |
4405 | 57 |
Claus Gittinger |
88 | 58 |
" |
59 |
! ! |
|
1 | 60 |
|
1897 | 61 |
!PositionableStream class methodsFor:'initialization'! |
1 | 62 |
|
10 | 63 |
initialize |
44 | 64 |
"setup the signal used to handle errors during fileIn" |
65 |
||
10 | 66 |
ErrorDuringFileInSignal isNil ifTrue:[ |
4405 | 67 |
ErrorDuringFileInSignal := ErrorSignal newSignalMayProceed:true. |
68 |
ErrorDuringFileInSignal nameClass:self message:#errorDuringFileInSignal. |
|
69 |
ErrorDuringFileInSignal notifierString:'error during fileIn'. |
|
276 | 70 |
|
4405 | 71 |
InvalidPositionErrorSignal := PositionErrorSignal newSignalMayProceed:true. |
72 |
InvalidPositionErrorSignal nameClass:self message:#invalidPositionErrorSignal. |
|
73 |
InvalidPositionErrorSignal notifierString:'invalid position'. |
|
2966 | 74 |
|
4405 | 75 |
ChunkSeparator := $!!. |
76 |
||
77 |
ZeroPosition := 1. |
|
10 | 78 |
] |
4405 | 79 |
|
10 | 80 |
! ! |
1 | 81 |
|
1897 | 82 |
!PositionableStream class methodsFor:'instance creation'! |
1 | 83 |
|
84 |
on:aCollection |
|
85 |
"return a new PositionableStream streaming on aCollection" |
|
86 |
||
87 |
^ (self basicNew) on:aCollection |
|
88 |
! |
|
89 |
||
90 |
on:aCollection from:first to:last |
|
91 |
"return a new PositionableStream streaming on aCollection |
|
92 |
from first to last" |
|
93 |
||
369 | 94 |
^ (self basicNew) on:aCollection from:first to:last |
57 | 95 |
! |
96 |
||
97 |
with:aCollection |
|
98 |
"return a new PositionableStream streaming on aCollection, |
|
99 |
the stream is positioned to the end of the collection." |
|
100 |
||
362 | 101 |
^ (self basicNew) with:aCollection |
1 | 102 |
! ! |
103 |
||
3032
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
104 |
!PositionableStream class methodsFor:'Signal constants'! |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
105 |
|
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
106 |
invalidPositionErrorSignal |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
107 |
"return the signal raised if positioning is attempted to an |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
108 |
invalid position (i.e. before the begin of the stream or after |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
109 |
the end)" |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
110 |
|
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
111 |
^ InvalidPositionErrorSignal |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
112 |
! ! |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
113 |
|
1897 | 114 |
!PositionableStream class methodsFor:'constants'! |
1 | 115 |
|
611 | 116 |
chunkSeparator |
117 |
"return the chunk-separation character" |
|
57 | 118 |
|
611 | 119 |
^ ChunkSeparator |
4405 | 120 |
! |
121 |
||
122 |
zeroPosition |
|
123 |
"return the number, which marks the initial position. |
|
124 |
Compatibility Notice: |
|
125 |
For historical reasons, ST/X starts with a 1-position (i.e. as in collections), |
|
126 |
while ST-80 uses 0-based postions for streams and 1-based positions for collections. |
|
127 |
||
128 |
THIS CERTAINLY IS BAD. |
|
129 |
To allow for portable code, this method can be asked to return the initial position. |
|
130 |
(for code, which ought to execute under other systems, use: |
|
131 |
posZero := (PositionableStream class respondsTo:#zeroPosition) |
|
132 |
ifTrue:[PositionableStream zeroPosition] |
|
133 |
ifFalse:[0] |
|
134 |
||
135 |
Be prepared for this to be changed to return 0 as other ST's do. |
|
136 |
" |
|
137 |
||
138 |
^ ZeroPosition |
|
360 | 139 |
! ! |
140 |
||
1 | 141 |
!PositionableStream methodsFor:'accessing'! |
142 |
||
143 |
contents |
|
144 |
"return the entire contents of the stream" |
|
145 |
||
146 |
^ collection |
|
147 |
! |
|
148 |
||
149 |
peek |
|
150 |
"look ahead for and return the next element" |
|
151 |
||
152 |
|peekObject| |
|
153 |
||
154 |
peekObject := self next. |
|
10 | 155 |
self backStep. |
1 | 156 |
^ peekObject |
157 |
! |
|
158 |
||
159 |
peekFor:something |
|
10 | 160 |
"return true and move past if next == something; |
161 |
otherwise stay and let position unchanged" |
|
1 | 162 |
|
163 |
self next == something ifTrue:[ |
|
159 | 164 |
^ true |
1 | 165 |
]. |
10 | 166 |
self backStep. |
1 | 167 |
^ false |
168 |
! |
|
169 |
||
2432 | 170 |
peekForAll:aCollection |
171 |
"return true and advance if the next elements are the same |
|
172 |
as aCollection. |
|
173 |
otherwise stay and let the position unchanged" |
|
174 |
||
175 |
|oldPos| |
|
176 |
||
177 |
oldPos := self position. |
|
178 |
(self next:(aCollection size)) = aCollection ifTrue:[ |
|
179 |
^ true |
|
180 |
]. |
|
181 |
self position:oldPos. |
|
182 |
^ false |
|
183 |
||
184 |
"Created: 1.3.1997 / 15:11:25 / cg" |
|
185 |
! |
|
186 |
||
3905
682fc38fd339
added read-access to readLimit.
Claus Gittinger <cg@exept.de>
parents:
3604
diff
changeset
|
187 |
readLimit |
682fc38fd339
added read-access to readLimit.
Claus Gittinger <cg@exept.de>
parents:
3604
diff
changeset
|
188 |
"return the read-limit; thats the position at which EOF is returned" |
682fc38fd339
added read-access to readLimit.
Claus Gittinger <cg@exept.de>
parents:
3604
diff
changeset
|
189 |
|
682fc38fd339
added read-access to readLimit.
Claus Gittinger <cg@exept.de>
parents:
3604
diff
changeset
|
190 |
^ readLimit |
682fc38fd339
added read-access to readLimit.
Claus Gittinger <cg@exept.de>
parents:
3604
diff
changeset
|
191 |
|
682fc38fd339
added read-access to readLimit.
Claus Gittinger <cg@exept.de>
parents:
3604
diff
changeset
|
192 |
"Created: / 30.10.1998 / 16:47:04 / cg" |
682fc38fd339
added read-access to readLimit.
Claus Gittinger <cg@exept.de>
parents:
3604
diff
changeset
|
193 |
! |
682fc38fd339
added read-access to readLimit.
Claus Gittinger <cg@exept.de>
parents:
3604
diff
changeset
|
194 |
|
1 | 195 |
readLimit:aNumber |
369 | 196 |
"set the read-limit; thats the position at which EOF is returned" |
1 | 197 |
|
198 |
readLimit := aNumber |
|
369 | 199 |
! |
200 |
||
201 |
writeLimit:aNumber |
|
202 |
"set the writeLimit; thats the position after which writing is prohibited" |
|
203 |
||
204 |
writeLimit := aNumber |
|
1 | 205 |
! ! |
206 |
||
44 | 207 |
!PositionableStream methodsFor:'chunk input/output'! |
1 | 208 |
|
209 |
nextChunk |
|
210 |
"return the next chunk, i.e. all characters up to the next |
|
217 | 211 |
exclamation mark. Within the chunk, exclamation marks have to be doubled, |
212 |
they are undoubled here. |
|
213 |
Except for primitive code, in which doubling is not needed (allowed). |
|
214 |
This exception was added to make it easier to edit primitive code with |
|
215 |
external editors. However, this means, that other Smalltalks cannot always |
|
216 |
read chunks containing primitive code |
|
217 |
- but that doesnt really matter, since C-primitives are an ST/X feature anyway." |
|
1 | 218 |
|
219 |
|theString sep newString done thisChar nextChar inPrimitive |
|
220 |
index "{ Class:SmallInteger }" |
|
221 |
currSize "{ Class:SmallInteger }" | |
|
222 |
||
276 | 223 |
sep := ChunkSeparator. |
1 | 224 |
theString := String new:500. |
225 |
currSize := 500. |
|
226 |
thisChar := self skipSeparators. |
|
227 |
thisChar := self next. |
|
228 |
index := 0. |
|
229 |
done := false. |
|
230 |
inPrimitive := false. |
|
231 |
||
232 |
[done] whileFalse:[ |
|
159 | 233 |
((index + 2) <= currSize) ifFalse:[ |
234 |
newString := String new:(currSize * 2). |
|
235 |
newString replaceFrom:1 to:currSize with:theString. |
|
236 |
currSize := currSize * 2. |
|
237 |
theString := newString |
|
238 |
]. |
|
239 |
thisChar isNil ifTrue:[ |
|
240 |
done := true |
|
241 |
] ifFalse:[ |
|
242 |
(thisChar == $% ) ifTrue:[ |
|
243 |
nextChar := self peek. |
|
244 |
(nextChar == ${ ) ifTrue:[ |
|
245 |
inPrimitive := true. |
|
246 |
index := index + 1. |
|
247 |
theString at:index put:thisChar. |
|
248 |
thisChar := self next |
|
249 |
] ifFalse:[ |
|
250 |
(nextChar == $} ) ifTrue:[ |
|
251 |
inPrimitive := false. |
|
252 |
index := index + 1. |
|
253 |
theString at:index put:thisChar. |
|
254 |
thisChar := self next |
|
255 |
] |
|
256 |
] |
|
257 |
] ifFalse:[ |
|
258 |
inPrimitive ifFalse:[ |
|
259 |
(thisChar == sep) ifTrue:[ |
|
260 |
(self peek == sep) ifFalse:[ |
|
261 |
done := true |
|
262 |
] ifTrue:[ |
|
263 |
self next |
|
264 |
] |
|
265 |
] |
|
266 |
] |
|
267 |
] |
|
268 |
]. |
|
269 |
done ifFalse:[ |
|
270 |
index := index + 1. |
|
271 |
theString at:index put:thisChar. |
|
272 |
thisChar := self next |
|
273 |
] |
|
1 | 274 |
]. |
275 |
(index == 0) ifTrue:[^ '']. |
|
57 | 276 |
^ theString copyTo:index |
1 | 277 |
! |
278 |
||
279 |
nextChunkPut:aString |
|
280 |
"put aString as a chunk onto the receiver; |
|
217 | 281 |
double all exclamation marks except within primitives and append a |
276 | 282 |
single delimiting exclamation mark at the end. |
718
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
283 |
This modification of the chunk format (not doubling exclas in primitive code) |
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
284 |
was done to have primitive code more readable and easier be edited in the fileBrowser |
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
285 |
or other editors. |
276 | 286 |
Its no incompatibility, since inline primitives are an ST/X special |
718
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
287 |
and code containing ST/X primitives cannot be loaded into other smalltalks anyway." |
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
288 |
|
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
289 |
self nextPutAllAsChunk:aString. |
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
290 |
self nextPut:ChunkSeparator |
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
291 |
|
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
292 |
"Modified: 9.12.1995 / 15:56:54 / cg" |
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
293 |
! |
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
294 |
|
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
295 |
nextPutAllAsChunk:aString |
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
296 |
"put aString as a chunk onto the receiver; |
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
297 |
double all exclamation marks except within primitives. |
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
298 |
This modification of the chunk format (not doubling exclas in primitive code) |
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
299 |
was done to have primitive code more readable and easier be edited in the fileBrowser |
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
300 |
or other editors. |
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
301 |
Its no incompatibility, since inline primitives are an ST/X special |
6f8222ff2ff0
extra entry to store a chunk without appending a chunk-separator
Claus Gittinger <cg@exept.de>
parents:
701
diff
changeset
|
302 |
and code containing ST/X primitives cannot be loaded into other smalltalks anyway." |
1 | 303 |
|
517
c8fae50c2cc5
fixed nextChunkPut: which sometimes doubled exclas within primitives
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
304 |
|sep stopChars inPrimitive character |
1 | 305 |
index "{ Class:SmallInteger }" |
306 |
endIndex "{ Class:SmallInteger }" |
|
217 | 307 |
stop "{ Class:SmallInteger }" |
253 | 308 |
next "{ Class:SmallInteger }"| |
1 | 309 |
|
3386 | 310 |
endIndex := aString size. |
311 |
endIndex == 0 ifTrue:[^ self]. |
|
312 |
||
276 | 313 |
sep := ChunkSeparator. |
517
c8fae50c2cc5
fixed nextChunkPut: which sometimes doubled exclas within primitives
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
314 |
stopChars := '{}' copyWith:sep. |
c8fae50c2cc5
fixed nextChunkPut: which sometimes doubled exclas within primitives
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
315 |
|
1 | 316 |
inPrimitive := false. |
317 |
index := 1. |
|
217 | 318 |
stop := endIndex + 1. |
1 | 319 |
|
320 |
[index <= endIndex] whileTrue:[ |
|
3386 | 321 |
" |
322 |
find position of next interesting character; |
|
323 |
output stuff up to that one in one piece |
|
324 |
" |
|
325 |
next := aString indexOfAny:stopChars startingAt:index ifAbsent:stop. |
|
1 | 326 |
|
3386 | 327 |
((index == 1) and:[next == stop]) ifTrue:[ |
328 |
self nextPutAll:aString |
|
329 |
] ifFalse:[ |
|
330 |
self nextPutAll:aString startingAt:index to:(next - 1) |
|
331 |
]. |
|
1 | 332 |
|
3386 | 333 |
index := next. |
334 |
(index <= endIndex) ifTrue:[ |
|
335 |
character := aString at:index. |
|
276 | 336 |
|
3386 | 337 |
(character == ${ ) ifTrue:[ |
338 |
"/ starts a primitive |
|
339 |
((index > 1) and:[(aString at:index-1) == $%]) ifTrue:[ |
|
340 |
inPrimitive := true |
|
341 |
] |
|
342 |
] ifFalse:[ |
|
343 |
"/ ends a primitive |
|
344 |
(character == $} ) ifTrue:[ |
|
345 |
((index > 1) and:[(aString at:index-1) == $%]) ifTrue:[ |
|
346 |
inPrimitive := false |
|
347 |
] |
|
348 |
] ifFalse:[ |
|
349 |
"/ |
|
350 |
"/ exclas have to be doubled - except if within a primitive |
|
351 |
"/ |
|
352 |
inPrimitive ifFalse:[ |
|
353 |
(character == sep) ifTrue:[ |
|
354 |
self nextPut:sep |
|
355 |
] |
|
356 |
] |
|
357 |
] |
|
358 |
]. |
|
276 | 359 |
|
3386 | 360 |
self nextPut:character. |
361 |
index := index + 1 |
|
362 |
] |
|
1 | 363 |
]. |
517
c8fae50c2cc5
fixed nextChunkPut: which sometimes doubled exclas within primitives
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
364 |
|
3386 | 365 |
"Modified: / 21.4.1998 / 17:22:47 / cg" |
611 | 366 |
! |
367 |
||
368 |
nextPutChunkSeparator |
|
369 |
"append a chunk separator character" |
|
370 |
||
371 |
self nextPut:ChunkSeparator |
|
372 |
||
373 |
"Created: 13.9.1995 / 17:39:26 / claus" |
|
44 | 374 |
! ! |
375 |
||
376 |
!PositionableStream methodsFor:'fileIn'! |
|
377 |
||
611 | 378 |
askForDebug:message |
379 |
"launch a box asking if a debugger is wanted - used when an error |
|
380 |
occurs while filing in" |
|
381 |
||
4416 | 382 |
^ self askForDebug:message canContinueForAll:false |
383 |
! |
|
384 |
||
385 |
askForDebug:message canContinueForAll:canContinueForAll |
|
386 |
"launch a box asking if a debugger is wanted - used when an error |
|
387 |
occurs while filing in" |
|
388 |
||
389 |
|labels values| |
|
390 |
||
611 | 391 |
Smalltalk isInitialized ifFalse:[ |
2130
b9e7e1cf98bd
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
2005
diff
changeset
|
392 |
'PositionableStream [warning]: fileIn error during startup: ' errorPrint. message errorPrintCR. |
b9e7e1cf98bd
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
2005
diff
changeset
|
393 |
^ #debug |
611 | 394 |
]. |
875
2bb6fea4cb55
dont launch box when fileIn errors occur during startup
Claus Gittinger <cg@exept.de>
parents:
759
diff
changeset
|
395 |
"/ |
2bb6fea4cb55
dont launch box when fileIn errors occur during startup
Claus Gittinger <cg@exept.de>
parents:
759
diff
changeset
|
396 |
"/ are we in the startup sequence of an image restart ? |
2bb6fea4cb55
dont launch box when fileIn errors occur during startup
Claus Gittinger <cg@exept.de>
parents:
759
diff
changeset
|
397 |
"/ |
2bb6fea4cb55
dont launch box when fileIn errors occur during startup
Claus Gittinger <cg@exept.de>
parents:
759
diff
changeset
|
398 |
Processor activeProcessIsSystemProcess ifTrue:[ |
2130
b9e7e1cf98bd
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
2005
diff
changeset
|
399 |
'PositionableStream [warning]: fileIn error during startup: ' errorPrint. message errorPrintCR. |
b9e7e1cf98bd
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
2005
diff
changeset
|
400 |
^ #continue |
875
2bb6fea4cb55
dont launch box when fileIn errors occur during startup
Claus Gittinger <cg@exept.de>
parents:
759
diff
changeset
|
401 |
]. |
2bb6fea4cb55
dont launch box when fileIn errors occur during startup
Claus Gittinger <cg@exept.de>
parents:
759
diff
changeset
|
402 |
|
4416 | 403 |
canContinueForAll ifTrue:[ |
404 |
labels := #('cancel' 'skip' 'debug' 'dont ask again' 'continue'). |
|
405 |
values := #(#abort #skip #debug #continueForAll #continue). |
|
406 |
] ifFalse:[ |
|
407 |
labels := #('cancel' 'skip' 'debug' 'continue'). |
|
408 |
values := #(#abort #skip #debug #continue). |
|
409 |
]. |
|
410 |
||
611 | 411 |
^ OptionBox |
2130
b9e7e1cf98bd
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
2005
diff
changeset
|
412 |
request:message |
b9e7e1cf98bd
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
2005
diff
changeset
|
413 |
label:'Error in fileIn' |
b9e7e1cf98bd
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
2005
diff
changeset
|
414 |
form:(WarningBox iconBitmap) |
4416 | 415 |
buttonLabels:labels |
416 |
values:values |
|
2130
b9e7e1cf98bd
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
2005
diff
changeset
|
417 |
default:#continue. |
975 | 418 |
|
2130
b9e7e1cf98bd
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
2005
diff
changeset
|
419 |
"Modified: 10.1.1997 / 18:00:56 / cg" |
611 | 420 |
! |
421 |
||
44 | 422 |
fileIn |
423 |
"file in from the receiver, i.e. read chunks and evaluate them - |
|
424 |
return the value of the last chunk." |
|
425 |
||
283 | 426 |
^ self fileInNotifying:(SourceFileLoader on:self) passChunk:true |
44 | 427 |
! |
428 |
||
1 | 429 |
fileInNextChunkNotifying:someone |
430 |
"read next chunk, evaluate it and return the result; |
|
276 | 431 |
someone (which is usually some codeView) is notified of errors. |
432 |
Filein is done as follows: |
|
433 |
read a chunk |
|
434 |
if it started with an excla, evaluate it, and let the resulting object |
|
435 |
fileIn more chunks. |
|
436 |
This is a nice trick, since the methodsFor: expression evaluates to |
|
437 |
a ClassCategoryReader which reads and compiles chunks for its class. |
|
438 |
However, other than methodsFor expressions are possible - you can |
|
439 |
(in theory) create readers for any syntax. |
|
440 |
" |
|
1 | 441 |
|
282 | 442 |
^ self fileInNextChunkNotifying:someone passChunk:false |
443 |
! |
|
444 |
||
445 |
fileInNextChunkNotifying:someone passChunk:passChunk |
|
446 |
"read next chunk, evaluate it and return the result; |
|
447 |
someone (which is usually some codeView) is notified of errors. |
|
448 |
Filein is done as follows: |
|
3032
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
449 |
read a chunk |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
450 |
if it started with an excla, evaluate it, and let the resulting object |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
451 |
fileIn more chunks. |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
452 |
This is a nice trick, since the methodsFor: expression evaluates to |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
453 |
a ClassCategoryReader which reads and compiles chunks for its class. |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
454 |
However, other than methodsFor expressions are possible - you can |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
455 |
(in theory) create readers for any syntax. |
282 | 456 |
" |
457 |
||
276 | 458 |
|aString sawExcla rslt done| |
1 | 459 |
|
460 |
self skipSeparators. |
|
461 |
self atEnd ifFalse:[ |
|
3032
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
462 |
sawExcla := self peekFor:ChunkSeparator. |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
463 |
aString := self nextChunk. |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
464 |
"/ |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
465 |
"/ handle empty chunks; |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
466 |
"/ this allows for Squeak code to be filedIn |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
467 |
"/ |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
468 |
[aString size == 0 |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
469 |
and:[self atEnd not]] whileTrue:[ |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
470 |
aString := self nextChunk. |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
471 |
]. |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
472 |
aString size ~~ 0 ifTrue:[ |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
473 |
passChunk ifTrue:[ |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
474 |
someone source:aString |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
475 |
]. |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
476 |
sawExcla ifFalse:[ |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
477 |
rslt := Smalltalk::Compiler evaluate:aString notifying:someone. |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
478 |
] ifTrue:[ |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
479 |
Smalltalk::Compiler emptySourceNotificationSignal handle:[:ex | |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
480 |
^ nil |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
481 |
] do:[ |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
482 |
rslt := Smalltalk::Compiler evaluate:aString notifying:someone compile:false. |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
483 |
]. |
282 | 484 |
|
3032
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
485 |
" |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
486 |
usually, the above chunk consists of some methodsFor:-expression |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
487 |
in this case, the returned value is a ClassCategoryReader, |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
488 |
which is used to load & compile the methods ... |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
489 |
" |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
490 |
rslt isNil ifTrue:[ |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
491 |
" |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
492 |
however, if that was nil (i.e. some error), we skip chunks |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
493 |
up to the next empty chunk. |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
494 |
" |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
495 |
Transcript showCR:'skipping chunks ...'. |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
496 |
done := false. |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
497 |
[done] whileFalse:[ |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
498 |
aString := self nextChunk. |
3990
be7844e1e603
size == 0 implies isEmpty == true
Claus Gittinger <cg@exept.de>
parents:
3966
diff
changeset
|
499 |
done := (aString size == 0). |
3032
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
500 |
] |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
501 |
] ifFalse:[ |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
502 |
rslt := rslt fileInFrom:self notifying:someone passChunk:passChunk |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
503 |
] |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
504 |
] |
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
505 |
] |
1 | 506 |
]. |
159 | 507 |
^ rslt |
1420 | 508 |
|
3032
d267a0b1b48d
handle empty chunks when filing in
Claus Gittinger <cg@exept.de>
parents:
2966
diff
changeset
|
509 |
"Modified: 14.10.1997 / 17:10:35 / cg" |
1 | 510 |
! |
511 |
||
611 | 512 |
fileInNotifying:someone passChunk:passChunk |
513 |
"file in from the receiver, i.e. read chunks and evaluate them - |
|
514 |
return the value of the last chunk. |
|
515 |
Someone (which is usually some codeView) is notified of errors." |
|
516 |
||
2893 | 517 |
|lastValue pkg spc spaces |
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
518 |
packageQuerySignal nameSpaceQuerySignal usedNameSpaceQuerySignal |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
519 |
changeDefaultApplicationNotificationSignal |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
520 |
defaultApplicationQuerySignal defaultApplication |
4416 | 521 |
confirmationQuerySignal handledSignals |
4639
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
522 |
dontAskSignals asSomeoneForPackage redef| |
611 | 523 |
|
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
524 |
"/ support for V'Age applications |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
525 |
defaultApplicationQuerySignal := Class defaultApplicationQuerySignal. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
526 |
changeDefaultApplicationNotificationSignal := Class changeDefaultApplicationNotificationSignal. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
527 |
|
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
528 |
"/ support for ST/X's namespaces & packages |
2343 | 529 |
packageQuerySignal := Class packageQuerySignal. |
530 |
nameSpaceQuerySignal := Class nameSpaceQuerySignal. |
|
531 |
usedNameSpaceQuerySignal := Class usedNameSpaceQuerySignal. |
|
532 |
||
2893 | 533 |
(someone respondsTo:#packageToInstall) ifFalse:[ |
4059
75f3acfd7ac9
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
3990
diff
changeset
|
534 |
pkg := packageQuerySignal query. |
4639
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
535 |
asSomeoneForPackage := false. |
2893 | 536 |
] ifTrue:[ |
4639
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
537 |
pkg := someone packageToInstall. |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
538 |
asSomeoneForPackage := true. |
2893 | 539 |
]. |
540 |
(someone respondsTo:#currentNameSpace) ifFalse:[ |
|
4059
75f3acfd7ac9
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
3990
diff
changeset
|
541 |
spc := nameSpaceQuerySignal query. |
2893 | 542 |
] ifTrue:[ |
543 |
spc := someone currentNameSpace |
|
544 |
]. |
|
545 |
(someone respondsTo:#usedNameSpaces) ifFalse:[ |
|
4059
75f3acfd7ac9
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
3990
diff
changeset
|
546 |
spaces := usedNameSpaceQuerySignal query. |
2893 | 547 |
] ifTrue:[ |
548 |
spaces := someone usedNameSpaces |
|
549 |
]. |
|
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
550 |
(someone respondsTo:#defaultApplication) ifFalse:[ |
4059
75f3acfd7ac9
Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents:
3990
diff
changeset
|
551 |
defaultApplication := defaultApplicationQuerySignal query. |
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
552 |
] ifTrue:[ |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
553 |
defaultApplication := someone defaultApplication |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
554 |
]. |
2893 | 555 |
|
3966
1013f1476687
suppress confirmation dialogs when classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3905
diff
changeset
|
556 |
confirmationQuerySignal := Metaclass confirmationQuerySignal. |
1013f1476687
suppress confirmation dialogs when classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3905
diff
changeset
|
557 |
|
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
558 |
handledSignals := SignalSet new. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
559 |
handledSignals add:changeDefaultApplicationNotificationSignal. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
560 |
handledSignals add:packageQuerySignal. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
561 |
handledSignals add:usedNameSpaceQuerySignal. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
562 |
handledSignals add:nameSpaceQuerySignal. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
563 |
handledSignals add:defaultApplicationQuerySignal. |
3592 | 564 |
handledSignals add:(Object errorSignal). |
565 |
handledSignals add:(Class methodRedefinitionSignal). |
|
3597
98bd336b3c3f
also care for class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3592
diff
changeset
|
566 |
handledSignals add:(Class classRedefinitionSignal). |
3966
1013f1476687
suppress confirmation dialogs when classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3905
diff
changeset
|
567 |
handledSignals add:confirmationQuerySignal. |
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
568 |
handledSignals handle:[:ex | |
4416 | 569 |
|sig action what sender msg param oldPackage newPackage proceedValue |
570 |
canContinueForAll| |
|
1902 | 571 |
|
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
572 |
sig := ex signal. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
573 |
sig == changeDefaultApplicationNotificationSignal ifTrue:[ |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
574 |
"/ invoked via #becomeDefault to set the defaultApp and the package. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
575 |
"/ (only when filing in V'Age code) |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
576 |
defaultApplication := ex parameter. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
577 |
pkg := defaultApplication name asSymbol. |
4487
6d4340c18e4f
replaced #proceed with #proceedWith:nil
Claus Gittinger <cg@exept.de>
parents:
4452
diff
changeset
|
578 |
ex proceedWith:nil |
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
579 |
]. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
580 |
sig == defaultApplicationQuerySignal ifTrue:[ |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
581 |
"/ query for the application to add classes & methods into |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
582 |
"/ (only when filing in V'Age code) |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
583 |
ex proceedWith:defaultApplication |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
584 |
]. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
585 |
sig == packageQuerySignal ifTrue:[ |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
586 |
"/ query for the package to use for classes & methods |
4639
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
587 |
asSomeoneForPackage ifTrue:[ |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
588 |
ex proceedWith:someone packageToInstall |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
589 |
] ifFalse:[ |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
590 |
ex proceedWith:pkg |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
591 |
] |
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
592 |
]. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
593 |
sig == usedNameSpaceQuerySignal ifTrue:[ |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
594 |
"/ query for the namespaces searched when encountering globals |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
595 |
ex proceedWith:spaces |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
596 |
]. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
597 |
sig == nameSpaceQuerySignal ifTrue:[ |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
598 |
"/ query for the namespace to install new classes in |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
599 |
ex proceedWith:spc |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
600 |
]. |
3966
1013f1476687
suppress confirmation dialogs when classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3905
diff
changeset
|
601 |
sig == confirmationQuerySignal ifTrue:[ |
1013f1476687
suppress confirmation dialogs when classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3905
diff
changeset
|
602 |
ex proceedWith:false "/ no dialogs popping up |
1013f1476687
suppress confirmation dialogs when classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3905
diff
changeset
|
603 |
]. |
1013f1476687
suppress confirmation dialogs when classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3905
diff
changeset
|
604 |
|
3592 | 605 |
sig == Stream endOfStreamSignal ifTrue:[ |
606 |
ex reject |
|
607 |
]. |
|
3580
47534257f9e5
avoid two queries for rejected signals.
Claus Gittinger <cg@exept.de>
parents:
3386
diff
changeset
|
608 |
|
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
609 |
sig == Signal noHandlerSignal ifTrue:[ |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
610 |
ex parameter rejected ifTrue:[ |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
611 |
ex reject |
3592 | 612 |
]. |
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
613 |
]. |
2893 | 614 |
|
4639
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
615 |
(dontAskSignals notNil and:[dontAskSignals includesKey:sig]) ifTrue:[ |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
616 |
ex proceedWith:(dontAskSignals at:sig) |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
617 |
]. |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
618 |
|
4416 | 619 |
canContinueForAll := false. |
4639
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
620 |
redef := false. |
4416 | 621 |
|
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
622 |
"/ for your convenience ... |
3597
98bd336b3c3f
also care for class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3592
diff
changeset
|
623 |
(sig == Class methodRedefinitionSignal) ifTrue:[ |
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
624 |
param := ex parameter. "/ an association: oldMethod -> newMethod |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
625 |
oldPackage := param key package. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
626 |
newPackage := param value package. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
627 |
msg := 'trying to overwrite method:\\ %1\\in package ''' |
4325 | 628 |
, oldPackage , ''' with method from package ''' , newPackage , ''''. |
4416 | 629 |
canContinueForAll := true. |
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
630 |
] ifFalse:[ |
3597
98bd336b3c3f
also care for class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3592
diff
changeset
|
631 |
(sig == Class classRedefinitionSignal) ifTrue:[ |
98bd336b3c3f
also care for class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3592
diff
changeset
|
632 |
param := ex parameter. "/ an association: oldClass -> newClass |
4639
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
633 |
|
3597
98bd336b3c3f
also care for class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3592
diff
changeset
|
634 |
oldPackage := param key package. |
98bd336b3c3f
also care for class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3592
diff
changeset
|
635 |
newPackage := param value package. |
4639
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
636 |
msg := 'trying to redefine class: ' , param key name asText allBold , '\\in package ''' |
4325 | 637 |
, oldPackage , ''' with new definition from package ''' , newPackage , ''''. |
4416 | 638 |
canContinueForAll := true. |
4639
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
639 |
redef := true. |
3597
98bd336b3c3f
also care for class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3592
diff
changeset
|
640 |
] ifFalse:[ |
98bd336b3c3f
also care for class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3592
diff
changeset
|
641 |
msg := 'error in fileIn: %1' |
98bd336b3c3f
also care for class redefinitions.
Claus Gittinger <cg@exept.de>
parents:
3592
diff
changeset
|
642 |
] |
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
643 |
]. |
2893 | 644 |
|
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
645 |
what := ex errorString. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
646 |
what isNil ifTrue:[ |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
647 |
what := ex signal notifierString. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
648 |
]. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
649 |
|
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
650 |
"/ handle the case where no GUI has been built in, |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
651 |
"/ just abort the fileIn with a notification |
2893 | 652 |
|
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
653 |
Display isNil ifTrue:[ |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
654 |
sender := ex suspendedContext sender. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
655 |
self notify:(what , |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
656 |
' in ' , sender receiver class name , |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
657 |
'>>>' , sender selector). |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
658 |
ex return |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
659 |
]. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
660 |
|
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
661 |
msg := msg bindWith:what. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
662 |
|
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
663 |
sig == Object haltSignal ifTrue:[ |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
664 |
sender := ex suspendedContext. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
665 |
msg := msg , ('\\in ' , sender receiver class name , '>>>' , sender selector) withCRs |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
666 |
]. |
2893 | 667 |
|
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
668 |
"/ otherwise ask what should be done now and either |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
669 |
"/ continue or abort the fileIn |
4639
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
670 |
redef ifTrue:[ |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
671 |
action := OptionBox |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
672 |
request:(msg withCRs) |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
673 |
label:'Class redefinition in fileIn' |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
674 |
form:(WarningBox iconBitmap) |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
675 |
buttonLabels:#('cancel' 'skip' 'debug' 'keep' 'keep all' 'continue' 'continue all') |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
676 |
values:#(#abort #skip #debug #keep #keepAll #continue #continueForAll) |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
677 |
default:#continue. |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
678 |
] ifFalse:[ |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
679 |
action := self askForDebug:msg withCRs canContinueForAll:canContinueForAll. |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
680 |
]. |
4416 | 681 |
action == #continueForAll ifTrue:[ |
682 |
dontAskSignals isNil ifTrue:[ |
|
4639
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
683 |
dontAskSignals := IdentityDictionary new. |
4416 | 684 |
]. |
4639
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
685 |
dontAskSignals at:sig put:#continue. |
4717 | 686 |
action := proceedValue := #continue. |
4639
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
687 |
] ifFalse:[ |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
688 |
action == #keepForAll ifTrue:[ |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
689 |
dontAskSignals isNil ifTrue:[ |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
690 |
dontAskSignals := IdentityDictionary new. |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
691 |
]. |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
692 |
dontAskSignals at:sig put:#keep. |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
693 |
action := #continue. |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
694 |
proceedValue := #keep. |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
695 |
] ifFalse:[ |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
696 |
action == #keep ifTrue:[ |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
697 |
action := #continue. |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
698 |
proceedValue := #keep. |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
699 |
]. |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
700 |
]. |
4416 | 701 |
]. |
702 |
||
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
703 |
action == #continue ifTrue:[ |
4639
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
704 |
ex proceedWith:(proceedValue ? #continue) |
2005
d77ecd466b5b
handle usedNameSpaces request
Claus Gittinger <cg@exept.de>
parents:
1999
diff
changeset
|
705 |
]. |
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
706 |
action == #abort ifTrue:[ |
4118
c43e3a30b8b4
cancel button now raises abortSignal.
Claus Gittinger <cg@exept.de>
parents:
4059
diff
changeset
|
707 |
AbortSignal raise. |
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
708 |
ex return |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
709 |
]. |
3604 | 710 |
action == #skip ifTrue:[ |
711 |
ex proceedWith:nil |
|
712 |
]. |
|
4639
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
713 |
action == #debug ifTrue:[ |
4716
e44df17fcbc7
Fix #enter:.. selector for Debugger
Stefan Vogel <sv@exept.de>
parents:
4639
diff
changeset
|
714 |
Debugger enter:ex suspendedContext |
e44df17fcbc7
Fix #enter:.. selector for Debugger
Stefan Vogel <sv@exept.de>
parents:
4639
diff
changeset
|
715 |
withMessage:ex errorString |
e44df17fcbc7
Fix #enter:.. selector for Debugger
Stefan Vogel <sv@exept.de>
parents:
4639
diff
changeset
|
716 |
mayProceed:true. |
4639
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
717 |
ex proceedWith:proceedValue |
a139399c5f4f
package redefinition handling fixed
Claus Gittinger <cg@exept.de>
parents:
4559
diff
changeset
|
718 |
]. |
3584
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
719 |
|
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
720 |
"/ (ex signal) enterDebuggerWith:ex message:what. |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
721 |
ex reject |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
722 |
] do:[ |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
723 |
[self atEnd] whileFalse:[ |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
724 |
lastValue := self fileInNextChunkNotifying:someone passChunk:passChunk |
099a64bc9b63
support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
725 |
] |
180 | 726 |
]. |
611 | 727 |
^ lastValue |
973 | 728 |
|
3966
1013f1476687
suppress confirmation dialogs when classes violate conventions
Claus Gittinger <cg@exept.de>
parents:
3905
diff
changeset
|
729 |
"Modified: / 3.2.1999 / 11:30:10 / cg" |
4717 | 730 |
"Modified: / 10.9.1999 / 16:54:01 / stefan" |
611 | 731 |
! ! |
732 |
||
733 |
!PositionableStream methodsFor:'positioning'! |
|
734 |
||
735 |
backStep |
|
736 |
"move backward read position by one" |
|
737 |
||
4405 | 738 |
self position:(self position - 1) |
611 | 739 |
! |
740 |
||
741 |
position |
|
742 |
"return the read position" |
|
743 |
||
744 |
^ position |
|
745 |
! |
|
746 |
||
747 |
position:index |
|
4405 | 748 |
"set the read (or write) position" |
611 | 749 |
|
750 |
"/ FIX: allow positioning right after last element of stream |
|
751 |
"/ ((index > readLimit) or:[index < 0]) ifTrue: [^ self positionError]. |
|
752 |
||
4405 | 753 |
((index > (readLimit+1)) or:[index < ZeroPosition]) ifTrue: [^ self positionError]. |
611 | 754 |
position := index |
4405 | 755 |
|
756 |
" |
|
757 |
|s| |
|
758 |
||
759 |
s := '1234567890' readStream. |
|
760 |
s next:5. |
|
761 |
s position:1. |
|
762 |
s next:7. |
|
763 |
" |
|
764 |
||
765 |
" |
|
766 |
|s| |
|
767 |
||
768 |
s := '' writeStream. |
|
769 |
s nextPutAll:'1234567890'. |
|
770 |
s position:5. |
|
771 |
s nextPutAll:'abcdefg'. |
|
772 |
s contents |
|
773 |
" |
|
774 |
||
775 |
" |
|
776 |
|s| |
|
777 |
||
778 |
s := '' writeStream. |
|
779 |
s nextPutAll:'1234567890'. |
|
780 |
s position:0. |
|
781 |
s nextPutAll:'abcdefg'. |
|
782 |
s contents |
|
783 |
" |
|
784 |
||
611 | 785 |
! |
786 |
||
787 |
reset |
|
788 |
"set the read position to the beginning of the collection" |
|
789 |
||
4405 | 790 |
position := self class zeroPosition |
791 |
||
792 |
" |
|
793 |
|s| |
|
794 |
||
795 |
s := 'hello world' readStream. |
|
796 |
Transcript showCR:(s next:5). |
|
797 |
s reset. |
|
798 |
Transcript showCR:(s next:10). |
|
799 |
" |
|
611 | 800 |
! |
801 |
||
802 |
setToEnd |
|
803 |
"set the read position to the end of the collection" |
|
804 |
||
805 |
position := readLimit |
|
806 |
! |
|
807 |
||
808 |
skip:numberToSkip |
|
809 |
"skip the next numberToSkip elements" |
|
810 |
||
4405 | 811 |
self position:(self position + numberToSkip) |
1489
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
812 |
! |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
813 |
|
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
814 |
skipThroughAll:aCollection |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
815 |
"skip for and through the sequence given by the argument, aCollection; |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
816 |
return nil if not found, self otherwise. |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
817 |
On a successful match, the next read will return elements after aCollection; |
2153
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
818 |
if no match was found, the receiver will be positioned at the end. |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
819 |
This is redefined here, to make use of positioning." |
1489
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
820 |
|
2154
89e96599e1e2
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2153
diff
changeset
|
821 |
|buffer l first idx| |
1489
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
822 |
|
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
823 |
l := aCollection size. |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
824 |
first := aCollection at:1. |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
825 |
[self atEnd] whileFalse:[ |
2153
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
826 |
buffer := self nextAvailable:l. |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
827 |
buffer = aCollection ifTrue:[ |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
828 |
^ self |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
829 |
]. |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
830 |
idx := buffer indexOf:first startingAt:2. |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
831 |
idx == 0 ifFalse:[ |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
832 |
self position:(self position - l + idx - 1) |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
833 |
] |
1489
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
834 |
]. |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
835 |
^ nil |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
836 |
|
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
837 |
" |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
838 |
|s| |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
839 |
s := ReadStream on:'12345678901234567890'. |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
840 |
s skipThroughAll:'901'. |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
841 |
s upToEnd |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
842 |
" |
2153
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
843 |
" |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
844 |
|s| |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
845 |
s := ReadStream on:'12345678901234567890'. |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
846 |
s skipThroughAll:'1234'. |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
847 |
s upToEnd |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
848 |
" |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
849 |
" |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
850 |
|s| |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
851 |
s := ReadStream on:'12345678901234567890'. |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
852 |
s skipThroughAll:'999'. |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
853 |
s atEnd |
244e36cbbd9b
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
854 |
" |
1489
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
855 |
|
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
856 |
"Created: 26.6.1996 / 09:35:35 / cg" |
2154
89e96599e1e2
skipThroughAll: does not need the old position
Claus Gittinger <cg@exept.de>
parents:
2153
diff
changeset
|
857 |
"Modified: 11.1.1997 / 19:16:38 / cg" |
1489
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
858 |
! |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
859 |
|
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
860 |
skipToAll:aCollection |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
861 |
"skip for the sequence given by the argument, aCollection; |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
862 |
return nil if not found, self otherwise. |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
863 |
On a successful match, the next read will return elements of aCollection." |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
864 |
|
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
865 |
|oldPos buffer l first idx| |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
866 |
|
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
867 |
oldPos := self position. |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
868 |
l := aCollection size. |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
869 |
first := aCollection at:1. |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
870 |
[self atEnd] whileFalse:[ |
1998 | 871 |
buffer := self next:l. |
872 |
buffer = aCollection ifTrue:[ |
|
873 |
self position:(self position - l). |
|
874 |
^ self |
|
875 |
]. |
|
876 |
idx := buffer indexOf:first startingAt:2. |
|
877 |
idx == 0 ifFalse:[ |
|
878 |
self position:(self position - l + idx - 1) |
|
879 |
] |
|
1489
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
880 |
]. |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
881 |
self position:oldPos. |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
882 |
^ nil |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
883 |
|
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
884 |
" |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
885 |
|s| |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
886 |
s := ReadStream on:'12345678901234567890'. |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
887 |
s skipToAll:'901'. |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
888 |
s upToEnd |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
889 |
" |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
890 |
|
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
891 |
"Modified: 26.6.1996 / 09:28:27 / cg" |
9e3b166483fb
moved some skip methods from readStream;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
892 |
"Created: 26.6.1996 / 09:35:06 / cg" |
44 | 893 |
! ! |
611 | 894 |
|
895 |
!PositionableStream methodsFor:'private'! |
|
896 |
||
897 |
contentsSpecies |
|
898 |
"return a class of which instances will be returned, when |
|
899 |
parts of the collection are asked for. |
|
900 |
(see upTo-kind of methods in subclasses)" |
|
901 |
||
902 |
^ collection species |
|
903 |
! |
|
904 |
||
905 |
on:aCollection |
|
906 |
"setup for streaming on aCollection" |
|
907 |
||
908 |
collection := aCollection. |
|
909 |
readLimit := aCollection size. |
|
910 |
position := "0" 1 |
|
911 |
! |
|
912 |
||
913 |
on:aCollection from:first to:last |
|
914 |
"setup for streaming on aCollection from first to last" |
|
915 |
||
916 |
collection := aCollection. |
|
917 |
position := first. |
|
918 |
readLimit := last |
|
919 |
! |
|
920 |
||
921 |
positionError |
|
1998 | 922 |
"{ Pragma: +optSpace }" |
923 |
||
2966 | 924 |
"report an error when positioning past the end |
925 |
or before the beginning." |
|
611 | 926 |
|
4559 | 927 |
^ InvalidPositionErrorSignal raiseRequestWith:nil |
4452
3d050f505a0a
Raise proceedable signals proceedable.
Stefan Vogel <sv@exept.de>
parents:
4416
diff
changeset
|
928 |
|
3d050f505a0a
Raise proceedable signals proceedable.
Stefan Vogel <sv@exept.de>
parents:
4416
diff
changeset
|
929 |
"Modified: / 26.7.1999 / 10:59:13 / stefan" |
611 | 930 |
! |
931 |
||
932 |
with:aCollection |
|
933 |
"setup for streaming to the end of aCollection" |
|
934 |
||
935 |
collection := aCollection. |
|
936 |
self setToEnd |
|
937 |
! ! |
|
938 |
||
939 |
!PositionableStream methodsFor:'queries'! |
|
940 |
||
941 |
isPositionable |
|
942 |
"return true, if the stream supports positioning (this one is)" |
|
943 |
||
944 |
^ true |
|
945 |
! ! |
|
946 |
||
3170
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
947 |
!PositionableStream methodsFor:'reading'! |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
948 |
|
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
949 |
upToAll:aCollection |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
950 |
"read until a subcollection consisisting of the elements in aCollection |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
951 |
is encountered. |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
952 |
Return everything read excluding the elements in aCollection. |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
953 |
The position is left before the collection; i.e. the next |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
954 |
read operations will return those elements. |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
955 |
If no such subcollection is encountered, all elements up to the end |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
956 |
are read and returned. |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
957 |
Compare this with #throughAll: which also reads up to some objects |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
958 |
but positions behind it and DOES include it in the returned |
3184
d99302322139
Ok, #upToAll: positions after the collection.
Stefan Vogel <sv@exept.de>
parents:
3170
diff
changeset
|
959 |
collection. |
d99302322139
Ok, #upToAll: positions after the collection.
Stefan Vogel <sv@exept.de>
parents:
3170
diff
changeset
|
960 |
|
d99302322139
Ok, #upToAll: positions after the collection.
Stefan Vogel <sv@exept.de>
parents:
3170
diff
changeset
|
961 |
Note: this behavior is inconsistent with the other upTo.. methods, |
d99302322139
Ok, #upToAll: positions after the collection.
Stefan Vogel <sv@exept.de>
parents:
3170
diff
changeset
|
962 |
which position after the found item. We implement the method |
d99302322139
Ok, #upToAll: positions after the collection.
Stefan Vogel <sv@exept.de>
parents:
3170
diff
changeset
|
963 |
this way for the sake of ST80-compatibility." |
3170
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
964 |
|
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
965 |
|answerStream element last rslt| |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
966 |
|
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
967 |
last := aCollection last. |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
968 |
answerStream := WriteStream on:(self contentsSpecies new). |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
969 |
[self atEnd] whileFalse:[ |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
970 |
element := self next. |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
971 |
answerStream nextPut:element. |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
972 |
element == last ifTrue:[ |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
973 |
((rslt := answerStream contents) endsWith:aCollection) ifTrue:[ |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
974 |
self position:(self position - aCollection size). |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
975 |
^ rslt copyWithoutLast:aCollection size |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
976 |
] |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
977 |
]. |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
978 |
]. |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
979 |
^ answerStream contents |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
980 |
|
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
981 |
" |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
982 |
|s| |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
983 |
s := ReadStream on:'hello world'. |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
984 |
Transcript show:'<'; show:(s upToAll:'wo'); showCR:'>'. |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
985 |
Transcript show:'<'; show:(s upToEnd); showCR:'>'. |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
986 |
" |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
987 |
" |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
988 |
|s| |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
989 |
s := ReadStream on:'hello world'. |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
990 |
Transcript show:'<'; show:(s upToAll:'xx'); showCR:'>'. |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
991 |
Transcript showCR:s atEnd. |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
992 |
Transcript show:'<'; show:(s upToEnd); showCR:'>'. |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
993 |
" |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
994 |
|
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
995 |
"Modified: / 12.1.1998 / 22:06:42 / cg" |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
996 |
"Created: / 12.1.1998 / 22:07:01 / cg" |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
997 |
! ! |
7b299d83c45a
moved upToAll: to positionableStream.
Claus Gittinger <cg@exept.de>
parents:
3032
diff
changeset
|
998 |
|
611 | 999 |
!PositionableStream methodsFor:'testing'! |
1000 |
||
1001 |
atEnd |
|
1002 |
"return true, if the read-position is at the end" |
|
1003 |
||
1004 |
^ position > readLimit |
|
1005 |
! |
|
1006 |
||
1007 |
isEmpty |
|
1008 |
"return true, if the contents of the stream is empty" |
|
1009 |
||
1010 |
^ readLimit == 0 |
|
1011 |
! ! |
|
1012 |
||
1897 | 1013 |
!PositionableStream class methodsFor:'documentation'! |
701 | 1014 |
|
1015 |
version |
|
4717 | 1016 |
^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.82 1999-09-10 14:55:36 stefan Exp $' |
701 | 1017 |
! ! |
611 | 1018 |
PositionableStream initialize! |