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

Method ParseFileSection

IO/EnSight/core/EnSightDataSet.cxx:916–961  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

914
915//------------------------------------------------------------------------------
916void EnSightDataSet::ParseFileSection()
917{
918 bool moreFileSets = true;
919 auto result = this->CaseFile.ReadNextLine(MAX_CASE_LINE_LENGTH);
920 while (moreFileSets && result.first)
921 {
922 std::shared_ptr<FileSetInfo> fsInfo(new FileSetInfo);
923 int fileSet = -1, numSteps = -1, fileIndex = -1;
924 moreFileSets = false;
925
926 while (result.first)
927 {
928 std::string& line = result.second;
929 if (this->IsSectionHeader(line))
930 {
931 this->CaseFile.GoBackOneLine();
932 break;
933 }
934
935 std::string lineType;
936 extractLinePart(GetLineTypeRegEx(), line, lineType);
937 if (lineType == "file set:")
938 {
939 extractLinePart(GetIntRegEx(), line, fileSet);
940 }
941 else if (lineType == "number of steps:")
942 {
943 extractLinePart(GetIntRegEx(), line, numSteps);
944 fsInfo->NumberOfSteps.push_back(numSteps);
945 }
946 else if (lineType == "filename index:")
947 {
948 extractLinePart(GetIntRegEx(), line, fileIndex);
949 fsInfo->FileNameIndex.push_back(fileIndex);
950 }
951
952 result = this->CaseFile.ReadNextLine(MAX_CASE_LINE_LENGTH);
953 if (result.second.find("file set") != std::string::npos)
954 {
955 moreFileSets = true;
956 break;
957 }
958 }
959 this->FileSetInfoMap.insert(std::make_pair(fileSet, fsInfo));
960 }
961}
962
963//------------------------------------------------------------------------------
964std::string EnSightDataSet::GetFullPath(const std::string& fname)

Callers 1

ParseCaseFileMethod · 0.95

Calls 7

IsSectionHeaderMethod · 0.95
extractLinePartFunction · 0.85
ReadNextLineMethod · 0.80
GoBackOneLineMethod · 0.80
push_backMethod · 0.45
findMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected