Closed KOLANICH closed 2 years ago
Can you do your progress bar as follows?
int main(){
MyProgressBar progress_bar(number_of_lines);
io::CSVReader<3> in("ram.csv");
in.read_header(io::ignore_extra_column, "vendor", "size", "speed");
std::string vendor; int size; double speed;
while(in.read_row(vendor, size, speed)){
progress_bar.update_progress(in.get_file_line());
// do stuff with the data
}
}
This way the whole progress bar logic is completely decoupled from the CSV parsing.
Since we don't know the count of lines beforehand (in the case of non-indexed parsing), and since estimating by rows is incorrect, since rows are usually of different size, I took another approach:
bytes read / file size
.
I have implemented progressbar support (by just exposing the data from private fields) in my inlined version of your lib, but I'm not sure it matches to your vision of this lib.