Archived
1
0
This repository has been archived on 2023-08-12. You can view files and clone it, but cannot push or open issues or pull requests.
nntpchan/contrib/backends/nntpchan-daemon/libnntpchan/line.cpp
Jeff Becker 4244345eff
more
2018-05-06 09:53:03 -04:00

25 lines
434 B
C++

#include <nntpchan/line.hpp>
namespace nntpchan
{
void LineReader::Data(const char *data, ssize_t l)
{
if (l <= 0)
return;
m_line << m_leftover;
m_leftover = "";
m_line << std::string(data, l);
for (std::string line; std::getline(m_line, line);)
{
line.erase(std::remove(line.begin(), line.end(), '\r'), line.end());
HandleLine(line);
}
if (m_line)
m_leftover = m_line.str();
m_line.clear();
}
}