Squeak Class Documentation category index | class index  
 
ReadNewsInboxFile
  category: Network-Mail Reader
  superclass: MailDBFile
  subclasses: RNInboxFile

I am a parser for news files in the format output by the Unix 'readnews' program.

instance methods
  read-write
  readFrom:
writeOn:

  scanning
  allDashes:
appendLine:
endOfArticleDo:
newsMessagesDo:
parse:do:
setNewsGroup:
startOfArticle:

class methods
  no messages
 

instance methods
  read-write top  
 

readFrom:

This operation is a noop for news inboxes. Use 'messagesDo:' to enumerate the messages in the inbox.


 

writeOn:

This operation is illegal for news inboxes.


  scanning top  
 

allDashes:

Answer true if the given string is not empty and consists entirely of dash characters.


 

appendLine:

Append the given line to the buffer.


 

endOfArticleDo:

We've just hit the end of an article. Evaluate the given block on the article we've been accumulating in the buffer (if any) and reset the buffer for the next article.


 

newsMessagesDo:

Invoke the given block for each message in the news inbox file. The block arguments are the newsgroup name and the text of a new message.


 

parse:do:

Parse the given stream into newsgroup articles, invoking the given block once for each article in the stream. The stream is divided into articles by two kinds of delimiters. The first kind indicates the start of a new newsgroup and includes the newsgroup name. The second kind indicates the start of a new article within a newsgroup.


 

setNewsGroup:

Set the current newsgroup name from the given line of text, which is of the form:
Newsgroup comp.lang.smalltalk


 

startOfArticle:

Answer true if the given string is the start of a new news article. That is, does it start with the string 'Article ' and end with a period?


class methods
  no messages top