Adds CPP implementatinon
This commit is contained in:
1 parent
f6e691d3db
commit
c72e925ac2
11 files changed
+461
-32
No files matched your search
@@ -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_
|
||||
Reference in new issue
Block a user