Boost logo

Boost Users :

Subject: Re: [Boost-users] Open a filename with a wstring or wchar_t *
From: Timothy Madden (terminatorul_at_[hidden])
Date: 2010-08-02 16:32:05


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 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 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