/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/Engine/Foundation/IO/Archive/ArchiveReader.h
48 строк
2 KB
Ingrater
Implement parameter coding guidelines in clang-tidy (#808)
18 фев 2023, 13:18
Не верифицирован
18 фев 2023, 13:18
3c98d47
Код
Авторство
О чём код?
#pragma once #include <Foundation/IO/Archive/Archive.h> #include <Foundation/IO/MemoryMappedFile.h> #include <Foundation/Types/UniquePtr.h> class ezRawMemoryStreamReader; class ezStreamReader; /// \brief A utility class for reading from ezArchive files class EZ_FOUNDATION_DLL ezArchiveReader { public: /// \brief Opens the given file and validates that it is a valid archive file. ezResult OpenArchive(ezStringView sPath); /// \brief Returns the table-of-contents for the previously opened archive. const ezArchiveTOC& GetArchiveTOC(); /// \brief Extracts the given entry to the target folder. /// /// Calls ExtractFileProgressCallback() to report progress. ezResult ExtractFile(ezUInt32 uiEntryIdx, ezStringView sTargetFolder) const; /// \brief Extracts all files to the target folder. /// /// Calls ExtractNextFileCallback() for every file that is being extracted. ezResult ExtractAllFiles(ezStringView sTargetFolder) const; /// \brief Sets up \a memReader for reading the raw (potentially compressed) data that is stored for the given entry in the archive. void ConfigureRawMemoryStreamReader(ezUInt32 uiEntryIdx, ezRawMemoryStreamReader& ref_memReader) const; /// \brief Creates a reader that will decompress the given file entry. ezUniquePtr<ezStreamReader> CreateEntryReader(ezUInt32 uiEntryIdx) const; protected: /// \brief Called by ExtractAllFiles() for progress reporting. Return false to abort. virtual bool ExtractNextFileCallback(ezUInt32 uiCurEntry, ezUInt32 uiMaxEntries, ezStringView sSourceFile) const; /// \brief Called by ExtractFile() for progress reporting. Return false to abort. virtual bool ExtractFileProgressCallback(ezUInt64 bytesWritten, ezUInt64 bytesTotal) const; ezMemoryMappedFile m_MemFile; ezArchiveTOC m_ArchiveTOC; ezUInt8 m_uiArchiveVersion = 0; const void* m_pDataStart = nullptr; ezUInt64 m_uiMemFileSize = 0; };