# HG changeset patch # User Claus Gittinger # Date 1142419032 -3600 # Node ID 6afd161ee43ca2cf1c67afa3704d4806f588379a # Parent 6bbfb248f483cae22c80658d2fc28f955abca199 +skipTo: diff -r 6bbfb248f483 -r 6afd161ee43c PositionableStream.st --- a/PositionableStream.st Wed Mar 15 11:35:21 2006 +0100 +++ b/PositionableStream.st Wed Mar 15 11:37:12 2006 +0100 @@ -149,6 +149,25 @@ self nextPutChunkSeparator ! ! +!PositionableStream methodsFor:'Compatibility-ST/V'! + +skipTo:anElement + "ST/V compatibility: + skip for the element given by the argument, anElement; + return nil if not found, self otherwise. + On a successful match, the next read will return the element after anElement." + + ^ self skipThrough:anElement + + " + |s| + s := ReadStream on:'12345678901234567890'. + s skipTo:$5. + s copyFrom:1 to:(s position). + s upToEnd + " +! ! + !PositionableStream methodsFor:'accessing'! collection @@ -409,27 +428,6 @@ "Modified: 11.1.1997 / 19:16:38 / cg" ! -skipTo:anElement - "skip for the element given by the argument, anElement; - return nil if not found, self otherwise. - On a successful match, the next read will return the element after anElement." - - |buffer len first idx| - - [self atEnd] whileFalse:[ - self next == anElement ifTrue:[^ self ]. - ]. - ^ nil - - " - |s| - s := ReadStream on:'12345678901234567890'. - s skipTo:$5. - s copyFrom:1 to:(s position). - s upToEnd - " -! - skipToAll:aCollection "skip for the sequence given by the argument, aCollection; return nil if not found, self otherwise. @@ -620,7 +618,7 @@ !PositionableStream class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.145 2006-03-15 10:35:21 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.146 2006-03-15 10:37:12 cg Exp $' ! ! PositionableStream initialize!