MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / getGenericPath

Function getGenericPath

src/server/gui/core/utils/FileSystemUtil.cpp:287–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285//////////////////////////////////////////////////////////////////////////
286
287 std::string getGenericPath(const std::string& _path)
288 {
289 std::string path = _path;
290 size_t offset = std::string::npos;
291
292 // remove "\\\\?\\"
293 if((path.find("\\\\?\\")) == 0)
294 path.erase(0, 4);
295
296 // convert '\\' to '/'
297 while((offset = path.find('\\')) != std::string::npos)
298 path.replace(offset, 1 ,"/");
299
300 // remove double '/'
301 while((offset = path.find("//")) != std::string::npos)
302 path.erase(offset, 1);
303
304 // remove trailing '/' when the path is more than a simple '/'
305 while(path.length() > 1 && ((offset = path.find_last_of('/')) == (path.length() - 1)))
306 path.erase(offset, 1);
307
308 // return generic path
309 return path;
310
311 } // getGenericPath
312
313//////////////////////////////////////////////////////////////////////////
314

Callers 15

getDirContentFunction · 0.85
getPathListFunction · 0.85
setHomePathFunction · 0.85
getHomePathFunction · 0.85
getCWDPathFunction · 0.85
getEscapedPathFunction · 0.85
getCanonicalPathFunction · 0.85
getAbsolutePathFunction · 0.85
getParentFunction · 0.85
getFileNameFunction · 0.85
resolveRelativePathFunction · 0.85
removeCommonPathFunction · 0.85

Calls 2

lengthMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected