summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/FileUtil.cpp
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2009-01-15 06:48:15 +0000
committerShawn Hoffman <godisgovernment@gmail.com>2009-01-15 06:48:15 +0000
commitba8c2aa7e439a4a721739464097439ecb2f531f6 (patch)
tree156956d0ae06c4c1b9eb34d8548c9230e929eac8 /Source/Core/Common/Src/FileUtil.cpp
parentaced3c00fdb83dd2ce6b6ec213b4f4afc9b4fdfb (diff)
nakee's work on dolphin events. Also get wxw out of logmanager. This commit wants your comments
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1875 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/FileUtil.cpp')
-rw-r--r--Source/Core/Common/Src/FileUtil.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp
index 3dfdd373c6..923a35b249 100644
--- a/Source/Core/Common/Src/FileUtil.cpp
+++ b/Source/Core/Common/Src/FileUtil.cpp
@@ -237,7 +237,7 @@ bool Rename(const char *srcFilename, const char *destFilename)
bool Copy(const char *srcFilename, const char *destFilename)
{
-#ifdef _WIN32
+#ifdef _WIN32
return (CopyFile(srcFilename, destFilename, FALSE) == TRUE) ? true : false;
#else
@@ -259,7 +259,7 @@ bool Copy(const char *srcFilename, const char *destFilename)
return false;
}
- while(! feof(input)) {
+ while(! feof(input)) {
if((rnum = fread(buffer, sizeof(char), BSIZE, input)) != BSIZE) {
if(ferror(input) != 0){
PanicAlert("can't read source file\n");
@@ -293,7 +293,7 @@ bool Copy(const char *srcFilename, const char *destFilename)
std::string GetUserDirectory()
{
char path[MAX_PATH];
-#ifdef _WIN32
+#ifdef _WIN32
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, 0, path)))
{
//return std::string(path);
@@ -337,7 +337,7 @@ u64 GetSize(const char *filename)
}
int err = errno;
PanicAlert("Error accessing %s: %s", filename, strerror(err));
-#endif
+#endif
return 0;
}
@@ -408,7 +408,7 @@ u32 ScanDirectoryTree(const std::string& _Directory, FSTEntry& parentEntry)
// Find the first file in the directory.
DIR *dirp = opendir(_Directory.c_str());
-
+
while (!readdir_r(dirp, &dirent, &result) && result) {
FSTEntry entry;
if (result->d_name[0]=='.') continue;
@@ -428,7 +428,7 @@ u32 ScanDirectoryTree(const std::string& _Directory, FSTEntry& parentEntry)
parentEntry.children.push_back(entry);
}
closedir(dirp);
-
+
return foundEntries;
}
#endif
@@ -494,29 +494,29 @@ error_jmp:
return Result;
#else
// taken from http://www.dreamincode.net/code/snippet2700.htm
- DIR *pdir = NULL;
+ DIR *pdir = NULL;
pdir = opendir (_Directory.c_str());
struct dirent *pent = NULL;
- if (pdir == NULL) {
- return false;
- }
+ if (pdir == NULL) {
+ return false;
+ }
char file[256];
int counter = 1;
- while ((pent = readdir(pdir))) {
+ while ((pent = readdir(pdir))) {
if (counter > 2) {
for (int i = 0; i < 256; i++) file[i] = '\0';
strcat(file, _Directory.c_str());
- if (pent == NULL) {
- return false;
- }
- strcat(file, pent->d_name);
+ if (pent == NULL) {
+ return false;
+ }
+ strcat(file, pent->d_name);
if (IsDirectory(file) == true) {
DeleteDir(file);
- } else {
+ } else {
remove(file);
}
}