Adds CPP implementatinon

This commit is contained in:
nine committed 2021-06-28 00:07:24 +02:00
1 parent f6e691d3db
commit c72e925ac2
11 files changed
+461 -32

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
#ifndef JSONOUTPUT_HPP_
#define JSONOUTPUT_HPP_
#include <nlohmann/json.hpp>
class JsonOutput {
public:
explicit JsonOutput(char const* file_path);
~JsonOutput() = default;
template<typename T>
void add(char const* key, T const& obj)
{
jsonData_[key] = obj;
}
bool write();
private:
char const* filePath_;
::nlohmann::json jsonData_;
};
#endif // JSONOUTPUT_HPP_