|
|
|
@ -202,11 +202,7 @@ boost::filesystem::path filesystem::get_canonical_path(const boost::filesystem:: |
|
|
|
boost::filesystem::path filesystem::get_relative_path(const boost::filesystem::path &path, const boost::filesystem::path &base) noexcept { |
|
|
|
boost::filesystem::path filesystem::get_relative_path(const boost::filesystem::path &path, const boost::filesystem::path &base) noexcept { |
|
|
|
boost::filesystem::path relative_path; |
|
|
|
boost::filesystem::path relative_path; |
|
|
|
boost::system::error_code ec; |
|
|
|
boost::system::error_code ec; |
|
|
|
#if BOOST_VERSION>=106000 |
|
|
|
|
|
|
|
relative_path=boost::filesystem::relative(path, base, ec); |
|
|
|
|
|
|
|
if(ec) |
|
|
|
|
|
|
|
return boost::filesystem::path(); |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
if(std::distance(path.begin(), path.end())<std::distance(base.begin(), base.end())) |
|
|
|
if(std::distance(path.begin(), path.end())<std::distance(base.begin(), base.end())) |
|
|
|
return boost::filesystem::path(); |
|
|
|
return boost::filesystem::path(); |
|
|
|
|
|
|
|
|
|
|
|
@ -220,6 +216,6 @@ boost::filesystem::path filesystem::get_relative_path(const boost::filesystem::p |
|
|
|
} |
|
|
|
} |
|
|
|
for(;path_it!=path.end();++path_it) |
|
|
|
for(;path_it!=path.end();++path_it) |
|
|
|
relative_path/=*path_it; |
|
|
|
relative_path/=*path_it; |
|
|
|
#endif |
|
|
|
|
|
|
|
return relative_path; |
|
|
|
return relative_path; |
|
|
|
} |
|
|
|
} |
|
|
|
|