Create Base class for paged reports

This commit is contained in:
2024-03-17 01:22:50 +01:00
parent 106a36109e
commit fa4f47ff35
8 changed files with 78 additions and 53 deletions

View File

@@ -0,0 +1,26 @@
#pragma once
#include <locale>
#include <sstream>
#include <nlohmann/json.hpp>
namespace platform {
using json = nlohmann::json;
class ReportsPaged {
public:
ReportsPaged();
~ReportsPaged() = default;
std::string getOutput() const;
std::string getHeader() const;
std::vector<std::string>& getBody() { return body; }
int getNumLines() const { return body.size(); }
json& getData() { return data; }
protected:
std::vector<std::string> header, body;
json data;
std::stringstream oss;
std::locale loc;
};
}