| 1379 | } |
| 1380 | |
| 1381 | void _RPLLoader_ExtractModuleNameFromPath(char* output, std::string_view input) |
| 1382 | { |
| 1383 | // scan to last '/' |
| 1384 | cemu_assert(!input.empty()); |
| 1385 | size_t startIndex = input.size() - 1; |
| 1386 | while (startIndex > 0) |
| 1387 | { |
| 1388 | if (input[startIndex] == '/') |
| 1389 | { |
| 1390 | startIndex++; |
| 1391 | break; |
| 1392 | } |
| 1393 | startIndex--; |
| 1394 | } |
| 1395 | // cut off after '.' |
| 1396 | size_t endIndex = startIndex; |
| 1397 | while (endIndex < input.size()) |
| 1398 | { |
| 1399 | if (input[endIndex] == '.') |
| 1400 | break; |
| 1401 | endIndex++; |
| 1402 | } |
| 1403 | size_t nameLen = endIndex - startIndex; |
| 1404 | cemu_assert(nameLen != 0); |
| 1405 | nameLen = std::min<size_t>(nameLen, RPL_MODULE_NAME_LENGTH-1); |
| 1406 | memcpy(output, input.data() + startIndex, nameLen); |
| 1407 | output[nameLen] = '\0'; |
| 1408 | // convert to lower case |
| 1409 | std::for_each(output, output + nameLen, [](char& c) {c = _ansiToLower(c);}); |
| 1410 | } |
| 1411 | |
| 1412 | void RPLLoader_InitState() |
| 1413 | { |
no test coverage detected