11 August 2004
String algorithms library from Boost
While I was looking to see if Boost had updated their site to include documentation for the multi-index containers, I saw that the next version will have a string algorithm library. Their site seems to be a mess now, but I found the documentation here.
Damn if it isn't everything that I had already written, but of course done so much more elegantly.
A few juicy features:
- Case conversion (to_upper, to_lower),
- Trimming (predicate-based),
- Find algorithms (including token-based and regular expressions),
- Formatting (convert to valid input: NULL-to-empty-string, etc.)
The Quick Reference section lists all of the details in grouped tables. A big plus about many of these functions is that they work on std::string and std::wstring. All of the standard library algorithms and predicates work on single characters, so you have to un-intuitively treat strings as character containers and iterate through using begin() and end(). This new Boost library smooths all of that out.
Codermonkey and I were just discussing string processing today (yeah, I know: GEEKS). He dislikes the lack of native string type in C++, although I almost have him indoctrinated into the cult of the angle brackets.
I'm much more forgiving of C++ because of the language's ability to abstract away much of the difficulties, a la Boost's string library.
Ahh, but some programmers at this hypothetical company still hate template programming. One recently found the Boost library in SourceSafe and asked we're a big company: why are we using this shareware?
I can only hope to be able to write "shareware" with these uber-geeks someday. They are defining the future of C++, having written books and served on the standards committees, and some hack is copping an attitude. Idiot.
- Techniques after using Swift for a month posted by sstrader on 26 August 2015 at 11:41:51 PM
- Some thoughts on Ruby after finishing a week (minus one day) of training posted by sstrader on 15 December 2011 at 8:59:30 PM
- Links on the singleton pattern posted by sstrader on 9 December 2011 at 9:19:50 AM
- Phonebot posted by sstrader on 29 October 2011 at 6:37:05 PM
- The labeled break in Java posted by sstrader on 4 September 2011 at 11:27:56 AM