diff options
Diffstat (limited to 'src/common/file_util.cpp')
| -rw-r--r-- | src/common/file_util.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index b8dd92b65..89004c3c0 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp | |||
| @@ -736,6 +736,18 @@ const std::string& GetUserPath(UserPath path, const std::string& new_path) { | |||
| 736 | return paths[path]; | 736 | return paths[path]; |
| 737 | } | 737 | } |
| 738 | 738 | ||
| 739 | std::string GetHactoolConfigurationPath() { | ||
| 740 | #ifdef _WIN32 | ||
| 741 | char path[MAX_PATH]; | ||
| 742 | if (SHGetFolderPathA(NULL, CSIDL_PROFILE, NULL, 0, path) != S_OK) | ||
| 743 | return ""; | ||
| 744 | std::string local_path = Common::StringFromFixedZeroTerminatedBuffer(path, MAX_PATH); | ||
| 745 | return local_path + "\\.switch"; | ||
| 746 | #else | ||
| 747 | return GetHomeDirectory() + "/.switch"; | ||
| 748 | #endif | ||
| 749 | } | ||
| 750 | |||
| 739 | size_t WriteStringToFile(bool text_file, const std::string& str, const char* filename) { | 751 | size_t WriteStringToFile(bool text_file, const std::string& str, const char* filename) { |
| 740 | return FileUtil::IOFile(filename, text_file ? "w" : "wb").WriteBytes(str.data(), str.size()); | 752 | return FileUtil::IOFile(filename, text_file ? "w" : "wb").WriteBytes(str.data(), str.size()); |
| 741 | } | 753 | } |