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

Method WriteEntryToCache

pcsx2/GameList.cpp:621–641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619}
620
621bool GameList::WriteEntryToCache(const Entry* entry)
622{
623 bool result = true;
624 result &= WriteString(s_cache_write_stream, entry->path);
625 result &= WriteString(s_cache_write_stream, entry->serial);
626 result &= WriteString(s_cache_write_stream, entry->title);
627 result &= WriteString(s_cache_write_stream, entry->title_sort);
628 result &= WriteString(s_cache_write_stream, entry->title_en);
629 result &= WriteU8(s_cache_write_stream, static_cast<u8>(entry->type));
630 result &= WriteU8(s_cache_write_stream, static_cast<u8>(entry->region));
631 result &= WriteU64(s_cache_write_stream, entry->total_size);
632 result &= WriteU64(s_cache_write_stream, static_cast<u64>(entry->last_modified_time));
633 result &= WriteU32(s_cache_write_stream, entry->crc);
634 result &= WriteU8(s_cache_write_stream, static_cast<u8>(entry->compatibility_rating));
635
636 // flush after each entry, that way we don't end up with a corrupted file if we crash scanning.
637 if (result)
638 result = (std::fflush(s_cache_write_stream) == 0);
639
640 return result;
641}
642
643void GameList::CloseCacheFileStream()
644{

Callers

nothing calls this directly

Calls 4

WriteStringFunction · 0.85
WriteU8Function · 0.85
WriteU64Function · 0.85
WriteU32Function · 0.85

Tested by

no test coverage detected