summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2009-04-12 13:12:42 +0000
committerhrydgard <hrydgard@gmail.com>2009-04-12 13:12:42 +0000
commitf6474b98a85877aae2b7c0c8485e280bbf68053a (patch)
treeb5df7c6318644b9a3518ce0a48212c35ca774460 /Source/Core/Common
parente8b9e93465ec9e78de823c1480439f9efb2a8012 (diff)
DSP assembler: Error message improvements.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2956 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/Src/FileUtil.cpp8
-rw-r--r--Source/Core/Common/Src/FileUtil.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp
index 05030deb59..8a16ae01dd 100644
--- a/Source/Core/Common/Src/FileUtil.cpp
+++ b/Source/Core/Common/Src/FileUtil.cpp
@@ -601,13 +601,13 @@ const char *GetUserDirectory()
return path;
}
-bool WriteStringToFile(bool text_file, const char *str, const char *filename)
+bool WriteStringToFile(bool text_file, const std::string &str, const char *filename)
{
FILE *f = fopen(filename, text_file ? "w" : "wb");
if (!f)
return false;
- size_t len = strlen(str);
- if (len != fwrite(str, 1, strlen(str), f))
+ size_t len = str.size();
+ if (len != fwrite(str.data(), 1, str.size(), f))
{
fclose(f);
return false;
@@ -616,7 +616,7 @@ bool WriteStringToFile(bool text_file, const char *str, const char *filename)
return true;
}
-bool ReadStringFromFile(bool text_file, const char *filename, std::string *str)
+bool ReadFileToString(bool text_file, const char *filename, std::string *str)
{
FILE *f = fopen(filename, text_file ? "r" : "rb");
if (!f)
diff --git a/Source/Core/Common/Src/FileUtil.h b/Source/Core/Common/Src/FileUtil.h
index 7c6f5a911d..66ca698840 100644
--- a/Source/Core/Common/Src/FileUtil.h
+++ b/Source/Core/Common/Src/FileUtil.h
@@ -99,8 +99,8 @@ char *GetConfigDirectory();
std::string GetBundleDirectory();
#endif
-bool WriteStringToFile(bool text_file, const char *str, const char *filename);
-bool ReadStringFromFile(bool text_file, const char *filename, std::string *str);
+bool WriteStringToFile(bool text_file, const std::string &str, const char *filename);
+bool ReadFileToString(bool text_file, const char *filename, std::string *str);
} // namespace