summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/libs/filesystem/v3/src/path.cpp')
-rw-r--r--3rdParty/Boost/src/libs/filesystem/v3/src/path.cpp22
1 files changed, 4 insertions, 18 deletions
diff --git a/3rdParty/Boost/src/libs/filesystem/v3/src/path.cpp b/3rdParty/Boost/src/libs/filesystem/v3/src/path.cpp
index 53a4cc6..cc30570 100644
--- a/3rdParty/Boost/src/libs/filesystem/v3/src/path.cpp
+++ b/3rdParty/Boost/src/libs/filesystem/v3/src/path.cpp
@@ -27,6 +27,7 @@
#include <boost/scoped_array.hpp>
#include <boost/system/error_code.hpp>
#include <boost/assert.hpp>
+#include <algorithm>
#include <cstddef>
#include <cstring>
#include <cassert>
@@ -155,27 +156,17 @@ namespace filesystem3
# ifdef BOOST_WINDOWS_API
- void path::m_portable()
- {
- for (string_type::iterator it = m_pathname.begin();
- it != m_pathname.end(); ++it)
- {
- if (*it == L'\\')
- *it = L'/';
- }
- }
-
const std::string path::generic_string(const codecvt_type& cvt) const
{
path tmp(*this);
- tmp.m_portable();
+ tmp.make_preferred();
return tmp.string(cvt);
}
const std::wstring path::generic_wstring() const
{
path tmp(*this);
- tmp.m_portable();
+ tmp.make_preferred();
return tmp.wstring();
}
@@ -216,12 +207,7 @@ namespace filesystem3
# ifdef BOOST_WINDOWS_API
path & path::make_preferred()
{
- for (string_type::iterator it = m_pathname.begin();
- it != m_pathname.end(); ++it)
- {
- if (*it == L'/')
- *it = L'\\';
- }
+ std::replace(m_pathname.begin(), m_pathname.end(), L'\\', L'/');
return *this;
}
# endif