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

Method GetBasePath

IO/HDF/vtkHDFWriterImplementation.cxx:1221–1243  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1219
1220//------------------------------------------------------------------------------
1221std::string vtkHDFWriter::Implementation::GetBasePath(const std::string& fullPath)
1222{
1223 auto removePrefix = [](std::string& path, const std::string& suffix)
1224 {
1225 if (path.find(suffix) != std::string::npos)
1226 {
1227 path = path.substr(0, path.find(suffix) - 1);
1228 }
1229 };
1230
1231 std::string basePath = fullPath;
1232 for (const std::string& suffix : PATH::PRIMITIVE_TYPES)
1233 {
1234 removePrefix(basePath, suffix);
1235 }
1236
1237 for (const std::string& suffix :
1238 { PATH::STEPS, PATH::CELL_DATA, PATH::POINT_DATA, PATH::FIELD_DATA })
1239 {
1240 removePrefix(basePath, suffix);
1241 }
1242 return basePath;
1243}
1244
1245//------------------------------------------------------------------------------
1246char vtkHDFWriter::Implementation::GetPrimitive(hid_t group)

Callers 3

CreateVirtualDatasetMethod · 0.95
WriteSumStepsMethod · 0.95
GetSubfileNumberOfMethod · 0.95

Calls 1

findMethod · 0.45

Tested by

no test coverage detected