MCPcopy Create free account
hub / github.com/Kitware/VTK / ReadNextLine

Method ReadNextLine

IO/EnSight/core/EnSightFile.cxx:497–535  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

495
496//------------------------------------------------------------------------------
497std::pair<bool, std::string> EnSightFile::ReadNextLine(int size /* = MAX_LINE_LENGTH*/)
498{
499 if (this->Format != FileType::ASCII)
500 {
501 return this->ReadLine(size);
502 }
503
504 bool isComment = true;
505 bool lineRead = true;
506
507 std::pair<bool, std::string> result;
508 while (isComment && lineRead)
509 {
510 result = this->ReadLine(size);
511 lineRead = result.first;
512 auto& line = result.second;
513 if (lineRead && line[0] != '#')
514 {
515 if (!std::all_of(line.begin(), line.end(), isspace))
516 {
517 // The line was not empty, not beginning by '#' and not composed
518 // of only white space, this is not a comment
519 isComment = false;
520 }
521 }
522 }
523
524 if (lineRead)
525 { // remove any trailing comments from the line
526 char comment = '#';
527 size_t found = result.second.find(comment);
528 if (found != std::string::npos)
529 {
530 result.second.erase(found);
531 }
532 }
533
534 return result;
535}
536
537//------------------------------------------------------------------------------
538void EnSightFile::SkipLine(vtkTypeInt64 size)

Callers 15

SetTimeStepToReadMethod · 0.95
SkipNLinesMethod · 0.95
ReadNumberMethod · 0.95
CheckVersionFunction · 0.80
ParseSOSFileFunction · 0.80
readCaseFileValuesFunction · 0.80
readFileValuesFunction · 0.80
CheckVersionMethod · 0.80
ParseCaseFileMethod · 0.80

Calls 5

ReadLineMethod · 0.95
beginMethod · 0.45
endMethod · 0.45
findMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected