summaryrefslogtreecommitdiff
path: root/Source/Core/Common/FileUtil.cpp
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2016-01-21 21:27:56 +0100
committermathieui <mathieui@mathieui.net>2016-01-21 21:27:56 +0100
commitf15ffda5a7518cb87a09f301deaeffab0723ec27 (patch)
tree1b32ad5818891950f940189107d433cdf26e0340 /Source/Core/Common/FileUtil.cpp
parent3e283ea9f17aa779832db065b2ecc4b19cf03e83 (diff)
Correct ampersands as well
Diffstat (limited to 'Source/Core/Common/FileUtil.cpp')
-rw-r--r--Source/Core/Common/FileUtil.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp
index fef0e79bc3..5084bf545b 100644
--- a/Source/Core/Common/FileUtil.cpp
+++ b/Source/Core/Common/FileUtil.cpp
@@ -58,7 +58,7 @@ namespace File
// Remove any ending forward slashes from directory paths
// Modifies argument.
-static void StripTailDirSlashes(std::string &fname)
+static void StripTailDirSlashes(std::string& fname)
{
if (fname.length() > 1)
{
@@ -68,7 +68,7 @@ static void StripTailDirSlashes(std::string &fname)
}
// Returns true if file filename exists
-bool Exists(const std::string &filename)
+bool Exists(const std::string& filename)
{
struct stat64 file_info;
@@ -85,7 +85,7 @@ bool Exists(const std::string &filename)
}
// Returns true if filename is a directory
-bool IsDirectory(const std::string &filename)
+bool IsDirectory(const std::string& filename)
{
struct stat64 file_info;
@@ -110,7 +110,7 @@ bool IsDirectory(const std::string &filename)
// Deletes a given filename, return true on success
// Doesn't supports deleting a directory
-bool Delete(const std::string &filename)
+bool Delete(const std::string& filename)
{
INFO_LOG(COMMON, "Delete: file %s", filename.c_str());
@@ -149,7 +149,7 @@ bool Delete(const std::string &filename)
}
// Returns true if successful, or path already exists.
-bool CreateDir(const std::string &path)
+bool CreateDir(const std::string& path)
{
INFO_LOG(COMMON, "CreateDir: directory %s", path.c_str());
#ifdef _WIN32
@@ -181,7 +181,7 @@ bool CreateDir(const std::string &path)
}
// Creates the full path of fullPath returns true on success
-bool CreateFullPath(const std::string &fullPath)
+bool CreateFullPath(const std::string& fullPath)
{
int panicCounter = 100;
INFO_LOG(COMMON, "CreateFullPath: path %s", fullPath.c_str());
@@ -220,7 +220,7 @@ bool CreateFullPath(const std::string &fullPath)
// Deletes a directory filename, returns true on success
-bool DeleteDir(const std::string &filename)
+bool DeleteDir(const std::string& filename)
{
INFO_LOG(COMMON, "DeleteDir: directory %s", filename.c_str());
@@ -244,7 +244,7 @@ bool DeleteDir(const std::string &filename)
}
// renames file srcFilename to destFilename, returns true on success
-bool Rename(const std::string &srcFilename, const std::string &destFilename)
+bool Rename(const std::string& srcFilename, const std::string& destFilename)
{
INFO_LOG(COMMON, "Rename: %s --> %s",
srcFilename.c_str(), destFilename.c_str());
@@ -282,7 +282,7 @@ static void FSyncPath(const char* path)
}
#endif
-bool RenameSync(const std::string &srcFilename, const std::string &destFilename)
+bool RenameSync(const std::string& srcFilename, const std::string& destFilename)
{
if (!Rename(srcFilename, destFilename))
return false;
@@ -306,7 +306,7 @@ 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)
+bool Copy(const std::string& srcFilename, const std::string& destFilename)
{
INFO_LOG(COMMON, "Copy: %s --> %s",
srcFilename.c_str(), destFilename.c_str());
@@ -372,7 +372,7 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename)
}
// Returns the size of filename (64bit)
-u64 GetSize(const std::string &filename)
+u64 GetSize(const std::string& filename)
{
if (!Exists(filename))
{
@@ -440,7 +440,7 @@ u64 GetSize(FILE* f)
}
// creates an empty file filename, returns true on success
-bool CreateEmptyFile(const std::string &filename)
+bool CreateEmptyFile(const std::string& filename)
{
INFO_LOG(COMMON, "CreateEmptyFile: %s", filename.c_str());
@@ -457,7 +457,7 @@ bool CreateEmptyFile(const std::string &filename)
// Scans the directory tree gets, starting from _Directory and adds the
// results into parentEntry. Returns the number of files+directories found
-FSTEntry ScanDirectoryTree(const std::string &directory, bool recursive)
+FSTEntry ScanDirectoryTree(const std::string& directory, bool recursive)
{
INFO_LOG(COMMON, "ScanDirectoryTree: directory %s", directory.c_str());
// How many files + directories we found
@@ -527,7 +527,7 @@ FSTEntry ScanDirectoryTree(const std::string &directory, bool recursive)
// Deletes the given directory and anything under it. Returns true on success.
-bool DeleteDirRecursively(const std::string &directory)
+bool DeleteDirRecursively(const std::string& directory)
{
INFO_LOG(COMMON, "DeleteDirRecursively: %s", directory.c_str());
#ifdef _WIN32
@@ -600,7 +600,7 @@ bool DeleteDirRecursively(const std::string &directory)
}
// Create directory and copy contents (does not overwrite existing files)
-void CopyDir(const std::string &source_path, const std::string &dest_path)
+void CopyDir(const std::string& source_path, const std::string& dest_path)
{
if (source_path == dest_path) return;
if (!File::Exists(source_path)) return;
@@ -666,7 +666,7 @@ std::string GetCurrentDir()
}
// Sets the current directory to the given directory
-bool SetCurrentDir(const std::string &directory)
+bool SetCurrentDir(const std::string& directory)
{
return __chdir(directory.c_str()) == 0;
}
@@ -697,7 +697,7 @@ std::string CreateTempDir()
#endif
}
-std::string GetTempFilenameForAtomicWrite(const std::string &path)
+std::string GetTempFilenameForAtomicWrite(const std::string& path)
{
std::string abs = path;
#ifdef _WIN32
@@ -883,12 +883,12 @@ std::string GetThemeDir(const std::string& theme_name)
return dir;
}
-bool WriteStringToFile(const std::string &str, const std::string& filename)
+bool WriteStringToFile(const std::string& str, const std::string& filename)
{
return File::IOFile(filename, "wb").WriteBytes(str.data(), str.size());
}
-bool ReadFileToString(const std::string& filename, std::string &str)
+bool ReadFileToString(const std::string& filename, std::string& str)
{
File::IOFile file(filename, "rb");
auto const f = file.GetHandle();