2022-03-12 00:31:20 +01:00
|
|
|
#include "write-csv.hh"
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
#include <iostream>
|
|
|
|
#include <iterator>
|
|
|
|
|
|
|
|
namespace kraken::csv {
|
|
|
|
|
|
|
|
void write_csv(std::ostream& output, csv_type const& csv) {
|
|
|
|
for (const auto& line : csv) {
|
2022-03-12 00:45:27 +01:00
|
|
|
bool first = true;
|
|
|
|
for (const auto& atom : line) {
|
|
|
|
output << (first ? "" : ",") << atom;
|
|
|
|
first = false;
|
|
|
|
};
|
|
|
|
output << '\n';
|
2022-03-12 00:31:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace kraken::csv
|