Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6813: canonical function converts root-directory separator from '\' to '/' on Windows
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-04-20 22:49:30
#6813: canonical function converts root-directory separator from '\' to '/' on
Windows
------------------------------------------------------+---------------------
Reporter: Alex Goldberg <alex.goldberg@â¦> | Owner: bemandawes
Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.49.0 | Severity: Problem
Resolution: | Keywords: canonical
------------------------------------------------------+---------------------
Comment (by Aaron Barany <akb825@â¦>):
This is also a general problem if you try to iterate over a path and
reconstruct it with operator/. For example, if you have the following
code:
{{{#!c++
boost::filesystem::path path = "C:\\Foo\\Bar\\Baz";
boost::filesystem::path finalPath;
for (boost::filesystem::path::iterator iter = path.begin(); iter !=
path.end(); ++iter)
finalPath /= *iter;
}}}
The result for finalPath is going to be "C:/Foo\Bar\Baz". One way to solve
this problem with keeping the iterator behavior the same is to always
convert path separators to the preferred separator when appending paths.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6813#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC