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

Function CheckVersion

IO/EnSight/vtkEnSightSOSGoldReader.cxx:197–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195 vtkNew<vtkDataArraySelection> FieldArraySelection;
196
197 int CheckVersion(const char* filename)
198 {
199 if (!this->SOSFile.SetFileNamePattern(filename, true))
200 {
201 vtkGenericWarningMacro("EnSight SOS file " << filename << " could not be opened");
202 return false;
203 }
204
205 auto result = this->SOSFile.ReadNextLine();
206 bool formatFound = false;
207 do
208 {
209 if (result.second.find("FORMAT") != std::string::npos)
210 {
211 formatFound = true;
212 }
213 else if (formatFound && result.second.find("type") != std::string::npos)
214 {
215 if (result.second.find("master_server") != std::string::npos ||
216 result.second.find("gold") != std::string::npos)
217 {
218 return true;
219 }
220 }
221 result = this->SOSFile.ReadNextLine();
222 } while (result.first);
223 return false;
224 }
225
226 bool ParseSOSFile(const char* filename)
227 {

Callers

nothing calls this directly

Calls 3

SetFileNamePatternMethod · 0.80
ReadNextLineMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected