Boost logo

Boost :

Subject: Re: [boost] [filesystem] #6521 Directory listing using C++11 range-based for loops
From: Olaf van der Spek (ml_at_[hidden])
Date: 2012-04-20 06:45:06


On Fri, Apr 20, 2012 at 11:24 AM, Thorsten Ottosen
<thorsten.ottosen_at_[hidden]> wrote:
> On 20-04-2012 10:12, Thorsten Ottosen wrote:
>>
>> On 19-04-2012 17:29, Beman Dawes wrote:
>
>
>> then we could add
>>
>> boost::iterator_range<...>
>> boost::directory_range( const boost::path& )
>> boost::iterator_range<...>
>> boost::recursive_directory_range( const boost::path& )

What's the advantage over the other suggestion?
>
> Then, if we wanted to make a really user-friendly interface, we could add
>
> boost::iterator_range<...>
> boost::directory_range( const boost::path&, const boost::path& extension )
>
> support for multiple extensions or reguar expression would be cool, e.g.
>
>   boost::directory_range( "some_path/", "(.txt|.doc|.jpg)" )
>
> and support for the reverse sitution
>
> boost::iterator_range<...>
> boost::directory_range( const boost::path&, const boost::regex& toExclude )
>
> Especially for recursive iteration, it is useful to skip entire directories.

That doesn't appear to scale. What if I want to have both include and
exclude params?

Olaf


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