From a11b9d585f0d4668a8d4f698e0d03d1c79013eac Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Fri, 24 Feb 2023 21:48:48 +0100 Subject: [PATCH] Common/FileUtil: Remove obsolete CopyDir() function. --- Source/Core/Common/FileUtil.cpp | 23 ----------------------- Source/Core/Common/FileUtil.h | 4 ---- 2 files changed, 27 deletions(-) diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index 333831d39f..d456952980 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -610,29 +610,6 @@ bool MoveWithOverwrite(std::string_view source_path, std::string_view dest_path) return true; } -// Create directory and copy contents (optionally overwrites existing files) -bool CopyDir(const std::string& source_path, const std::string& dest_path, const bool destructive) -{ - auto src_path = StringToPath(source_path); - auto dst_path = StringToPath(dest_path); - if (fs::equivalent(src_path, dst_path)) - return true; - - DEBUG_LOG_FMT(COMMON, "{}: {} --> {}", __func__, source_path, dest_path); - - auto options = fs::copy_options::recursive; - if (destructive) - options |= fs::copy_options::overwrite_existing; - std::error_code error; - bool copied = fs::copy_file(src_path, dst_path, options, error); - if (!copied) - { - ERROR_LOG_FMT(COMMON, "{}: failed {} --> {}: {}", __func__, source_path, dest_path, - error.message()); - } - return copied; -} - // Returns the current directory std::string GetCurrentDir() { diff --git a/Source/Core/Common/FileUtil.h b/Source/Core/Common/FileUtil.h index 53d5d46d3f..cadabbd541 100644 --- a/Source/Core/Common/FileUtil.h +++ b/Source/Core/Common/FileUtil.h @@ -200,10 +200,6 @@ bool Copy(std::string_view source_path, std::string_view dest_path, // completed. bool MoveWithOverwrite(std::string_view source_path, std::string_view dest_path); -// Create directory and copy contents (optionally overwrites existing files) -bool CopyDir(const std::string& source_path, const std::string& dest_path, - bool destructive = false); - // Set the current directory to given directory bool SetCurrentDir(const std::string& directory);