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

Method DeleteFromIndex

pcsx2/SIO/Memcard/MemoryCardFolder.cpp:1891–1907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1889}
1890
1891void FolderMemoryCard::DeleteFromIndex(const std::string& filePath, const std::string_view entry) const
1892{
1893 const std::string indexName(Path::Combine(filePath, "_pcsx2_index"));
1894
1895 std::optional<ryml::Tree> yaml = loadYamlFile(indexName.c_str());
1896 if (yaml.has_value() && !yaml.value().empty())
1897 {
1898 ryml::NodeRef index = yaml.value().rootref();
1899
1900 if (index.has_child(ryml::csubstr(entry.data(), entry.length())))
1901 {
1902 index.remove_child(ryml::csubstr(entry.data(), entry.length()));
1903 // Write out the changes
1904 SaveYAMLToFile(indexName.c_str(), index);
1905 }
1906 }
1907}
1908
1909// from http://www.oocities.org/siliconvalley/station/8269/sma02/sma02.html#ECC
1910void FolderMemoryCard::CalculateECC(u8* ecc, const u8* data)

Callers

nothing calls this directly

Calls 8

CombineFunction · 0.85
loadYamlFileFunction · 0.85
SaveYAMLToFileFunction · 0.85
c_strMethod · 0.45
emptyMethod · 0.45
valueMethod · 0.45
dataMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected