本文整理汇总了C++中IFileSystem::GetFileList方法的典型用法代码示例。如果您正苦于以下问题:C++ IFileSystem::GetFileList方法的具体用法?C++ IFileSystem::GetFileList怎么用?C++ IFileSystem::GetFileList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFileSystem
的用法示例。
在下文中一共展示了IFileSystem::GetFileList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParsePartitionData
// Operations dealing with encrypted space are done here - the volume is swapped to allow this
bool ParsePartitionData(SPartition& _rPartition)
{
bool ParsedOK = true;
// Switch out the main volume temporarily
IVolume *OldVolume = m_Disc;
// Ready some stuff
m_Disc = CreateVolumeFromFilename(m_Filename, _rPartition.GroupNumber, _rPartition.Number);
IFileSystem *FileSystem = CreateFileSystem(m_Disc);
if (!FileSystem)
{
ERROR_LOG(DISCIO, "Failed to create filesystem for group %d partition %u", _rPartition.GroupNumber, _rPartition.Number);
ParsedOK = false;
}
else
{
std::vector<const SFileInfo *> Files;
size_t numFiles = FileSystem->GetFileList(Files);
// Mark things as used which are not in the filesystem
// Header, Header Information, Apploader
ReadFromVolume(0x2440 + 0x14, 4, _rPartition.Header.ApploaderSize);
ReadFromVolume(0x2440 + 0x18, 4, _rPartition.Header.ApploaderTrailerSize);
MarkAsUsedE(_rPartition.Offset
+ _rPartition.Header.DataOffset
, 0
, 0x2440
+ _rPartition.Header.ApploaderSize
+ _rPartition.Header.ApploaderTrailerSize);
// DOL
ReadFromVolume(0x420, 4, _rPartition.Header.DOLOffset);
_rPartition.Header.DOLSize = GetDOLSize(_rPartition.Header.DOLOffset);
MarkAsUsedE(_rPartition.Offset
+ _rPartition.Header.DataOffset
, _rPartition.Header.DOLOffset
, _rPartition.Header.DOLSize);
// FST
ReadFromVolume(0x424, 4, _rPartition.Header.FSTOffset);
ReadFromVolume(0x428, 4, _rPartition.Header.FSTSize);
MarkAsUsedE(_rPartition.Offset
+ _rPartition.Header.DataOffset
, _rPartition.Header.FSTOffset
, _rPartition.Header.FSTSize);
// Go through the filesystem and mark entries as used
for (size_t currentFile = 0; currentFile < numFiles; currentFile++)
{
DEBUG_LOG(DISCIO, "%s", currentFile ? (*Files.at(currentFile)).m_FullPath : "/");
// Just 1byte for directory? - it will end up reserving a cluster this way
if ((*Files.at(currentFile)).m_NameOffset & 0x1000000)
MarkAsUsedE(_rPartition.Offset
+ _rPartition.Header.DataOffset
, (*Files.at(currentFile)).m_Offset, 1);
else
MarkAsUsedE(_rPartition.Offset
+ _rPartition.Header.DataOffset
, (*Files.at(currentFile)).m_Offset, (*Files.at(currentFile)).m_FileSize);
}
}
delete FileSystem;
// Swap back
delete m_Disc;
m_Disc = OldVolume;
return ParsedOK;
}