MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / PatchStringHasUnlabelledPatch

Method PatchStringHasUnlabelledPatch

pcsx2/Patch.cpp:408–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408bool 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
441void Patch::ExtractPatchInfo(std::vector<PatchInfo>* dst, const std::string& pnach_data, u32* num_unlabelled_patches)
442{

Callers

nothing calls this directly

Calls 5

ParseAssignmentStringFunction · 0.85
emptyMethod · 0.45
lengthMethod · 0.45
frontMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected