Boost logo

Boost :

From: Thomas Witt (witt_at_[hidden])
Date: 2003-08-11 15:03:15


David Abrahams wrote:

> Thomas Witt <witt_at_[hidden]> writes:
>
>
>>What would be the native representation for the following native
>
> ^^^^^^ ^^^^^^

Sigh!

>
>>paths
>>
>>C:\C\foo
>>\C\foo
>>C:\foo
>
>
> Not a very interesting challenge.
>
> "C:\C\foo"
> "\C\foo"
> "C:\foo"

Grrr...

>
> I assume you mean the portable representation of the native paths:
>
> "/C/C/foo"
> "/" + *current_path().begin() + "/C/foo" (**)
> "/C/foo"
>
> (**) There is no way to represent "The foo subdirectory of the C
> directory of the current drive" portably, because it isn't a portable
> concept.

I would argue that different drives are the non-portable concept.

> Therefore, we could pick other sensible answers for the
> middle path, e.g.:
>
>
> 1. Exception is thrown
>
> 2. "./C/foo"
>
> 3. "/*/C/foo" where '*' is some character not normally allowed
> in portable paths.
>

I think your proposal is clearly inferior to what we currently have.
With your solution the set of valid portable paths is dependent on the
set of valid roots on a given platform. I.e. all portable(syntax) paths
starting with a slash are essentially non-portable.

Thomas


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