Filesystem: Replace GetFileList()

Instead of expecting callers to know how the size of directory file infos
relates to which files are in which directories, filesystems now offer a
GetRoot() method, and file infos offer a way to get their children. As
a bonus, m_FileInfoVector no longer has to be created and kept around
in RAM. Only the file info objects that actually are used are created.
This commit is contained in:
JosJuice
2015-08-08 19:59:33 +02:00
parent ee2b88ebb6
commit 87916fe099
11 changed files with 374 additions and 268 deletions

View File

@ -274,9 +274,9 @@ std::map<Language, std::string> VolumeWii::GetLongNames() const
return {};
std::vector<u8> opening_bnr(NAMES_TOTAL_BYTES);
const FileInfo* file_info = file_system->FindFileInfo("opening.bnr");
size_t size = file_system->ReadFile(file_info, opening_bnr.data(), opening_bnr.size(), 0x5C);
opening_bnr.resize(size);
std::unique_ptr<FileInfo> file_info = file_system->FindFileInfo("opening.bnr");
opening_bnr.resize(
file_system->ReadFile(file_info.get(), opening_bnr.data(), opening_bnr.size(), 0x5C));
return ReadWiiNames(opening_bnr);
}