| 406 | } |
| 407 | |
| 408 | bool Patch::PatchStringHasUnlabelledPatch(const std::string& pnach_data) |
| 409 | { |
| 410 | std::istringstream ss(pnach_data); |
| 411 | std::string line; |
| 412 | bool foundPatch = false, foundLabel = false; |
| 413 | |
| 414 | while (std::getline(ss, line)) |
| 415 | { |
| 416 | TrimPatchLine(line); |
| 417 | if (line.empty()) |
| 418 | continue; |
| 419 | |
| 420 | if (line.length() > 2 && line.front() == '[' && line.back() == ']') |
| 421 | { |
| 422 | if (!foundPatch) |
| 423 | return false; |
| 424 | foundLabel = true; |
| 425 | continue; |
| 426 | } |
| 427 | |
| 428 | std::string_view key, value; |
| 429 | StringUtil::ParseAssignmentString(line, &key, &value); |
| 430 | if (key == "patch") |
| 431 | { |
| 432 | if (!foundLabel) |
| 433 | return true; |
| 434 | |
| 435 | foundPatch = true; |
| 436 | } |
| 437 | } |
| 438 | return false; |
| 439 | } |
| 440 | |
| 441 | void Patch::ExtractPatchInfo(std::vector<PatchInfo>* dst, const std::string& pnach_data, u32* num_unlabelled_patches) |
| 442 | { |
nothing calls this directly
no test coverage detected