Boost logo

Boost :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2004-09-16 16:37:36


Although my library is still under review, I am re-architecturing it based
on the feedback thus far. This post is the code associated with what was the
delimiters/formatters part of the library. They are now given the better
name of "decorators".

io::decoration< CharT, id > [formatter/impl/decoration.hpp] -- a decoration
is a property-like object that provides the value (as a std::basic_string<
CharT > object) associated with a particular decorator id. The id dictates
the decoration type. Currently there are three types: open ( 0 ); close ( 1
); and separator ( 2 ). You can use a decoration like this:

   io::decoration< char, 0 > decor; // empty decorator
   std::cout << decor(); // get value: decor == std::string();
   std::cout << decor( std::cout ); // get value associated with the stream
== "[ "
   decor = "[{ "; // provide a custom decoration value

io::decorate< CharT > [formatter/impl/decorate.hpp] -- controls the open,
close and separator values on a stream. There are typedefs for char and
wchar_t streams:

   std::cout << io::cdecorate( "<< ", " >>" ); // override stream decorator
defaults

NOTE: io::decorate will only accept const CharT * types. This is because
pword (used to implement the stream decorator defaults) is not dependant on
CharT, so it is complex (if not impossible) to allocate an object based on
the CharT value of a templated stream object.

io::wrapper_decorators< CharT > [formatter/impl/wrapper_decorators.hpp] --
stores open/close decoration values allowing you to control their values
using the decorate() function.

io::sequence_decorators< CharT > [formatter/impl/sequence_decorators.hpp] --
stores open/close/separator decoration values allowing you to control their
values using the decorate() function. Derives from io::wrapper_decorators<
CharT >.

Regards,
Reece

_________________________________________________________________
Want to block unwanted pop-ups? Download the free MSN Toolbar now!
http://toolbar.msn.co.uk/

*****************************************************************************
** **
** WARNING: This email contains an attachment of a very suspicious type. **
** You are urged NOT to open this attachment unless you are absolutely **
** sure it is legitmate. Opening this attachment may cause irreparable **
** damage to your computer and your files. If you have any questions **
** about the validity of this message, PLEASE SEEK HELP BEFORE OPENING IT. **
** **
** This warning was added by the IU Computer Science Dept. mail scanner. **
*****************************************************************************




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk