mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-04 03:46:42 +01:00
Common/FileUtil: Remove obsolete CopyDir() function.
This commit is contained in:
parent
4f462b4ef6
commit
a11b9d585f
@ -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()
|
||||||
{
|
{
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user