|
Boost : |
From: Stewart, Robert (stewart_at_[hidden])
Date: 2002-03-08 09:35:32
From: Jeff Garland [mailto:jeff_at_[hidden]]
>
> I like what you want to do with hierarchy_iterator except I
> see no need for a
> different type. It is plain and simple a directory_iterator.
> Consider the
> following:
>
> class directory_iterator {
> public:
> enum special_locations {roots, current_working, current_root};
> directory_iterator(special_locations);
> //...
> };
>
> On Unix
> directory_iterator ditr(directory_iterator::roots) ditr; //
> will return "/"
>
> On Unix
^^^^
DOS/Windows
> directory_iterator ditr(directory_iterator::roots) ditr; //
> will return "A:\
> C:\ ..."
I like it. Functions that take a directory_iterator to move, rename,
create, or delete a file will be stopped by permissions on the fake
directory object.
Rob
Susquehanna International Group, LLP
http://www.sig.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk