--- a/Stream.st Sat Jan 17 14:44:39 1998 +0100
+++ b/Stream.st Sat Jan 17 16:50:14 1998 +0100
@@ -315,7 +315,7 @@
signalAtEnd == true ifTrue:[
"/ always raise ...
- ^ EndOfStreamSignal raiseIn:thisContext sender
+ ^ EndOfStreamSignal raiseRequestFrom:self
].
signalAtEnd == false ifTrue:[
"/ never raise ...
@@ -517,7 +517,7 @@
order, please use the corresponding xxxNet methods, which use a standard
network byte order."
- |high uval "{ Class: SmallInteger }" val|
+ |uval "{ Class: SmallInteger }" val|
msbFlag ifTrue:[
"most significant first"
@@ -1495,54 +1495,6 @@
"Modified: / 15.1.1998 / 23:28:47 / stefan"
!
-upToAll:aCollection
- "read until a subcollection consisisting of the elements in aCollection
- is encountered.
- Return everything read excluding the elements in aCollection.
- The next read operation will return the element after aCollection.
- (i.e. aCollection is considered a separator, which is skipped)
- Similar to #throughAll:, but the matching object is not included in the
- returned collection.
- If no such subcollection is encountered, all elements up to the end
- are read and returned.
- Compare this with #throughAll: which also reads up to aCollection
- but positions behind it and DOES include it in the returned
- collection."
-
- |answerStream element last rslt|
-
- last := aCollection last.
- answerStream := WriteStream on:(self contentsSpecies new).
- [self atEnd] whileFalse:[
- element := self next.
- answerStream nextPut:element.
- element == last ifTrue:[
- ((rslt := answerStream contents) endsWith:aCollection) ifTrue:[
- ^ rslt copyWithoutLast:aCollection size
- ]
- ].
- ].
- ^ answerStream contents
-
- "
- |s|
- s := ReadStream on:'hello world'.
- Transcript show:'<'; show:(s upToAll:'wo'); showCR:'>'.
- Transcript show:'<'; show:(s upToEnd); showCR:'>'.
- "
- "
- |s|
- s := ReadStream on:'hello world'.
- Transcript show:'<'; show:(s upToAll:'xx'); showCR:'>'.
- Transcript showCR:s atEnd.
- Transcript show:'<'; show:(s upToEnd); showCR:'>'.
- "
-
- "Modified: / 12.1.1998 / 22:06:42 / cg"
- "Created: / 15.1.1998 / 23:28:20 / stefan"
- "Modified: / 15.1.1998 / 23:29:26 / stefan"
-!
-
upToAny:aCollectionOfObjects
"read a collection of all objects up-to a element which is contained in
aCollectionOfObjects and return these elements, but excluding the matching one.
@@ -1969,6 +1921,6 @@
!Stream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.70 1998-01-16 14:54:52 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.71 1998-01-17 15:50:12 stefan Exp $'
! !
Stream initialize!