Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Examples  

wordstream_iterator Class Reference

A wordstream_iterator is an input iterator that returns words from an underlying stream. More...

#include <wordstreamiterator.h>

List of all members.

Public Methods

 wordstream_iterator (istream &is, const set< string > &ignore)
 Constructor. More...

 wordstream_iterator ()
const string & operator * () const
wordstream_iterator & operator++ ()
wordstream_iterator operator++ (int)
size_t ignored () const
size_t read () const

Friends

bool operator== (const wordstream_iterator &i1, const wordstream_iterator &i2)


Detailed Description

A wordstream_iterator is an input iterator that returns words from an underlying stream.

The words are guaranteed to conform to the class Word and do not appear in an ignore set of common words.

Definition at line 18 of file wordstreamiterator.h.


Constructor & Destructor Documentation

wordstream_iterator::wordstream_iterator istream &    is,
const set< string > &    ignore
 

Constructor.

Parameters:
is  stream to read from
ignore  set of strings to be ignored

Definition at line 6 of file wordstreamiterator.C.

00007                             : ignore_(&ignore), is_(&is), ok_(true),
00008   ignored_(0), read_(0) {
00009 get();
00010 }

wordstream_iterator::wordstream_iterator  
 

Definition at line 12 of file wordstreamiterator.C.

References ignored().

00012                                         : ignore_(0), is_(0), ok_(false) {
00013 }


Member Function Documentation

const string& wordstream_iterator::operator *   const [inline]
 

Definition at line 28 of file wordstreamiterator.h.

00028 { return value_; }

wordstream_iterator& wordstream_iterator::operator++   [inline]
 

Definition at line 29 of file wordstreamiterator.h.

00029 { get(); return *this; }

wordstream_iterator wordstream_iterator::operator++ int    [inline]
 

Definition at line 30 of file wordstreamiterator.h.

00030                                       { 
00031     wordstream_iterator tmp(*this);
00032     get();
00033     return tmp;
00034     }

size_t wordstream_iterator::ignored   const [inline]
 

Definition at line 41 of file wordstreamiterator.h.

Referenced by wordstream_iterator().

00041 { return ignored_; }

size_t wordstream_iterator::read   const [inline]
 

Definition at line 42 of file wordstreamiterator.h.

00042 { return read_; }


Friends And Related Function Documentation

bool operator== const wordstream_iterator &    i1,
const wordstream_iterator &    i2
[friend]
 

Definition at line 36 of file wordstreamiterator.h.

00036                                                                            {
00037     return i1.is_ == i2.is_ && i1.ok_ == i2.ok_ 
00038         || i1.ok_ == false && i2.ok_ == false;
00039     }


The documentation for this class was generated from the following files:
textindexer-0.2 [27 March, 2002]