Squeak Class Documentation category index | class index  
 
LimitingLineStreamWrapper
  category: Collections-Streams
  superclass: Object
  subclasses:

I'm a wrapper for a stream optimized for line-by-line access using #nextLine. My instances can be nested.

I read one line ahead. Reading terminates when the stream ends, or if the limitingBlock evaluated with the line answers true. To skip the delimiting line for further reading use #skipThisLine.

Character-based reading (#next) is permitted, too. Send #updatePosition when switching from line-based reading.

See examples at the class side.

--bf 2/19/1999 12:52

instance methods
  accessing
  delimiter:
lastLineRead
limitingBlock:
linesUpToEnd
next
nextLine
peekLine
skipThisLine
upToEnd
updatePosition

  printing
  printOn:

  private
  setStream:delimiter:

  stream protocol
  close

  testing
  atEnd

class methods
  examples
  example1
example2
exampleStream

  instance creation
  on:delimiter:

instance methods
  accessing top  
 

delimiter:

Set limitBlock to check for a delimiting string. Be unlimiting if nil


 

lastLineRead

Return line last read. At stream end, this is the boundary line or nil


 

limitingBlock:

The limitingBlock is evaluated with a line to check if this line terminates the stream


 

linesUpToEnd


 

next

Provide character-based access


 

nextLine


 

peekLine


 

skipThisLine


 

upToEnd


 

updatePosition

Call this before doing character-based access


  printing top  
 

printOn:

Append to the argument, aStream, a sequence of characters that
identifies the receiver.


  private top  
 

setStream:delimiter:


  stream protocol top  
 

close


  testing top  
 

atEnd


class methods
  examples top  
 

example1

LimitingLineStreamWrapper example1


 

example2

LimitingLineStreamWrapper example2


 

exampleStream


  instance creation top  
 

on:delimiter: