Common/FileUtil: Remove obsolete CopyDir() function.

This commit is contained in:
Admiral H. Curtiss 2023-02-24 21:48:48 +01:00
parent 4f462b4ef6
commit a11b9d585f
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
2 changed files with 0 additions and 27 deletions

View File

@ -610,29 +610,6 @@ bool MoveWithOverwrite(std::string_view source_path, std::string_view dest_path)
return true; 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 // Returns the current directory
std::string GetCurrentDir() std::string GetCurrentDir()
{ {

View File

@ -200,10 +200,6 @@ bool Copy(std::string_view source_path, std::string_view dest_path,
// completed. // completed.
bool MoveWithOverwrite(std::string_view source_path, std::string_view dest_path); 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 // Set the current directory to given directory
bool SetCurrentDir(const std::string& directory); bool SetCurrentDir(const std::string& directory);