Boost logo

Boost Users :

From: Lawrence Spector (Lawrence.Spector_at_[hidden])
Date: 2007-10-05 09:29:56


That would definitely be very good if it could be added for the next major version of Boost. It would be a relatively simple addition. The file_iterator from Regex/v4 would need a few minor modifications to match the style of directory_iterator from Boost.FileSystem. Or, in all honesty, the directory_iterator from Boost.Filesystem is very close, except that the code that takes action based on the assumption that it's a directory path adds '/*' to the end. If the directory_iterator was configurable or there was a version (perhaps called file_iterator) that didn't append '/*' to the end of the directory lookup, then it would serve this purpose.

Thanks,

Lawrence

-----Original Message-----
From: boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of John Maddock
Sent: Thursday, October 04, 2007 4:53 AM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] [Boost.FileSystem] File or Wildcards in Path? How-to do this?

Lawrence Spector wrote:
> Correct. That is the issue. It's not just wildcards, it also seems
> that directory_iterator won't handle a single file either (e.g.:
> C:\config.sys). The file_iterator in regex just seems like it's in
> the wrong place. I also think this is common functionality that one
> can't reasonably be expected to know exists without deep digging (my
> coworker found it by suspecting that it would likely call
> FindFirstFileA in its implementation and searching on that).
>
> Also, the file_iterator in regex doesn't seem to precisely follow the
> directory_iterator's style. For example, you can't pass a
> boost::filesystem::path object to the file_iterator. Another issue
> is that there's no wide version of the file_iterator.
>
> I do think this needs some cleaning up, if for no other reason than
> it seems inconsistent.

Well it's a common enough task that we really should do something about it:
the file-iterators in Boost.Regex are old pre-boost code used in a
now-deprecated part of the regex lib. I guess what we really need is a new
library submission built on top of Boost.Filesystem. Any takers?

John.

_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net