Pass std::string's by reference when possible.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7268 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice
2011-03-01 05:16:32 +00:00
parent 7be1080dff
commit df809630c5
2 changed files with 28 additions and 28 deletions

View File

@ -74,13 +74,13 @@ struct FSTEntry
};
// Returns true if file filename exists
bool Exists(const std::string filename);
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);
// Returns the size of filename (64bit)
u64 GetSize(const std::string filename);
u64 GetSize(const std::string &filename);
// Overloaded GetSize, accepts file descriptor
u64 GetSize(const int fd);
@ -89,42 +89,42 @@ u64 GetSize(const int fd);
u64 GetSize(FILE *f);
// Returns true if successful, or path already exists.
bool CreateDir(const std::string filename);
bool CreateDir(const std::string &filename);
// Creates the full path of fullPath returns true on success
bool CreateFullPath(const std::string fullPath);
bool CreateFullPath(const std::string &fullPath);
// 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);
// Deletes a directory filename, returns true on success
bool DeleteDir(const std::string filename);
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);
// 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);
// creates an empty file filename, returns true on success
bool CreateEmptyFile(const std::string filename);
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
u32 ScanDirectoryTree(const std::string directory, FSTEntry& parentEntry);
u32 ScanDirectoryTree(const std::string &directory, FSTEntry& parentEntry);
// deletes the given directory and anything under it. Returns true on success.
bool DeleteDirRecursively(const std::string directory);
bool DeleteDirRecursively(const std::string &directory);
// Returns the current directory
std::string GetCurrentDir();
// 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);
// Set the current directory to given directory
bool SetCurrentDir(const std::string directory);
bool SetCurrentDir(const std::string &directory);
// Returns a pointer to a string with a Dolphin data dir in the user's home
// directory. To be used in "multi-user" mode (that is, installed).