| 289 | } |
| 290 | |
| 291 | std::string_view Achievements::GetELFNameForHash(const std::string& elf_path) |
| 292 | { |
| 293 | std::string::size_type start = elf_path.rfind('\\'); |
| 294 | if (start == std::string::npos) |
| 295 | start = 0; |
| 296 | else |
| 297 | start++; // skip backslash |
| 298 | |
| 299 | std::string::size_type end = elf_path.rfind(';'); |
| 300 | if (end == std::string::npos) |
| 301 | end = elf_path.size(); |
| 302 | |
| 303 | if (end < start) |
| 304 | end = start; |
| 305 | |
| 306 | return std::string_view(elf_path).substr(start, end - start); |
| 307 | } |
| 308 | |
| 309 | std::string Achievements::GetGameHash(const std::string& elf_path) |
| 310 | { |