Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Window Struct Template Reference
[Utility constructs for Vaucanson]

Handle windows in streams for performing regular expression search. More...

List of all members.

Public Member Functions

 Window (const iterator_t &stream, const iterator_t &eof, letter_t eol, length_t length)
 Standard constructor for the Window class.

bool eof () const
 Indicates wether the end of the stream has been reached or not.

bool eol () const
 Indicates wether a new line has been reached or not.

void shift (unsigned int n)
 Shift the window.

void shift ()
 Shift the window completely (equivalent to shift(size())).

length_t size () const
 Returns the actual window size.

letter_t operator[] (length_t i) const
 Returns the i-th character of the window.

std::ostream & print (std::ostream &ostr) const
 Print the window.

void moveto (length_t offset)
 Move to a specific offset.

void moveto (iterator_t position)
 Move to a specific offset.

Accessors
iterator_t begin () const
 Get an iterator to the beginning of the stream.

iterator_t stream () const
 Get an iterator to the current position in the stream.

iterator_t end () const
 Get an iterator to the end of the stream.

size_t offset () const
 Get the actual offset in the stream.

letter_t eol_value () const
 Get the letter value used for ending lines.

length_t length () const
 Get the maximum length of the window.

string_t window () const
 Get the window as a basic_string<letter_t>.


Detailed Description

template<class InputIterator, class Letter>
struct utility::Window< InputIterator, Letter >

Handle windows in streams for performing regular expression search.

A window is a portion of a stream, viewable as a string, on which several operations can be performed:

A window has a constant size, unless an end of line ('\n') or an end of file occurs, in which case a window is shorter than its supposed size.

Parameters:
InputIterator The type of input iterator used to read the stream. It shall be a random access iterator.
Letter The type used for letters.
Author:
Thomas Claveirole <thomas@lrde.epita.fr>


Generated on Mon Mar 29 15:42:43 2004 for Vaucanson by doxygen 1.3.6-20040222