More conversion from char * to std::string.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7266 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice
2011-03-01 03:06:14 +00:00
parent ba54fac9eb
commit a5b471f490
37 changed files with 338 additions and 444 deletions

View File

@ -57,6 +57,7 @@ enum {
F_RAMDUMP_IDX,
F_ARAMDUMP_IDX,
F_GCSRAM_IDX,
NUM_PATH_INDICES
};
namespace File
@ -73,13 +74,13 @@ struct FSTEntry
};
// Returns true if file filename exists
bool Exists(const char *filename);
bool Exists(const std::string filename);
// Returns true if filename is a directory
bool IsDirectory(const char *filename);
bool IsDirectory(const std::string filename);
// Returns the size of filename (64bit)
u64 GetSize(const char *filename);
u64 GetSize(const std::string filename);
// Overloaded GetSize, accepts file descriptor
u64 GetSize(const int fd);
@ -88,46 +89,46 @@ u64 GetSize(const int fd);
u64 GetSize(FILE *f);
// Returns true if successful, or path already exists.
bool CreateDir(const char *filename);
bool CreateDir(const std::string filename);
// Creates the full path of fullPath returns true on success
bool CreateFullPath(const char *fullPath);
bool CreateFullPath(const std::string fullPath);
// Deletes a given filename, return true on success
// Doesn't supports deleting a directory
bool Delete(const char *filename);
bool Delete(const std::string filename);
// Deletes a directory filename, returns true on success
bool DeleteDir(const char *filename);
bool DeleteDir(const std::string filename);
// renames file srcFilename to destFilename, returns true on success
bool Rename(const char *srcFilename, const char *destFilename);
bool Rename(const std::string srcFilename, const std::string destFilename);
// copies file srcFilename to destFilename, returns true on success
bool Copy(const char *srcFilename, const char *destFilename);
bool Copy(const std::string srcFilename, const std::string destFilename);
// creates an empty file filename, returns true on success
bool CreateEmptyFile(const char *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 char *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 char *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 char *source_path, const char *dest_path);
void CopyDir(const std::string source_path, const std::string dest_path);
// Set the current directory to given directory
bool SetCurrentDir(const char *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).
std::string &GetUserPath(int DirIDX);
std::string &GetUserPath(const unsigned int DirIDX);
// Returns the path to where the sys file are
std::string GetSysDirectory();