29 void write_csv_element<std::string>(std::ofstream& file,
const std::string& value);
void write_csv_element(std::ofstream &file, const T &value)
Writes a single element to the CSV file.
std::string separator
The separator to use between values.
CSVWriter & operator=(CSVWriter &)=delete
std::variant< size_t, int, double, std::string > serializable_types
The types that can be written to the CSV file.
void initialize(const std::vector< std::string > &headers)
Initializes the CSV file and writes the header row.
bool append
Whether to append to the CSV file or overwrite it.
void writeRow(const std::vector< serializable_types > &row)
Writes a row to the CSV file.
std::vector< std::string > headers
The headers of the CSV file.
std::ofstream file
The file stream to write to.
CSVWriter(const CSVWriter &)=delete
CSVWriter(std::filesystem::path file_path, const std::vector< std::string > &headers, bool append, std::string separator=";")
Creates a new CSVWriter instance.
std::filesystem::path file_path
The path to the CSV file to write to.