Refactor ManageResults and CommandParser
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#ifndef RESULTS_H
|
||||
#define RESULTS_H
|
||||
#include "xlsxwriter.h"
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
@@ -12,35 +11,29 @@ namespace platform {
|
||||
|
||||
class Results {
|
||||
public:
|
||||
Results(const string& path, const int max, const string& model, const string& score, bool complete, bool partial, bool compare) :
|
||||
path(path), max(max), model(model), scoreName(score), complete(complete), partial(partial), compare(compare)
|
||||
{
|
||||
load();
|
||||
};
|
||||
void manage();
|
||||
private:
|
||||
string path;
|
||||
int max;
|
||||
string model;
|
||||
string scoreName;
|
||||
bool complete;
|
||||
bool partial;
|
||||
bool indexList = true;
|
||||
bool openExcel = false;
|
||||
bool compare;
|
||||
lxw_workbook* workbook = NULL;
|
||||
vector<Result> files;
|
||||
void load(); // Loads the list of results
|
||||
void show() const;
|
||||
void report(const int index, const bool excelReport);
|
||||
void showIndex(const int index, const int idx) const;
|
||||
int getIndex(const string& intent) const;
|
||||
void menu();
|
||||
void sortList();
|
||||
Results(const string& path, const string& model, const string& score, bool complete, bool partial, bool compare);
|
||||
void sortDate();
|
||||
void sortScore();
|
||||
void sortModel();
|
||||
void sortDuration();
|
||||
int maxModelSize() const { return maxModel; };
|
||||
void hideResult(int index, const string& path);
|
||||
void deleteResult(int index);
|
||||
int size() const;
|
||||
bool empty() const;
|
||||
vector<Result>::iterator begin() { return files.begin(); };
|
||||
vector<Result>::iterator end() { return files.end(); };
|
||||
Result& at(int index) { return files.at(index); };
|
||||
private:
|
||||
string path;
|
||||
string model;
|
||||
string scoreName;
|
||||
bool complete;
|
||||
bool partial;
|
||||
bool compare;
|
||||
int maxModel;
|
||||
vector<Result> files;
|
||||
void load(); // Loads the list of results
|
||||
};
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user