Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2002-10-18 10:33:02


> I'm working on very small lib, which I found very usefull,
> and I'd like to ask is what is your opinion of it usability.
>
> Many times I was missing some fundamental string manipulation routines,
> which are not part of STL, especially functions link trim and various
> conversion routines like to_upper and to_lower.
>
> Although these function are realy simple, I found it as a pain in the neck
> to reimplement them every time I need them.
> Now I'm putting them in one lib in some nice looking manner.
>
> So is there anyone who thinks, that something like this shoud be useful
enough
> to include it in the boost?

Oh yes. I also found myself writing these:

 inline bool contains( string_c& s, string_c& other )
 inline bool contains_back( string_c& s, string_c& back )
 inline bool contains_front( string_c& s, string_c& front )
 inline string substr_until( string_c& s, string_c& end )
 inline string substr_after( string_c& s, string_c& begin )
 inline string substr_without( string_c& s, string_c& out )
 inline void erase_all( string& s, string_c& what )
 inline void erase_front( string& s, string_c& what )
 inline void erase_back( string& s, string_c& what )

 typedef std::pair<string, string> string_pair;
 inline string_pair split( string_c& s, string_c at )

I not sure they are the best possible names, and maybe they should
beoverloaded for char, but atleast it shows some
convinience I needed.

regards

Thorsten, AAU


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