Molecular Dynamics Simulation  1.0
Classes | Functions
CSVWriter.h File Reference
#include <array>
#include <filesystem>
#include <fstream>
#include <string>
#include <utility>
#include <variant>
#include <vector>
#include "io/logger/Logger.h"
Include dependency graph for CSVWriter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CSVWriter
 

Functions

template<typename T >
void write_csv_element (std::ofstream &file, const T &value)
 Writes a single element to the CSV file. More...
 
template<>
void write_csv_element< std::string > (std::ofstream &file, const std::string &value)
 Escapes a string value to be written to the CSV file. More...
 

Function Documentation

◆ write_csv_element()

template<typename T >
void write_csv_element ( std::ofstream &  file,
const T &  value 
)

Writes a single element to the CSV file.

Parameters
fileThe file stream to write to.
valueThe value to write.

Definition at line 8 of file CSVWriter.cpp.

8  {
9  file << value;
10 }

◆ write_csv_element< std::string >()

template<>
void write_csv_element< std::string > ( std::ofstream &  file,
const std::string &  value 
)

Escapes a string value to be written to the CSV file.

Parameters
fileThe file stream to write to.
valueThe value to write.

Definition at line 13 of file CSVWriter.cpp.

13  {
14  file << "\"" << value << "\"";
15 }