escaper Struct Template Reference

IO Manipulator to escape some characters when displaying them. More...

Inheritance diagram for escaper:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 escaper (const T &w)
std::ostream & operator() (std::ostream &ostr) const

Protected Attributes

const T & w_

Detailed Description

template<class T>
struct utility::escaper< T >

IO Manipulator to escape some characters when displaying them.

It is often desirable when printing words to escape some particular characters. As an example, when printing a rational expression, the word "foo+bar" (where '+' is a letter from the alphabet) should be printed "foo\+bar".

This manipulator allow an user to do so. When used on a stream using an << operator, the argument of type T held by this manipulator is displayed as if its << operator had been called, but with some characters escaped.

By default the escaped characters are those returned by vcsn::tools::usual_escaped_characters(). You may control those characters using the utility::setesc manipulator.

See also:
make_escaper(), setesc, getesc(), iomanip, vcsn::tools::usual_escaped_characters().
Author:
Thomas Claveirole <thomas.claveirole@lrde.epita.fr>

Definition at line 57 of file escaper.hh.


Generated on Fri Jul 28 12:33:27 2006 for Vaucanson by  doxygen 1.4.6