MCPcopy Create free account
hub / github.com/PDAL/PDAL / fillFields

Method fillFields

io/TextReader.cpp:300–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298
299
300bool TextReader::fillFields()
301{
302 while (true)
303 {
304 if (!m_istream->good())
305 return false;
306
307 std::string buf;
308
309 std::getline(*m_istream, buf);
310 m_line++;
311 if (buf.empty())
312 continue;
313 if (m_separator != ' ')
314 {
315 Utils::remove(buf, ' ');
316 m_fields = Utils::split(buf, m_separator);
317 }
318 else
319 m_fields = Utils::split2(buf, m_separator);
320 if (m_fields.size() != m_dims.size())
321 {
322 log()->get(LogLevel::Error) << "Line " << m_line <<
323 " in '" << m_filename << "' contains " << m_fields.size() <<
324 " fields when " << m_dims.size() << " were expected. "
325 "Ignoring." << std::endl;
326 continue;
327 }
328 return true;
329 }
330}
331
332
333void TextReader::done(PointTableRef table)

Callers

nothing calls this directly

Calls 6

removeFunction · 0.85
splitFunction · 0.85
logFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected