Refactor Report class into ReportBase & ReportCons

This commit is contained in:
2023-08-21 17:16:29 +02:00
parent 0f66ac73d0
commit 8066701c3c
11 changed files with 122 additions and 73 deletions

25
src/Platform/ReportBase.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef REPORTBASE_H
#define REPORTBASE_H
#include <string>
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
namespace platform {
using namespace std;
class ReportBase {
public:
explicit ReportBase(json data_) { data = data_; };
virtual ~ReportBase() = default;
void show();
protected:
json data;
double totalScore; // Total score of all results in a report
string fromVector(const string& key);
string fVector(const string& title, const json& data, const int width, const int precision);
virtual void header() = 0;
virtual void body() = 0;
virtual void footer() = 0;
};
};
#endif