I've read the documentation a little closer at this page:
http://www.boost.org/doc/libs/1_35_0/libs/filesystem/doc/index.htm#tutorial
I find that it will store paths as forward slashes, and only when you
call basic_path::file_string() will it convert to the platform format.
However at this time I cannot figure out if file_string() is returning
a std::string by-reference or by-value (Still looking through the
source for answers to this).
On Thu, Apr 24, 2008 at 2:49 PM, Markus Svilans <msvilans@gmail.com> wrote:
Hi Robert,
I have used Boost paths on Windows like this:
namespace bf = boost::filesystem;
bf::path temp("C:\\Windows\\System32\\", bf::native);
Adding the "native" parameter tells the path object it is parsing a
Windows path (if compiling on Windows).
To my knowledge, the path object will always store paths in its own
internal format, which uses front slashes as directory separators. More
info on this is in the boost::filesystem documentation.
The basic_path::file_string() method returns the path in the operating
system native format, if I'm not mistaken.
Regards,
Markus.
> ------------------------------------------------------------------------
Robert Dailey wrote:
> Hi,
>
> I create the following object:
>
> boost::filesystem::path mypath( "SomeFolder/OnWindows/SubFolder" );
>
> In Microsoft Windows, the standard slash direction is "\", so when I
> run the above in the debugger, I notice m_path is still using forward
> slashes ("/"). I would have expected the slashes to be normalized. Am
> I misunderstanding something? How can I construct a path object like
> above and have it normalize the slashes? Thanks.
>
> _______________________________________________
> Boost-users mailing list
> Boost-users@lists.boost.org
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users