Dir/File.exe to Dir */
| 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 */ |