MCPcopy Create free account
hub / github.com/computationalpathologygroup/ASAP / extractFilePath

Function extractFilePath

core/filetools.cpp:280–299  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

278
279//---------------------------------------------------------------------------
280 std::string extractFilePath(const std::string &name)
281 {
282 std::string s(name);
283 if (isOnlyDirectory(s))
284 {
285 fs::path p(s);
286 if (isRoot(name))
287 return p.string();
288 else
289 return stripTrailingSlash(std::string(p.string()));
290 }
291 else
292 {
293 cleanFileName(s);
294 fs::path p(s);
295 if (isRoot(name)) // CM: needed for "\\\\machine\\" see testFileTools.cpp
296 return p.string();
297 return std::string(p.parent_path().string());
298 }
299 }
300
301//---------------------------------------------------------------------------
302 std::string extractFileName(const std::string &name)

Callers 10

copyFileFunction · 0.85
renameFileFunction · 0.85
changeExtensionFunction · 0.85
changeBaseNameFunction · 0.85
writeFileFunction · 0.85
initializeTypeMethod · 0.85
initializeTypeMethod · 0.85
mainFunction · 0.85
onNewImageLoadedMethod · 0.85

Calls 4

isOnlyDirectoryFunction · 0.85
isRootFunction · 0.85
stripTrailingSlashFunction · 0.85
cleanFileNameFunction · 0.85

Tested by

no test coverage detected