summaryrefslogtreecommitdiff
path: root/Source/Core/Common/FileUtil.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2019-05-29 15:32:18 +0200
committerGitHub <noreply@github.com>2019-05-29 15:32:18 +0200
commit80d8173d29749b13ccdf84e75641e179ea34768b (patch)
tree571de5aa6317916db6d68bb770c5457ba875b219 /Source/Core/Common/FileUtil.cpp
parent3c012ca31e9289212b2c34c3f57da8f0f60f3d1a (diff)
parent734667998647e21b8ffec9a6ec4e32253af1a9d5 (diff)
Merge pull request #8132 from lioncash/string
Common/FileUtil: Use std::string_view with WriteStringToFile
Diffstat (limited to 'Source/Core/Common/FileUtil.cpp')
-rw-r--r--Source/Core/Common/FileUtil.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp
index 7030c9dc25..75118bffac 100644
--- a/Source/Core/Common/FileUtil.cpp
+++ b/Source/Core/Common/FileUtil.cpp
@@ -887,7 +887,7 @@ std::string GetThemeDir(const std::string& theme_name)
return GetSysDirectory() + THEMES_DIR "/" DEFAULT_THEME_DIR "/";
}
-bool WriteStringToFile(const std::string& str, const std::string& filename)
+bool WriteStringToFile(const std::string& filename, std::string_view str)
{
return File::IOFile(filename, "wb").WriteBytes(str.data(), str.size());
}
@@ -900,7 +900,7 @@ bool ReadFileToString(const std::string& filename, std::string& str)
return false;
str.resize(file.GetSize());
- return file.ReadArray(&str[0], str.size());
+ return file.ReadArray(str.data(), str.size());
}
} // namespace File