WIP: Display if update is available on UniStore v2!

Use `updates.json` for it in `sd:/3ds/Universal-Updater/`.
This commit is contained in:
StackZ
2020-06-20 23:17:28 +02:00
parent 4004cb9e25
commit 34ade17556
8 changed files with 121 additions and 21 deletions
+7 -3
View File
@@ -41,6 +41,7 @@ struct UniStoreV2Struct {
std::string last_updated;
int icon_index;
int JSONIndex;
bool updateAvailable;
};
enum class SortType {
@@ -51,8 +52,9 @@ enum class SortType {
class Store {
public:
Store(nlohmann::json &JS);
Store(nlohmann::json &JS, std::string updateJSON = "NOT_FOUND");
void writeToFile(int index);
void sorting(bool Ascending, SortType sorttype);
std::string returnTitle(const int index);
@@ -61,13 +63,14 @@ public:
int returnJSONIndex(const int index);
int getSize();
bool getAscending() { return this->ascending; }
bool isUpdateAvailable(int index) { return this->sortedStore[index].updateAvailable; }
// Searching stuff.
int searchForEntries(const std::string searchResult);
int searchForAuthor(const std::string searchResult);
int searchForCategory(const std::string searchResult);
int searchForConsole(const std::string searchResult);
bool updateAvailable(int index);
void reset() { this->sortedStore = this->unsortedStore; }
const int getSortType() {
@@ -82,8 +85,9 @@ public:
private:
std::vector<UniStoreV2Struct> sortedStore, unsortedStore;
std::vector<std::string> availableCategories;
std::string updateFile;
bool ascending = false;
nlohmann::json storeJson;
nlohmann::json storeJson, updateJSON;
SortType sorttype = SortType::TITLE;
UniStoreV2Struct getData(const int index);