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

Function upOneLevel

core/filetools.cpp:250–261  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

248
249//---------------------------------------------------------------------------
250 std::string upOneLevel(const std::string &name)
251 {
252 if (isRoot(name))
253 return name;
254
255 std::string s(name);
256 if (isOnlyDirectory(name))
257 s = stripTrailingSlash(s);
258
259 fs::path p(s);
260 return p.parent_path().string();
261 }
262
263 std::string upMultipleLevels(const std::string &name, unsigned int nrOfLevels)
264 {

Callers 2

Calls 3

isRootFunction · 0.85
isOnlyDirectoryFunction · 0.85
stripTrailingSlashFunction · 0.85

Tested by

no test coverage detected