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

Method PreParseDataFile

IO/Geometry/vtkFLUENTReader.cxx:597–678  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

595
596//------------------------------------------------------------------------------
597bool vtkFLUENTReader::PreParseDataFile()
598{
599 this->FluentDataFile->clear();
600 this->FluentDataFile->seekg(0, ios::beg);
601
602 while (true)
603 {
604 auto character = this->FluentDataFile->get();
605 if (this->FluentDataFile->eof())
606 {
607 return true;
608 }
609
610 // Search for new section
611 if (character == '(')
612 {
613 auto nextChar = this->FluentDataFile->peek();
614 if (nextChar < '1' || nextChar > '9')
615 {
616 // Drop line
617 this->FluentDataFile->ignore(std::numeric_limits<std::streamsize>::max(), '\n');
618 continue;
619 }
620
621 // New section found, keep position
622 std::streampos pos = this->FluentDataFile->tellg();
623
624 // Parse section index
625 std::string index;
626 while (true)
627 {
628 nextChar = this->FluentDataFile->get();
629 if (this->FluentDataFile->eof())
630 {
631 return true;
632 }
633 if (nextChar == ' ')
634 {
635 break;
636 }
637 if (nextChar == '(')
638 {
639 this->FluentDataFile->unget();
640 break;
641 }
642 index += static_cast<char>(nextChar);
643 }
644
645 unsigned int zoneId;
646 VTK_FROM_CHARS_IF_ERROR_RETURN(index, zoneId, false);
647 switch (zoneId)
648 {
649 case 300:
650 case 2300:
651 case 3300:
652 unsigned int zoneSectionId;
653 if (!this->ReadDataZoneSectionId(zoneSectionId))
654 {

Callers 1

RequestInformationMethod · 0.95

Calls 8

ReadDataZoneSectionIdMethod · 0.95
maxFunction · 0.50
clearMethod · 0.45
getMethod · 0.45
eofMethod · 0.45
peekMethod · 0.45
ungetMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected