Filesystem: Replace file info's full path with name

Some callers (i.e. ISOProperties) don't want the full path, so giving them
it is unnecessary. Those that do want it can use GetPathFromFSTOffset.
Not storing full paths everywhere also saves a small bit of RAM and is
necessary for a later commit. The code isn't especially pretty right now
(callers need to use FST offsets...) but it'll become better later.
This commit is contained in:
JosJuice
2015-07-29 16:42:29 +02:00
parent 5021b4a567
commit 07d3a39aeb
6 changed files with 89 additions and 90 deletions

View File

@ -221,9 +221,12 @@ bool DiscScrubber::ParsePartitionData(const Partition& partition, PartitionHeade
MarkAsUsedE(partition_data_offset, header->fst_offset, header->fst_size);
// Go through the filesystem and mark entries as used
for (const FileInfoGCWii& file : filesystem->GetFileList())
auto& file_list = filesystem->GetFileList();
for (size_t i = 0; i < file_list.size(); ++i)
{
DEBUG_LOG(DISCIO, "%s", file.m_FullPath.empty() ? "/" : file.m_FullPath.c_str());
const std::string path = filesystem->GetPathFromFSTOffset(i);
DEBUG_LOG(DISCIO, "%s", path.empty() ? "/" : path.c_str());
auto& file = file_list[i];
if (!file.IsDirectory())
MarkAsUsedE(partition_data_offset, file.GetOffset(), file.GetSize());
}