Closed mgaimann closed 1 year ago
The functions only affect the error message. The naming is bad but changing this could break people. I added a comment to the readme.
They were written for edge cases where there is some boilerplate before the actual header (like # style comments or so) and you do not want to count them. If you actually want to switch files, create a new reader.
Use case: I need to read the same CSV file multiple times. Problem: After I went through the CSV file the first time, I would like to go back to the beginning (line 0). When I use
set_file_line(0)
, the internal state ofLineReader
(given by the variabledata_begin
I think) does not change. Hence,read_row()
(and with thatnext_line()
) finds the conditiondata_begin == data_end
, meaning that a nullpointer is returned and not the correct data for the set line. Am I usingset_file_line
incorrectly or is it an implementation issue? Thank you for your help :)