
On Wednesday, January 14, 2004, at 10:32 PM, David Abrahams wrote:
Rich Johnson
writes: O.K. I'll do it. But my first task is to get a discussion going on the developer's list.
I'd want to see it decomposed into the following components: This was the approach I took.
1. A function which translates glob patterns into regexes This is the non-trivial part. I've opted to use a two-step process of: - regex_traits to map shell-style meta chars to regex syntax where-ever there's a 1-1 mapping. - a minimal string transform to convert the glob pattern to a regex pattern corresponding to the above traits. The specifics of this implementation are of course subject to debate.
2. A filter_iterator adaptor which uses a regex matching function to match the paths from a directory_iterator
This is the easy part--provide a predicate which encapsulates and invokes the regex produced above. --rich