CSV grammar : skip leading \n and/or \r which result from std::getline used with non-native line endings

The goal is to support LF, CR and CRLF on all platforms.
This commit is contained in:
artemp 2015-09-14 11:46:11 +02:00
parent ad80c91657
commit d9ab7fd25f

View file

@ -64,7 +64,7 @@ struct csv_line_grammar : qi::grammar<Iterator, csv_line(std::string const&), qi
line = column(_r1) % char_(_r1)
;
column = quoted | *(char_ - (lit(_r1) /*| eol*/))
column = -omit[char_("\n\r")] >> quoted | *(char_ - (lit(_r1) /*| eol*/))
;
quoted = omit[char_("\"'")[_a = _1]] > text(_a) > -lit(_a)
;