From d5fb8323f8763c3a1eb878c30553562b36c07167 Mon Sep 17 00:00:00 2001 From: Beman Date: Fri, 7 Aug 2015 16:50:47 -0400 Subject: [PATCH] Change the name of path::relative to path::relative_to to distinguish it a bit from path::relative_path. --- include/boost/filesystem/operations.hpp | 4 +--- include/boost/filesystem/path.hpp | 2 +- src/path.cpp | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/boost/filesystem/operations.hpp b/include/boost/filesystem/operations.hpp index ef75bde..22e8a5c 100644 --- a/include/boost/filesystem/operations.hpp +++ b/include/boost/filesystem/operations.hpp @@ -654,10 +654,8 @@ namespace boost // TODO: Add error handling inline path relative(const path& p, const path& base) - // [Note: If either p or base is_relative(), user may wish to wrap the call to that - // argument in a call to absolute(). -- end note] { - return semi_canonical(p).relative(semi_canonical(base)); + return semi_canonical(p).relative_to(semi_canonical(base)); } inline diff --git a/include/boost/filesystem/path.hpp b/include/boost/filesystem/path.hpp index 4caaa01..9d7fb9e 100644 --- a/include/boost/filesystem/path.hpp +++ b/include/boost/filesystem/path.hpp @@ -503,7 +503,7 @@ namespace filesystem // ----- lexical operations ----- - path relative(const path& p) const; + path relative_to(const path& p) const; // TODO: document dangers of lack of symlink following, no normalization, // difference of "symlink/.." handling between Windows and POSIX diff --git a/src/path.cpp b/src/path.cpp index 10cbe1c..e180527 100644 --- a/src/path.cpp +++ b/src/path.cpp @@ -405,9 +405,9 @@ namespace filesystem } return std::make_pair(it1, it2); } - } + } // namespace detail - path path::relative(const path& base) const + path path::relative_to(const path& base) const { std::pair mm = detail::mismatch(begin(), end(), base.begin(), base.end());