14 boost::optional<std::vector<Header1Type>>
const& header1 = boost::none,
15 boost::optional<std::vector<Header2Type>>
const& header2 = boost::none) {
16 std::ofstream filestream;
20 for (
auto columnIt = header1->begin(); columnIt != header1->end(); ++columnIt) {
21 if (columnIt != header1->begin()) {
24 filestream << *columnIt;
30 for (
auto columnIt = header2->begin(); columnIt != header2->end(); ++columnIt) {
31 if (columnIt != header2->begin()) {
34 filestream << *columnIt;
39 for (
auto const& row : data) {
40 for (
auto columnIt = row.begin(); columnIt != row.end(); ++columnIt) {
41 if (columnIt != row.begin()) {
44 filestream << *columnIt;
void exportDataToCSVFile(std::string filepath, std::vector< std::vector< DataType > > const &data, boost::optional< std::vector< Header1Type > > const &header1=boost::none, boost::optional< std::vector< Header2Type > > const &header2=boost::none)
void outputFixedWidth(std::ostream &stream, Container const &output, size_t maxWidth=30)
Output list of strings with linebreaks according to fixed width.
void openFile(std::string const &filepath, std::ofstream &filestream, bool append=false, bool silent=false)
Open the given file for writing.