Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2003-04-20 15:22:46


At 02:17 PM 4/20/2003, Edward Diener wrote:
>Beman Dawes wrote:
>> At 08:22 AM 4/9/2003, Christian Engström wrote:
>>
>> >In my application I need to handle paths that contain wildcards,
>> such as >for example "foo/chapter?.txt" or "bar/*/index.html".
>>
>> I think that your need is both valid and commonplace, but that the
>> way to handle it isn't necessarily to modify the filesystem library.
>>
>> Rather, think about using a filter iterator. See
>> www.boost.org/libs/utility/filter_iterator.htm
>>
>> There are a couple of caveats: (1) I haven't actually tried it, so
>> don't
>> know if it is a practical solution, and (2) Dave, Jeremy, and Thomas
>> are working on a major update to iterator adaptors so details may
>> change once they are done.
>
>What good is a filter iterator adaptor supposed to accomplish in this
>situation ?

The idea is that rather than directory iteration returning iterators for
all path entries, it would only return those which passed a predicate which
was driven by the pattern. For some uses, the pattern might more flexibly
be a regular expression rather than the traditional (but non-portable)
wildcard patterns provided by various operating systems.

--Beman


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