You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 19, 2020. It is now read-only.
I'm trying to use the csv::Writer as a backend for my Persistent Manager class but for some reason I cannot get it to write the header. Basically, I have something like this:
class PM {
class Writer;
}
class Writer{
using namespace std;
string filename;
unique_ptr<csv::Writer> writer;
Writer(string filename) filename(filename) {
writer = make_unique<csv::Writer>(filename);
writer->configure_dialect().delimiter(cols);
}
~Write(){
writer->close();
}
void write(map<sting, string> row) {
// I override the method to accept vector<string> as well.
writer->configure_dialect().column_names(cols);
writer->write_row(row);
}
}
Do you see any particular issue with this? I'm not quite sure why honestly, everything looks fine.
The text was updated successfully, but these errors were encountered:
That indeed fixes the issue. Thanks. I wonder if you would like the idea of this override for the column_names. I use a simple method like below. You can probably adjust it to fit the code better.
I'm trying to use the
csv::Writer
as a backend for my Persistent Manager class but for some reason I cannot get it to write the header. Basically, I have something like this:Do you see any particular issue with this? I'm not quite sure why honestly, everything looks fine.
The text was updated successfully, but these errors were encountered: