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

Function FileMcd_GetCardInfo

pcsx2/SIO/Memcard/MemoryCardFile.cpp:955–986  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

953}
954
955std::optional<AvailableMcdInfo> FileMcd_GetCardInfo(const std::string_view name)
956{
957 std::optional<AvailableMcdInfo> ret;
958
959 std::string basename(name);
960 std::string path(Path::Combine(EmuFolders::MemoryCards, basename));
961
962 FILESYSTEM_STAT_DATA sd;
963 if (!FileSystem::StatFile(path.c_str(), &sd))
964 return ret;
965
966 if (sd.Attributes & FILESYSTEM_FILE_ATTRIBUTE_DIRECTORY)
967 {
968 if (FileMcd_IsFolder(path))
969 {
970 ret = {std::move(basename), std::move(path), sd.ModificationTime,
971 MemoryCardType::Folder, MemoryCardFileType::Unknown, 0u, true};
972 }
973 }
974 else
975 {
976 if (sd.Size >= MCD_SIZE)
977 {
978 const bool formatted = FileMcd_IsMemoryCardFormatted(path);
979 ret = {std::move(basename), std::move(path), sd.ModificationTime,
980 MemoryCardType::File, GetMemoryCardFileTypeFromSize(sd.Size),
981 static_cast<u32>(sd.Size), formatted};
982 }
983 }
984
985 return ret;
986}
987
988bool FileMcd_CreateNewCard(const std::string_view name, MemoryCardType type, MemoryCardFileType file_type)
989{

Callers 6

createCardMethod · 0.85
updateCardActionsMethod · 0.85
renameCardMethod · 0.85
setCardMethod · 0.85
DoCreateMemoryCardMethod · 0.85

Calls 5

CombineFunction · 0.85
FileMcd_IsFolderFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected