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

Method SanitizeFileName

IO/EnSight/vtkGenericEnSightReader.cxx:301–318  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

299
300//------------------------------------------------------------------------------
301void vtkGenericEnSightReader::SanitizeFileName(std::string& filename)
302{
303 char quotes = '\"';
304 size_t found = filename.find(quotes);
305 if (found != std::string::npos)
306 {
307 filename.erase(std::remove(filename.begin(), filename.end(), quotes), filename.end());
308 }
309
310 // the strings we're using this on probably only have trailing spaces, but we'll
311 // include others just in case
312 std::string whitespaces(" \t\n\r");
313 found = filename.find_last_not_of(whitespaces);
314 if (found != std::string::npos)
315 {
316 filename.erase(found + 1);
317 }
318}
319
320//------------------------------------------------------------------------------
321int vtkGenericEnSightReader::DetermineEnSightVersion(int quiet)

Callers 7

InitializeFileMethod · 0.45
OpenVariableFileMethod · 0.45

Calls 5

removeFunction · 0.50
findMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected