summaryrefslogtreecommitdiff
path: root/src/common/file_util.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2018-08-04 14:33:11 -0400
committerGravatar GitHub2018-08-04 14:33:11 -0400
commit2b06301dbfbfe79687219bf7783a6d1b47695401 (patch)
tree222cc27ecbc7f7e86d2edef8d36436600dee7d7a /src/common/file_util.cpp
parentMerge pull request #919 from lioncash/sign (diff)
parentAdd missing parameter to files.push_back() (diff)
downloadyuzu-2b06301dbfbfe79687219bf7783a6d1b47695401.tar.gz
yuzu-2b06301dbfbfe79687219bf7783a6d1b47695401.tar.xz
yuzu-2b06301dbfbfe79687219bf7783a6d1b47695401.zip
Merge pull request #849 from DarkLordZach/xci
XCI and Encrypted NCA Support
Diffstat (limited to 'src/common/file_util.cpp')
-rw-r--r--src/common/file_util.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index b8dd92b65..7aeda737f 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -706,6 +706,7 @@ const std::string& GetUserPath(UserPath path, const std::string& new_path) {
706 paths.emplace(UserPath::SDMCDir, user_path + SDMC_DIR DIR_SEP); 706 paths.emplace(UserPath::SDMCDir, user_path + SDMC_DIR DIR_SEP);
707 paths.emplace(UserPath::NANDDir, user_path + NAND_DIR DIR_SEP); 707 paths.emplace(UserPath::NANDDir, user_path + NAND_DIR DIR_SEP);
708 paths.emplace(UserPath::SysDataDir, user_path + SYSDATA_DIR DIR_SEP); 708 paths.emplace(UserPath::SysDataDir, user_path + SYSDATA_DIR DIR_SEP);
709 paths.emplace(UserPath::KeysDir, user_path + KEYS_DIR DIR_SEP);
709 // TODO: Put the logs in a better location for each OS 710 // TODO: Put the logs in a better location for each OS
710 paths.emplace(UserPath::LogDir, user_path + LOG_DIR DIR_SEP); 711 paths.emplace(UserPath::LogDir, user_path + LOG_DIR DIR_SEP);
711 } 712 }
@@ -736,6 +737,19 @@ const std::string& GetUserPath(UserPath path, const std::string& new_path) {
736 return paths[path]; 737 return paths[path];
737} 738}
738 739
740std::string GetHactoolConfigurationPath() {
741#ifdef _WIN32
742 PWSTR pw_local_path = nullptr;
743 if (SHGetKnownFolderPath(FOLDERID_Profile, 0, nullptr, &pw_local_path) != S_OK)
744 return "";
745 std::string local_path = Common::UTF16ToUTF8(pw_local_path);
746 CoTaskMemFree(pw_local_path);
747 return local_path + "\\.switch";
748#else
749 return GetHomeDirectory() + "/.switch";
750#endif
751}
752
739size_t WriteStringToFile(bool text_file, const std::string& str, const char* filename) { 753size_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()); 754 return FileUtil::IOFile(filename, text_file ? "w" : "wb").WriteBytes(str.data(), str.size());
741} 755}