Add callback option for extract all
This commit is contained in:
@@ -217,6 +217,18 @@ namespace OpenVulkano
|
||||
return count;
|
||||
}
|
||||
|
||||
size_t ArchiveReader::ExtractRemaining(const std::filesystem::path& targetDir, const std::function<void(const FileDescription&)> extractionCallback)
|
||||
{
|
||||
size_t count = 0;
|
||||
std::optional<FileDescription> fd;
|
||||
while (fd = ExtractNext(targetDir))
|
||||
{
|
||||
extractionCallback(fd.value());
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
bool ArchiveReader::HasNext() const
|
||||
{
|
||||
return m_archiveEntry != nullptr;
|
||||
|
||||
@@ -56,6 +56,8 @@ namespace OpenVulkano
|
||||
|
||||
size_t ExtractRemaining(const std::filesystem::path& targetDir);
|
||||
|
||||
size_t ExtractRemaining(const std::filesystem::path& targetDir, const std::function<void(const FileDescription&)> extractionCallback);
|
||||
|
||||
// Element wise operations
|
||||
[[nodiscard]] bool HasNext() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user