![]() |
Smalltalk/X WebserverDocumentation of class 'MultiReadStream': |
|
Class: MultiReadStreamInheritance:Object | +--Stream | +--PeekableStream | +--MultiReadStream
Description:Stacked streams. At any time, another stream can be stacked onto a stream stack. Making this stream's contents to be returned before the rest. To the stream reader, this looks like a single stream delivering the embedded stream contents sequentially. Useful when reading files which include each other, or to handle define-macro expansion in a c-parser. [instance variables:] Class protocol:instance creationInstance protocol:private
Examples:|s| s := MultiReadStream on:('abcd' readStream). self assert:(s peek == $a). self assert:(s next == $a). s pushInputStream:('1234' readStream). self assert:(s next == $1). self assert:(s next == $2). s pushInputStream:('aa' readStream). self assert:(s next == $a). self assert:(s next == $a). self assert:(s atEnd not). self assert:(s next == $3). self assert:(s next == $4). self assert:(s next == $b). self assert:(s next == $c). self assert:(s next == $d). self assert:(s atEnd). self assert:(s peek == nil). self assert:(s next == nil). |
|
ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Sun, 28 May 2023 23:03:16 GMT
|