mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Common/FileUtil: Use std::string_view with WriteStringToFile
Allows writing out other forms of strings (e.g. C strings) without the need to allocate a std::string and discard it after use.
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#include <cstddef>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include <sys/stat.h>
|
||||
@ -198,7 +199,7 @@ std::string GetBundleDirectory();
|
||||
std::string GetExePath();
|
||||
std::string GetExeDirectory();
|
||||
|
||||
bool WriteStringToFile(const std::string& filename, const std::string& str);
|
||||
bool WriteStringToFile(const std::string& filename, std::string_view str);
|
||||
bool ReadFileToString(const std::string& filename, std::string& str);
|
||||
|
||||
// To deal with Windows being dumb at unicode:
|
||||
|
Reference in New Issue
Block a user