Boost logo

Boost :

Subject: Re: [boost] [filesystem] Request for comments on proposed relative() function
From: Rob Stewart (robertstewart_at_[hidden])
Date: 2014-05-14 17:54:50


On May 14, 2014 1:39:35 PM EDT, Beman Dawes <bdawes_at_[hidden]> wrote:

>The function has now been renamed from relative() to
>lexically_relative()
>to make clearer that it deal with paths at a purely lexical level.
>
>I probably should have mentioned that work is underway on several
>additional functions to "do-the-right-thing" when the paths exist or
>partially exist in the external file system.
>
>On possibility is to add a semi_canonical() function which behaves like
>canonical() for an existing portion of a path, and then normalizes any
>trailing non-existent portion.
>
> This would allow an additional function that does the right thing for
>existing or partially existing paths. It might be implemented like
>this:
>
>path relative(const path& p, const path& base)
>{
> return lexically_relative(semi_canonical(p), semi_canonical(base));
>}
>
>It isn't clear yet if these semantics are really the most useful.

I haven't looked closely enough, but I wonder if things need to be segregated better such that lexical functions and classes are distinguished from the rest. You could use separate namespaces, for example.

___
Rob

(Sent from my portable computation engine)


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