lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Using picker controls for paths


From: Greg Chicares
Subject: Re: [lmi] Using picker controls for paths
Date: Sun, 12 Jun 2016 19:58:31 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0

On 2016-06-09 13:46, Vadim Zeitlin wrote:
> On Thu, 9 Jun 2016 12:47:57 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> On 2016-06-07 22:18, Greg Chicares wrote:
> GC> > On 2016-06-07 20:35, Vadim Zeitlin wrote:
> GC> >> On Tue, 7 Jun 2016 20:18:13 +0000 Greg Chicares <address@hidden> wrote:
> GC> [...]
> GC> >> GC> Curiously, if I exit and reload lmi, I see only forward slashes in
> GC> >> GC> both GUI fields, though the xml file contains backslashes.
> GC> >> 
> GC> >>  This is a side effect of using fs::system_complete() in
> GC> >> configurable_settings ctor. FWIW I wouldn't be surprised if newer 
> version
> GC> >> of Boost.Filesystem didn't behave in this way, it looks wrong to me to
> GC> >> change the path separators, especially for an already absolute path.
> GC> > 
> GC> > Agreed.
> GC> 
> GC> Wait--I agreed too quickly. I think instead that it's a side effect of
> GC> using string(), because the boost-1.33.1 documentation says:
> GC> 
> GC> |   path my_path( "foo/bar/data.txt" );
> GC> | On Windows, the output would be:
> GC> |   string------------------: foo/bar/data.txt
> GC> |   native_directory_string-: foo\bar\data.txt
> GC> |   native_file_string------: foo\bar\data.txt

BTW, "On Windows" seems to mean that's the behavior if the OS is msw, but
the behavior actually depends (in boost-1.33.1 at least) on the "checker".
On msw, if the example above is changed thus:
  fs::path("foo\\bar\\data.txt", fs::no_check).string()
then string() prints backslashes--at least when the default "checker" has
been set to "native". This is demonstrated in commit 7666adc... .

>  Just FYI this has completely changed in Boost.Filesystem v3 and C++17
> filesystem library: string() now returns the path in the native format and
> a separate generic_string() must be used to return it in the "generic"
> (i.e. Unix/POSIX-ish) format, see
> 
>       http://en.cppreference.com/w/cpp/experimental/fs/path

That does something useful that is difficult or impossible to do with
the boost-1.33.1 version.

> GC> And this seems to offer a way to achieve the behavior I personally
> GC> prefer: always use forward slashes everywhere.
> 
>  I still don't think it's the behaviour appropriate for the end users under
> MSW platform...

It turns out to be impractical with the msw picker controls.

> GC> Have you already started working on an alternative that would use
> GC> forward slashes in the xml, and backward in the GUI?
> 
>  No, I haven't yet.

commit 7666adcc94bdc103d2955e275981cf035df1e8af




reply via email to

[Prev in Thread] Current Thread [Next in Thread]