From: Pavol Droba (droba_at_[hidden])
Date: 2002-11-22 14:20:47
This message is mostly for people who are interested in the string algorithm library.
New version is in the sandbox.
I have redesigned major part of the library, and I think that now its structure is
in quite stable state. I want to start writing the documentation, but first I'd like
to be sure, that the library will not change too much. ( I'm not very good documenter,
and I hate to do this kind of things twice if I don't have to :) )
So I kindly ask you again, to post any comments, additions and proposals.
Summary of changes:
(i) General naming conventions have changed to be more compliant with STL naming scheme.
It means that:
- Non-mutable version of algorithm have suffix _copy.
- Variants which take a predicate as a selector ( f.e. trim ) have suffix _if.
- Find, replace and erase algorithm can have suffix _first, _last or _nth depending
on the find functor thay you ( will be explained later )
Convention is that a semantic specification have precendece over parameters. so
there is for example erase_first_copy and trim_left_copy_if.
(ii) All trim functions have now _if variant which take a selection predicate as a parameter.
There are 3 predefined functors available through contruct functions. Function names
ar if_isclassified, if_isspace, if_isfrom. ( Check string_funct.hpp for details )
Standard version without suffix map to isspace predicate which I found most common.
(iii) find-replace algorithms have been wholy redesigned.
- string_algo::compare_traits and string_algo::search_traits has added.
Element comparison predicate is now part of traits instead of being a parameter
search_traits is a template defined over iterators and provides compare_function_type (
from compare_traits ) and range_type used as a return value for find functions.
- all algorithms ( except for _all versions ) has been generalized. They now accept a
find algorith as a parameter. There are 3 functors provided for this: find_firstF,
find_lastF and find_nthF. User can write his own find function which is supposed
to find range representin a subsequence in the given input sequence.
For each algorithm there are wrappers for all default find functors. ( f.e there is
replace - generic and replace_first, replace_last, replace_nth )
trim, trim_left, trim_right. All in interator, sequence, mutable and non-mutable
variants. There are also _if variants for all.
(ii) Case conversion:
to_lower, to_lower_copy, to_upper and to_upper_copy.
start_with (both iterator and sequence version), end_with (sequence version only),
contains (both versions)
(iv) Find algorithms:
find, find_first, find_last, find_nth in iterator and sequence versions
(v) Replace algorithms
replace, replace_first, replace_last, replace_nth in iterator and sequence version.
sequence version in mutable and non-mutable variant
(vi) Erase algorithms
Same as replace.
Please check sources and test code in the sandbox for more datails and usage scenario.
Last but not least, I'd like to ask what is needed for library to be commited for submission rewiev?
Thats all folks.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk