# HG changeset patch # User Claus Gittinger # Date 832174249 -7200 # Node ID 0ee12d9458494363d34ae8126ac39c1f9c78d88b # Parent fd17bde5f3a28883da886d7fcfbae53c497ba9eb checkin from browser diff -r fd17bde5f3a2 -r 0ee12d945849 ReadStr.st --- a/ReadStr.st Wed May 15 02:13:33 1996 +0200 +++ b/ReadStr.st Wed May 15 17:30:49 1996 +0200 @@ -52,6 +52,33 @@ ^ self ! ! +!ReadStream methodsFor:'emphasis'! + +emphasis + "return the emphasis of the current (i.e. next returned by #next) + element. Streams on a string will return nil for all elements. + Streams on collections which nothing at all about emphasises, + will report an error." + + ^ collection emphasisAt:position. + + " + |t s| + + t := 'hello world' asText + emphasizeFrom:1 to:5 with:#bold; + emphasizeFrom:7 to:11 with:#italic. + + s := t readStream. + [s atEnd] whileFalse:[ + Transcript show:(s emphasis); show:' '. + Transcript show:''''; show:(s next); showCr:''''. + ]. + " + + "Modified: 15.5.1996 / 17:30:33 / cg" +! ! + !ReadStream methodsFor:'queries'! isReadable @@ -542,5 +569,5 @@ !ReadStream class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/Attic/ReadStr.st,v 1.26 1996-04-25 17:00:45 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/Attic/ReadStr.st,v 1.27 1996-05-15 15:30:49 cg Exp $' ! ! diff -r fd17bde5f3a2 -r 0ee12d945849 ReadStream.st --- a/ReadStream.st Wed May 15 02:13:33 1996 +0200 +++ b/ReadStream.st Wed May 15 17:30:49 1996 +0200 @@ -52,6 +52,33 @@ ^ self ! ! +!ReadStream methodsFor:'emphasis'! + +emphasis + "return the emphasis of the current (i.e. next returned by #next) + element. Streams on a string will return nil for all elements. + Streams on collections which nothing at all about emphasises, + will report an error." + + ^ collection emphasisAt:position. + + " + |t s| + + t := 'hello world' asText + emphasizeFrom:1 to:5 with:#bold; + emphasizeFrom:7 to:11 with:#italic. + + s := t readStream. + [s atEnd] whileFalse:[ + Transcript show:(s emphasis); show:' '. + Transcript show:''''; show:(s next); showCr:''''. + ]. + " + + "Modified: 15.5.1996 / 17:30:33 / cg" +! ! + !ReadStream methodsFor:'queries'! isReadable @@ -542,5 +569,5 @@ !ReadStream class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/ReadStream.st,v 1.26 1996-04-25 17:00:45 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/ReadStream.st,v 1.27 1996-05-15 15:30:49 cg Exp $' ! !