| 953 | } |
| 954 | |
| 955 | std::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 | |
| 988 | bool FileMcd_CreateNewCard(const std::string_view name, MemoryCardType type, MemoryCardFileType file_type) |
| 989 | { |
no test coverage detected