Add framework for extract all files

This commit is contained in:
Matt Nadareski
2022-07-07 12:43:35 -07:00
parent 1517a66724
commit 083ded8a7e

View File

@@ -281,6 +281,27 @@ namespace BurnOutSharp.FileType
return found ? index : -1;
}
/// <summary>
/// Extract all files from the archive to <paramref name="outputDirectory"/>
/// </summary>
public bool ExtractAllFiles(string outputDirectory)
{
// Perform sanity checks
if (Header == null || Files == null || Files.Length == 0)
return false;
// Loop through and extract all files
foreach (CFFILE file in Files)
{
string outputPath = Path.Combine(outputDirectory, file.NameAsString);
}
// TODO: We don't check for other cabinets here yet
// TODO: Read and decompress data blocks
return true;
}
/// <summary>
/// Extract a single file from the archive to <paramref name="outputDirectory"/>
/// </summary>