#ifndef JSONOUTPUT_HPP_ #define JSONOUTPUT_HPP_ #include class JsonOutput { public: explicit JsonOutput(char const* file_path); ~JsonOutput() = default; template void add(char const* key, T const& obj) { jsonData_[key] = obj; } bool write(); private: char const* filePath_; ::nlohmann::json jsonData_; }; #endif // JSONOUTPUT_HPP_