summaryrefslogtreecommitdiff
path: root/libs/filesystem/src/path.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/filesystem/src/path.cpp')
-rw-r--r--libs/filesystem/src/path.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/libs/filesystem/src/path.cpp b/libs/filesystem/src/path.cpp
index 784e31a79..22a128545 100644
--- a/libs/filesystem/src/path.cpp
+++ b/libs/filesystem/src/path.cpp
@@ -36,7 +36,7 @@
# include "windows_file_codecvt.hpp"
# include <windows.h>
#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) \
- || defined(__FreeBSD__) || defined(__OPEN_BSD__)
+ || defined(__FreeBSD__) || defined(__OPEN_BSD__) || defined(__HAIKU__)
# include <boost/filesystem/detail/utf8_codecvt_facet.hpp>
#endif
@@ -254,6 +254,13 @@ namespace filesystem
return *this;
}
+ path& path::remove_trailing_separator()
+ {
+ if (!m_pathname.empty() && is_separator(m_pathname[m_pathname.size() - 1]))
+ m_pathname.erase(m_pathname.size() - 1);
+ return *this;
+ }
+
path& path::replace_extension(const path& new_extension)
{
// erase existing extension, including the dot, if any
@@ -660,11 +667,11 @@ namespace filesystem
const path& dot_path()
{
# ifdef BOOST_WINDOWS_API
- static const fs::path dot(L".");
+ static const fs::path dot_pth(L".");
# else
- static const fs::path dot(".");
+ static const fs::path dot_pth(".");
# endif
- return dot;
+ return dot_pth;
}
BOOST_FILESYSTEM_DECL
@@ -831,7 +838,7 @@ namespace
std::locale global_loc = std::locale();
return std::locale(global_loc, new windows_file_codecvt);
# elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) \
- || defined(__FreeBSD__) || defined(__OpenBSD__)
+ || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__)
// "All BSD system functions expect their string parameters to be in UTF-8 encoding
// and nothing else." See
// http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPInternational/Articles/FileEncodings.html