Boost logo

Boost :

Subject: Re: [boost] [filesystem] #6521 Directory listing using C++11 range-based for loops
From: Dave Abrahams (dave_at_[hidden])
Date: 2012-04-20 11:23:28


on Fri Apr 20 2012, Beman Dawes <bdawes-AT-acm.org> wrote:

> On Fri, Apr 20, 2012 at 9:27 AM, Dave Abrahams <dave_at_[hidden]> wrote:
>>
>>...
>> So, add Boost.Parameter and you get
>>
>>    directory_range('some_path', _recursive=true, _include=string_or_regex, _exclude=string_or_regex)
>>    directory_range('some_path', _exclude=string_or_regex)
>>    directory_range('some_path', _recursive=false)
>
> That's nice, but I think we can do better...
>
>> And then there's
>>
>>    directory_range('some_path') | filtered(predicate1) | filtered(predicate2) ...
>
> Yes, and that's the direction I'm planning to explore.
>
> I'm just now setting up to try out such suggestions.

You may find that post-hoc filtering with "|" is not going to allow you
to avoid traversing into subdirectories that will ultimately be filtered out.
On the other hand, maybe it's possible to do something with expression
templates that saves you from that problem.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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