Boost logo

Boost :

From: Jan Langer (jan_at_[hidden])
Date: 2002-03-07 17:17:39


On Thu, 7 Mar 2002, Jeff Garland wrote:
>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
> directory_iterator ditr(directory_iterator::roots) ditr; // will return "A:\
>C:\ ..."
>
>I think this could be done portably and still no global state. Of course, no
>guarantees if someone mounts a new drive or changes the current working
>directory after iteration has begun....

i think this is a better solution. but it only works for roots, because
i want to have the value of the current_directory and not its entries.

-- 
jan langer ... jan_at_[hidden]
"pi ist genau drei"

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