esri_assignment/src/json_output.hpp

25 lines
391 B
C++
Raw Permalink Normal View History

2021-06-26 09:15:57 +02:00
#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_