MCPcopy Create free account
hub / github.com/ChiyukiGana/Quickinput / RemoveFile

Method RemoveFile

source/src/tools/path.h:227–242  ·  view source on GitHub ↗

Dir/File.exe to Dir */

Source from the content-addressed store, hash-verified

225 }
226 /* Dir/File.exe to Dir */
227 static std::wstring RemoveFile(std::wstring path, bool mark = false)
228 {
229 path = RemoveMark(path, false);
230 if (!path.size()) return path;
231
232 size_t s = path.find_last_of(L'/');
233 size_t bs = path.find_last_of(L'\\');
234 if (s != std::wstring::npos)
235 path = path.substr(0, s);
236 else if (bs != std::wstring::npos)
237 path = path.substr(0, bs);
238 else path = {};
239
240 if (mark) return AppendMark(path, L"\"");
241 return path;
242 }
243
244
245 /* Dir/File.exe to .exe */

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected