summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2023-02-22 01:54:41 +0100
committerAdmiral H. Curtiss <pikachu025@gmail.com>2023-02-22 11:43:58 +0100
commite52aa52a664b602a8917e69f6db4aefc6258f46c (patch)
tree5a01d76ceed06c488ff6a19e394cf13b6367e5bc /Source/Core/Common
parent3c4a21315d14fbc8c492b86b4d2dec13bc648a01 (diff)
Common/FileUtil: Rename Copy() to CopyRegularFile().
This is to clarify that it can only copy files, not folders.
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/FileUtil.cpp3
-rw-r--r--Source/Core/Common/FileUtil.h5
2 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp
index f1e0517644..0d4288c609 100644
--- a/Source/Core/Common/FileUtil.cpp
+++ b/Source/Core/Common/FileUtil.cpp
@@ -312,8 +312,7 @@ bool RenameSync(const std::string& srcFilename, const std::string& destFilename)
return true;
}
-// copies file source_path to destination_path, returns true on success
-bool Copy(const std::string& source_path, const std::string& destination_path)
+bool CopyRegularFile(std::string_view source_path, std::string_view destination_path)
{
DEBUG_LOG_FMT(COMMON, "{}: {} --> {}", __func__, source_path, destination_path);
diff --git a/Source/Core/Common/FileUtil.h b/Source/Core/Common/FileUtil.h
index 4fd2d950f5..ff71d394bc 100644
--- a/Source/Core/Common/FileUtil.h
+++ b/Source/Core/Common/FileUtil.h
@@ -169,8 +169,9 @@ bool Rename(const std::string& srcFilename, const std::string& destFilename);
// ditto, but syncs the source file and, on Unix, syncs the directories after rename
bool RenameSync(const std::string& srcFilename, const std::string& destFilename);
-// copies file srcFilename to destFilename, returns true on success
-bool Copy(const std::string& srcFilename, const std::string& destFilename);
+// Copies a file at source_path to destination_path, as if by std::filesystem::copy_file().
+// If a file already exists at destination_path it is overwritten. Returns true on success.
+bool CopyRegularFile(std::string_view source_path, std::string_view destination_path);
// creates an empty file filename, returns true on success
bool CreateEmptyFile(const std::string& filename);