Add sorting capacity

This commit is contained in:
2023-08-13 17:10:18 +02:00
parent 2729b92f06
commit 054567c65a
3 changed files with 150 additions and 6 deletions

View File

@@ -13,6 +13,12 @@ namespace platform {
Result(const string& path, const string& filename);
json load();
string to_string() const;
string getFilename() const { return filename; };
string getDate() const { return date; };
double getScore() const { return score; };
string getTitle() const { return title; };
double getDuration() const { return duration; };
string getModel() const { return model; };
private:
string path;
string filename;
@@ -24,14 +30,21 @@ namespace platform {
};
class Results {
public:
explicit Results(const string& path) : path(path) { load(); };
explicit Results(const string& path, const int max) : path(path), max(max) { load(); };
void manage();
private:
string path;
int max;
vector<Result> files;
void load(); // Loads the list of results
void show();
int menu();
void show() const;
int getIndex(const string& intent) const;
void menu();
void sortList();
void sortDate();
void sortScore();
void sortModel();
void sortDuration();
};
};