--- a/PositionableStream.st Thu Nov 09 11:25:36 2000 +0100
+++ b/PositionableStream.st Thu Nov 09 11:46:32 2000 +0100
@@ -10,7 +10,6 @@
hereby transferred.
"
-
"{ Package: 'stx:libbasic' }"
PeekableStream subclass:#PositionableStream
@@ -35,7 +34,6 @@
other person. No title to or ownership of the software is
hereby transferred.
"
-
!
documentation
@@ -62,7 +60,6 @@
[author:]
Claus Gittinger
"
-
! !
!PositionableStream class methodsFor:'initialization'!
@@ -87,7 +84,6 @@
ZeroPosition := 1.
]
-
! !
!PositionableStream class methodsFor:'instance creation'!
@@ -96,7 +92,6 @@
"return a new PositionableStream streaming on aCollection"
^ (self basicNew) on:aCollection
-
!
on:aCollection from:first to:last
@@ -104,7 +99,6 @@
from first to last"
^ (self basicNew) on:aCollection from:first to:last
-
!
with:aCollection
@@ -112,7 +106,6 @@
the stream is positioned to the end of the collection."
^ (self basicNew) with:aCollection
-
! !
!PositionableStream class methodsFor:'Signal constants'!
@@ -125,7 +118,6 @@
current directory, by asking this querySignal (which is nice sometimes)."
^ CurrentFileInDirectoryQuerySignal
-
!
invalidPositionErrorSignal
@@ -134,7 +126,6 @@
the end)"
^ InvalidPositionErrorSignal
-
! !
!PositionableStream class methodsFor:'constants'!
@@ -156,7 +147,6 @@
"
^ ZeroPosition
-
! !
!PositionableStream methodsFor:'accessing'!
@@ -165,7 +155,6 @@
"return the entire contents of the stream"
^ collection
-
!
peek
@@ -176,7 +165,6 @@
peekObject := self next.
self backStep.
^ peekObject
-
!
peekForAll:aCollection
@@ -194,7 +182,6 @@
^ false
"Created: 1.3.1997 / 15:11:25 / cg"
-
!
readLimit
@@ -203,21 +190,18 @@
^ readLimit
"Created: / 30.10.1998 / 16:47:04 / cg"
-
!
readLimit:aNumber
"set the read-limit; thats the position at which EOF is returned"
readLimit := aNumber
-
!
writeLimit:aNumber
"set the writeLimit; thats the position after which writing is prohibited"
writeLimit := aNumber
-
! !
!PositionableStream methodsFor:'chunk input/output'!
@@ -236,7 +220,6 @@
self nextPut:(self class chunkSeparator)
"Modified: 9.12.1995 / 15:56:54 / cg"
-
!
nextPutAllAsChunk:aString
@@ -308,7 +291,7 @@
index := index + 1.
].
].
- character ~~ Character cr ifTrue:[
+ (aString endsWith:Character cr) ifFalse:[
self cr.
].
@@ -322,7 +305,6 @@
self nextPut:(self class chunkSeparator)
"Created: 13.9.1995 / 17:39:26 / claus"
-
! !
!PositionableStream methodsFor:'fileIn'!
@@ -332,7 +314,6 @@
occurs while filing in"
^ self askForDebug:message canContinueForAll:false
-
!
askForDebug:message canContinueForAll:canContinueForAll
@@ -370,7 +351,6 @@
default:#continue.
"Modified: 10.1.1997 / 18:00:56 / cg"
-
!
fileIn
@@ -397,7 +377,6 @@
^ val
"Modified: / 16.10.1999 / 12:25:27 / cg"
-
!
fileInNextChunkNotifying:someone
@@ -414,7 +393,6 @@
"
^ self fileInNextChunkNotifying:someone passChunk:false
-
!
fileInNextChunkNotifying:someone passChunk:passChunk
@@ -482,7 +460,6 @@
^ rslt
"Modified: 14.10.1997 / 17:10:35 / cg"
-
!
fileInNotifying:someone passChunk:passChunk
@@ -736,7 +713,6 @@
"Modified: / 10.9.1999 / 16:54:01 / stefan"
"Modified: / 14.12.1999 / 15:00:53 / cg"
-
!
fileInXMLNotifying:someone passChunk:passChunk
@@ -750,7 +726,6 @@
parser validate:false.
parser scanDocument.
self halt.
-
! !
!PositionableStream methodsFor:'positioning'!
@@ -759,14 +734,12 @@
"move backward read position by one"
self position:(self position - 1)
-
!
position
"return the read position"
^ position
-
!
position:index
@@ -807,7 +780,6 @@
s contents
"
-
!
reset
@@ -823,7 +795,6 @@
s reset.
Transcript showCR:(s next:10).
"
-
!
resetPosition
@@ -839,21 +810,18 @@
s reset.
Transcript showCR:(s next:10).
"
-
!
setToEnd
"set the read position to the end of the collection"
position := readLimit
-
!
skip:numberToSkip
"skip the next numberToSkip elements"
self position:(self position + numberToSkip)
-
!
skipThroughAll:aCollection
@@ -900,7 +868,6 @@
"Created: 26.6.1996 / 09:35:35 / cg"
"Modified: 11.1.1997 / 19:16:38 / cg"
-
!
skipToAll:aCollection
@@ -936,7 +903,6 @@
"Modified: 26.6.1996 / 09:28:27 / cg"
"Created: 26.6.1996 / 09:35:06 / cg"
-
! !
!PositionableStream methodsFor:'private'!
@@ -947,7 +913,6 @@
(see upTo-kind of methods in subclasses)"
^ collection species
-
!
on:aCollection
@@ -956,7 +921,6 @@
collection := aCollection.
readLimit := aCollection size.
position := "0" 1
-
!
on:aCollection from:first to:last
@@ -965,7 +929,6 @@
collection := aCollection.
position := first.
readLimit := last
-
!
positionError
@@ -977,7 +940,6 @@
^ InvalidPositionErrorSignal raiseRequestWith:nil
"Modified: / 26.7.1999 / 10:59:13 / stefan"
-
!
with:aCollection
@@ -985,7 +947,6 @@
collection := aCollection.
self setToEnd
-
! !
!PositionableStream methodsFor:'queries'!
@@ -994,7 +955,6 @@
"return true, if the stream supports positioning (this one is)"
^ true
-
! !
!PositionableStream methodsFor:'reading'!
@@ -1047,7 +1007,6 @@
"Modified: / 12.1.1998 / 22:06:42 / cg"
"Created: / 12.1.1998 / 22:07:01 / cg"
-
! !
!PositionableStream methodsFor:'testing'!
@@ -1056,20 +1015,17 @@
"return true, if the read-position is at the end"
^ position > readLimit
-
!
isEmpty
"return true, if the contents of the stream is empty"
^ readLimit == 0
-
! !
!PositionableStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.94 2000-11-09 10:25:36 cg Exp $'
-
+ ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.95 2000-11-09 10:46:32 cg Exp $'
! !
PositionableStream initialize!