Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2004-10-27 03:06:00


>
> As I stated in my review, I conceive of the output formatters library as an
> inverse to Spirit. I'n many cases loss of information is desirable, so there is

Yes, I agree.

> no natural way to support input. However, I'm now proposing *in addition* a
> lightweight facility that could become part of the standard library. My
> impression from sitting in with the library working group is that both input and
> output would be desired for such a facility. While I admire Boost.Serialize very

I agree with you, but since this should be a very lightweight facility,
it is my impression that it should be a different lib altogether.

>
>
> I've written a sample implementation over the weekend which I'll post as soon as
> I have time to document it. Sample use:
>
> // pseudo code initialization:
> vector< list< pair<string, string> > > v =
> { { make_pair("hello", "goodbye"),
> make_pair("morning", "evening"),
> make_pair("cold", "hot") },
> { make_pair("hello", "goodbye"),
> make_pair("morning", "evening"),
> make_pair("cold", "hot") } };
>
> int flags = punc::indent_after_open |
> punc::break_after_sep;
>
> cout << punctuate< vector<_> >("[", ",", "]", flags)
> << punctuate< list<_> >("{", ",", "}", flags)
> << punctuate< pair<_, _> >("(", ":", ")")
> << v << "\n";
>
> Output:
>
> [
> {
> (hello:goodbye),
> (morning:evening),
> (cold:hot)
> },
> {
> (hello:goodbye),
> (morning:evening),
> (cold:hot)
> }
> ]
>
> It provides input and output, but no string-escaping (yet). Right now, a string
> is regarded to be complete as soon as an appropriate punctuaion sequence is
> encountered.
>

It's a good start ;)
>
> I hope you're not directing this remark at me. I've worked with Reece on his
> library since before it was in the sandbox. Early on I sent him some sketches of
> my ideas for his library, and was hoping to produce a sample implementation.
> Unfortunately, I got too busy.
>

no, it was not directed at you

Best,
John

-- 
John Torjo,    Contributing editor, C/C++ Users Journal
-- "Win32 GUI Generics" -- generics & GUI do mix, after all
-- http://www.torjo.com/win32gui/
-- v1.5 - tooltips at your fingertips (work for menus too!)
    + bitmap buttons (work for MessageBox too!)
    + tab dialogs, hyper links, lite html

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