mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
Universal-Updater -> DarkStore Part 2
Renamed Strings For DarkStore Made .store Files Useable
This commit is contained in:
@@ -89,13 +89,13 @@ void getDirectoryContents(std::vector<DirEntry> &dirContents) {
|
||||
}
|
||||
|
||||
/*
|
||||
Return UniStore info.
|
||||
Return Store info.
|
||||
|
||||
const std::string &file: Const Reference to the path of the file.
|
||||
const std::string &fieName: Const Reference to the filename, without path.
|
||||
*/
|
||||
UniStoreInfo GetInfo(const std::string &file, const std::string &fileName) {
|
||||
UniStoreInfo Temp = { "", "", "", "", fileName, "", -1, -1, -1 }; // Title, Author, URL, File (to check if no slash exist), FileName, Desc, Version, Revision, entries.
|
||||
StoreInfo GetInfo(const std::string &file, const std::string &fileName) {
|
||||
StoreInfo Temp = { "", "", "", "", fileName, "", -1, -1, -1 }; // Title, Author, URL, File (to check if no slash exist), FileName, Desc, Version, Revision, entries.
|
||||
|
||||
if (fileName.length() > 4) {
|
||||
if(*(u32*)(fileName.c_str() + fileName.length() - 4) == (1886349435 & ~(1 << 3))) return Temp;
|
||||
@@ -147,23 +147,25 @@ UniStoreInfo GetInfo(const std::string &file, const std::string &fileName) {
|
||||
}
|
||||
|
||||
/*
|
||||
Return UniStore info vector.
|
||||
Return Store info vector.
|
||||
|
||||
const std::string &path: Const Reference to the path, where to check.
|
||||
*/
|
||||
std::vector<UniStoreInfo> GetUniStoreInfo(const std::string &path) {
|
||||
std::vector<UniStoreInfo> info;
|
||||
std::vector<StoreInfo> GetStoreInfo(const std::string &path) {
|
||||
std::vector<StoreInfo> info;
|
||||
std::vector<DirEntry> dirContents;
|
||||
|
||||
if (access(path.c_str(), F_OK) != 0) return {}; // Folder does not exist.
|
||||
|
||||
chdir(path.c_str());
|
||||
getDirectoryContents(dirContents, { "unistore" });
|
||||
getDirectoryContents(dirContents, { "store", "unistore" });
|
||||
|
||||
for(uint i = 0; i < dirContents.size(); i++) {
|
||||
/* Make sure to ONLY push .unistores, and no folders. Avoids crashes in that case too. */
|
||||
/* Make sure to ONLY push .store & .unistore, and no folders. Avoids crashes in that case too. */
|
||||
if ((path + dirContents[i].name).find(".unistore") != std::string::npos) {
|
||||
info.push_back( GetInfo(path + dirContents[i].name, dirContents[i].name) );
|
||||
} else if ((path + dirContents[i].name).find(".store") != std::string::npos) {
|
||||
info.push_back( GetInfo(path + dirContents[i].name, dirContents[i].name) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user