MCPcopy Create free account
hub / github.com/Adaptix-Framework/AdaptixC2 / GetParentPathUnix

Function GetParentPathUnix

AdaptixClient/Source/Utils/FileSystem.cpp:92–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92QString GetParentPathUnix(const QString& path)
93{
94 if (path == "/")
95 return path;
96
97 QString parentPath = path;
98 if (!parentPath.endsWith('/'))
99 parentPath += '/';
100
101 if (parentPath.count('/') == 2)
102 return "/";
103
104 int lastBackslashIndex = parentPath.lastIndexOf('/');
105 int secondLastBackslashIndex = parentPath.lastIndexOf('/', lastBackslashIndex - 1);
106
107 if (secondLastBackslashIndex != -1)
108 return parentPath.left(secondLastBackslashIndex);
109
110 return path;
111}
112
113QIcon GetFileSystemIcon(int type, bool used)
114{

Callers 3

getFileDataMethod · 0.85
onParentMethod · 0.85
script_dirMethod · 0.85

Calls 4

endsWithMethod · 0.80
lastIndexOfMethod · 0.80
countMethod · 0.45
leftMethod · 0.45

Tested by

no test coverage detected