Fix CsvStream not reading values properly

This commit is contained in:
Jan 2021-03-23 01:28:54 +01:00
parent 0ff06cad72
commit 3529214596

View File

@ -25,9 +25,20 @@ bool CsvInputStream::NextRow(std::vector<std::string>& out) const
col.clear(); col.clear();
col.str(std::string()); col.str(std::string());
} }
else if(c == '\r')
{
c = m_stream.get();
if (c == '\n')
break;
col << '\r';
}
else if(c == '\n')
{
break;
}
else else
{ {
col << c; col << static_cast<char>(c);
} }
c = m_stream.get(); c = m_stream.get();
@ -35,9 +46,6 @@ bool CsvInputStream::NextRow(std::vector<std::string>& out) const
if(!isEof) if(!isEof)
{ {
const auto lastEntry = col.str();
if(!lastEntry.empty())
out.emplace_back(col.str()); out.emplace_back(col.str());
} }