Boost logo

Boost :

From: Alexei Novakov (alexei_novakov_at_[hidden])
Date: 2002-11-22 14:03:49


"Pavol Droba" <droba_at_[hidden]> wrote in message
news:20021122085106.D5713_at_lenin.felcer.sk...
> Hi,
>
> On Thu, Nov 21, 2002 at 02:48:09PM -0500, Alexei Novakov wrote:
>
> [snip]
>
> > > Alexei.
> > >
> > > Cool, I'd definitely use it
> > > Seeing as there is a move to submit a library of string helpers at the
> > > moment it might be worth submitting this at the same time!
> > >
> > > Vin
> > >
> >
> > I think that these two libs (sub_string and string_algo) could benefit
from
> > each other. How do I share the code so that members could see it and try
it?
> >
> > Alexei.
> >
>
> I'm working on the string_algo library. It has a different orientation in
some way,
> but I think there are places in which these two libs can benefit from each
other.
>
> There is the boost sandbox cvs and you can read about it from boost web
page.
> If you gain access to is, you can have a look into my string_algo lib.
>
> Then we can maybe try to find out where we could join our efforts.
>
> Regards,
>
> Pavol
>

Oh yes, I did so some time ago and played with string_algo. It seams to me
that more convenient and natural return type for kinds of trimmers and
sub_string extractors would be dedicated sub_string class rather than pair
of iterators. You are using a little bit different approach - your
algorithms are sequence oriented rather than string oriented. On one hend
string is a sequence of chars, but on the other there is a good reason why
dedicated string class was introduced instead of vector<char>. Consider the
code:

string str(" ***123 ");
sub_string ss = trim(str); // ss == "***123", but no allocation is done yet.
// work with ss as with basic_string.
// We need to do another trim.
ss = left_trim(ss, "*"); // ss == "123", still no allocation.
// Let's create real string now;
string str1 = ss; // str1 == "123"

sub_string is not really usable without a good set of string oriented
algorithms, as well as algorithms look pretty bulky without being backed up
by good utility classes.

What do you think?

Alexei.


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