summaryrefslogtreecommitdiff
path: root/src/filesystem.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-09-23 23:12:41 +0200
committerCarl Hetherington <cth@carlh.net>2024-09-23 23:12:41 +0200
commitadae04e0984d294aa9a95394bfed584ce7e93469 (patch)
treed547dca1e630961d5d1d9226bebb4aa343fa317f /src/filesystem.cc
parent466a21fbf04f9b5ee1bcddc0f9cee6c454799006 (diff)
Fix the boost copy_option{,s} change a different way.
The previous solution required the correct define to be present when including libdcp, which seems a bit awkward.
Diffstat (limited to 'src/filesystem.cc')
-rw-r--r--src/filesystem.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/filesystem.cc b/src/filesystem.cc
index 98c3d1b7..4cbbc3d4 100644
--- a/src/filesystem.cc
+++ b/src/filesystem.cc
@@ -107,13 +107,15 @@ dcp::filesystem::copy_file(boost::filesystem::path const& from, boost::filesyste
void
+dcp::filesystem::copy_file(boost::filesystem::path const& from, boost::filesystem::path const& to, CopyOptions option)
+{
#ifdef LIBDCP_HAVE_COPY_OPTIONS
-dcp::filesystem::copy_file(boost::filesystem::path const& from, boost::filesystem::path const& to, boost::filesystem::copy_options option)
+ auto const options = option == CopyOptions::OVERWRITE_EXISTING ? boost::filesystem::copy_options::overwrite_existing : boost::filesystem::copy_options::none;
#else
-dcp::filesystem::copy_file(boost::filesystem::path const& from, boost::filesystem::path const& to, boost::filesystem::copy_option option)
+ auto const options = option == CopyOptions::OVERWRITE_EXISTING ? boost::filesystem::copy_option::overwrite_if_exists : boost::filesystem::copy_option::none;
#endif
-{
- boost::filesystem::copy_file(dcp::filesystem::fix_long_path(from), dcp::filesystem::fix_long_path(to), option);
+
+ boost::filesystem::copy_file(dcp::filesystem::fix_long_path(from), dcp::filesystem::fix_long_path(to), options);
}