Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2004-11-23 18:21:31


At 03:16 PM 11/23/2004, Rich Johnson wrote:

>Yup. This is getting further into hypothetical design than is probably
>appropriate, but....assuming the FS provides an is_name_equivalent()
>convenience function (which I think it should):
>
>A monolithic 'is_name_equivalent()' function that sets up and tears
>down a regex each time it's invoked would have performance issues when
>used in the context of the globber.
>
>A reusable 'name_comparator' object(functor) supplied by the FS layer
>could be instantiated once as part of the glob_predicate.
>
>Of course this raises the issue of what happens when you glob across a
>FS boundary(mount points and links)--must the name_comparator change
>accordingly?

On Windows, it is not possible to tell if two names (or paths) are
equivalent just by looking at the name (or path). The question can only be
answered by inspecting the current state of the filesystem.

For example, if a directory contains both files "A" and "a", then these two
names are not equivalent. But if the directory only contains a file named
"A", then "a" is equivalent in that directory at the current time. Since
you can't determine equivalence, if neither exist then the equivalent()
function throws in that case.

--Beman


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