Boost logo

Boost Users :

Subject: Re: [Boost-users] Program Options of Filesystem Path's - confused!
From: Daniel James (dnljms_at_[hidden])
Date: 2010-08-16 18:38:32


On 16 August 2010 22:58, John Dlugosz <JDlugosz_at_[hidden]> wrote:
>
>> >        lexical_cast<fs::wpath>(fs::wpath("the path that fails"))
>
> Making the string literal a L-string (L"the path that fails"), it won't compile.  The spiel is attached at the end of this message.
>
>> >
>> > If that fails, it means operator>> is mishandling spaces in paths.
>>
>>     lexical_cast<fs::wpath>("the path that fails")
>>
>
> Correcting to make the string L, it throws an exception "bad lexical cast: source type value could not be interpreted as target"
>
> You ask if it's version 2 or version 3 of the fs library:
> It doesn't say!

Sorry, that was my mistake. Version 2 has the space problem in 1.43,
but not in 1.44. Version 3 is introduced in 1.44 but works in a
different way and has the space problem. I don't know how well it (or
lexical cast) handles L-strings. I've brought up the space issue on
the development list, but I'm having a bit of trouble explaining it.
Until a conclusion is reached, I'd suggest using strings in program
options, and then constructing the filesystem path yourself.

Daniel


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net