mirror of
https://github.com/red0124/ssp.git
synced 2025-01-23 04:55:20 +01:00
WIP, Continue writing additional parser tests
This commit is contained in:
parent
560bf815dc
commit
f28f000035
@ -1344,14 +1344,21 @@ std::vector<std::string> generate_csv_data(const std::vector<field>& data,
|
||||
void write_to_file(const std::vector<std::string>& data,
|
||||
const std::string& delim, const std::string& file_name) {
|
||||
std::ofstream out{file_name, std::ios_base::app};
|
||||
std::string line;
|
||||
for (size_t i = 0; i < data.size(); ++i) {
|
||||
out << data[i];
|
||||
line += data[i];
|
||||
if (i != data.size() - 1) {
|
||||
out << delim;
|
||||
line += delim;
|
||||
}
|
||||
}
|
||||
out << std::endl;
|
||||
out.close();
|
||||
|
||||
#ifdef _WIN32
|
||||
line += "\n";
|
||||
#else
|
||||
line += "\r\n";
|
||||
#endif
|
||||
|
||||
out << line;
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
|
Loading…
Reference in New Issue
Block a user