|
Boost Users : |
Subject: Re: [Boost-users] Open a filename with a wstring or wchar_t *
From: Bo Jensen (jensen.bo_at_[hidden])
Date: 2010-08-02 16:39:38
On Mon, Aug 2, 2010 at 8:32 PM, Timothy Madden <terminatorul_at_[hidden]> wrote:
> Bo Jensen wrote:
>>
>> On Mon, Aug 2, 2010 at 2:03 PM, Timothy Madden <terminatorul_at_[hidden]>
>> wrote:
>>>
>>> Bo Jensen wrote:
>>>>
>>>> I use :
>>>>
>>>> typedef boost::filesystem::wpath SlmWPath;
>>>> typedef boost::filesystem::wfstream SlmWfstream;
>>>> typedef boost::filesystem::wofstream SlmWOfstream;
>>>> typedef boost::filesystem::wifstream SlmWIfstream;
>>>
>>> Yes, I can create wide streams, what I want is to pass a wide string as
>>> the
>>> file name to be opned.
>>
>> This should work :
>>
>> boost::filesystem::wfstream test;
>>
>> test.open(L"somepath");
>>
>> The above typedefs was just to show the tools you need from booost
>> filesystem.
>
> Oh, yes, you are right !
>
> It must be the 'Additions to <fstream>' thing, that construct an ifstream
> from a filesystem::path/wpath. Actually I do not even have a wchar_t * in my
> program, I use a wpath ! :)
I don't know all the details, but on windows I think filenames is only
utf-16. On linux you should be safe, what ever locale you use. I would
be interested to hear how it worked out.
>
> I guess Bjarne was right, the boost documentation is a challenge for a
> newcomer. :) And I like to think of myself as a tough guy ...
>
> Thank you,
> Timothy Madden
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
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