Boost logo

Boost :

From: Neal D. Becker (nbecker_at_[hidden])
Date: 2003-12-16 08:12:49


On Monday 15 December 2003 05:24 pm, Pavol Droba wrote:
> On Mon, Dec 15, 2003 at 04:29:36PM -0500, Neal D. Becker wrote:
> > On Monday 15 December 2003 01:21 pm, Jaakko Jarvi wrote:
> > > On Mon, 15 Dec 2003, Neal D. Becker wrote:
> > > > I understand from the tuple docs that the default separation
> > > > character is space. Is that any whitespace, or only a space
> > > > character?
> > >
> > > The default is ' ', or more precisely s.widen(' '), where s is the
> > > stream in question.
> > >
> > > While reading in a tuple from a stream, it is first examined whether
> > > the separator character d is a white space character with
> > >
> > > std::isspace(d, is.getloc())
> > >
> > > If so, then any other whitespace is accepted as the separator too.
> > > If d is not whitespace, the separator can be
> > > whitespace* d whitespace*
> >
> > Thanks for the info.
> >
> > What do you think of my other suggestion, to generalize the
> > classification of characters, using a policy?
>
> Why a policy? Simple predicate would be enough. I have already devised a
> set of classification predicates for the string algorithm library. These
> predicates can be also combined to handle complicated classes. And, of
> course, a user can always come up with a custom predicate.
>
> It is simple and powerful. One would only have to store a predicate
> (possibly in boost::function) and use for parsing.
>

That sounds reasonable. So, if I understand you correctly, work on the string
classification lib is done, but is not integrated into tuple io? In fact,
tuple io character classification is currently hardwired, correct? (The
specific character that constitutes any class is programmable, but the
classification algorithm itself is not)?


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