Window Struct Template Reference
[Miscellaneous constructs used by Vaucanson]

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

List of all members.

Public Types

typedef InputIterator iterator_t
typedef Letter letter_t
typedef std::basic_string<
letter_t
string_t
typedef unsigned int length_t

Public Member Functions

 Window (const iterator_t &stream, const iterator_t &eof, letter_t eol, length_t length)
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>.

Protected Member Functions

void compute_size ()

Protected Attributes

iterator_t begin_
iterator_t stream_
iterator_t end_
letter_t eol_
length_t length_
length_t size_


Detailed Description

template<class InputIterator, class Letter>
struct vcsn::misc::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>

Definition at line 60 of file window.hh.


Generated on Sat Jul 29 17:32:34 2006 for Vaucanson by  doxygen 1.4.6