فهرست منبع

file_util: Add getter for NAND registration directory

Zach Hilman 8 سال پیش
والد
کامیت
b70a831608
2فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 6 0
      src/common/file_util.cpp
  2. 2 0
      src/common/file_util.h

+ 6 - 0
src/common/file_util.cpp

@@ -750,6 +750,12 @@ std::string GetHactoolConfigurationPath() {
 #endif
 #endif
 }
 }
 
 
+std::string GetNANDRegistrationDir(bool system) {
+    if (system)
+        return GetUserPath(UserPath::NANDDir) + "system/Contents/registered/";
+    return GetUserPath(UserPath::NANDDir) + "user/Contents/registered/";
+}
+
 size_t WriteStringToFile(bool text_file, const std::string& str, const char* filename) {
 size_t WriteStringToFile(bool text_file, const std::string& str, const char* filename) {
     return FileUtil::IOFile(filename, text_file ? "w" : "wb").WriteBytes(str.data(), str.size());
     return FileUtil::IOFile(filename, text_file ? "w" : "wb").WriteBytes(str.data(), str.size());
 }
 }

+ 2 - 0
src/common/file_util.h

@@ -129,6 +129,8 @@ const std::string& GetUserPath(UserPath path, const std::string& new_path = "");
 
 
 std::string GetHactoolConfigurationPath();
 std::string GetHactoolConfigurationPath();
 
 
+std::string GetNANDRegistrationDir(bool system = false);
+
 // Returns the path to where the sys file are
 // Returns the path to where the sys file are
 std::string GetSysDirectory();
 std::string GetSysDirectory();