![]() |
Plasma Engine
2.0
|
A utility class for reading from plArchive files. More...
#include <ArchiveReader.h>
Public Member Functions | |
plResult | OpenArchive (plStringView sPath) |
Opens the given file and validates that it is a valid archive file. | |
const plArchiveTOC & | GetArchiveTOC () |
Returns the table-of-contents for the previously opened archive. | |
plResult | ExtractFile (plUInt32 uiEntryIdx, plStringView sTargetFolder) const |
Extracts the given entry to the target folder. | |
plResult | ExtractAllFiles (plStringView sTargetFolder) const |
Extracts all files to the target folder. | |
void | ConfigureRawMemoryStreamReader (plUInt32 uiEntryIdx, plRawMemoryStreamReader &ref_memReader) const |
Sets up memReader for reading the raw (potentially compressed) data that is stored for the given entry in the archive. | |
plUniquePtr< plStreamReader > | CreateEntryReader (plUInt32 uiEntryIdx) const |
Creates a reader that will decompress the given file entry. | |
Protected Member Functions | |
virtual bool | ExtractNextFileCallback (plUInt32 uiCurEntry, plUInt32 uiMaxEntries, plStringView sSourceFile) const |
Called by ExtractAllFiles() for progress reporting. Return false to abort. | |
virtual bool | ExtractFileProgressCallback (plUInt64 bytesWritten, plUInt64 bytesTotal) const |
Called by ExtractFile() for progress reporting. Return false to abort. | |
Protected Attributes | |
plMemoryMappedFile | m_MemFile |
plArchiveTOC | m_ArchiveTOC |
plUInt8 | m_uiArchiveVersion = 0 |
const void * | m_pDataStart = nullptr |
plUInt64 | m_uiMemFileSize = 0 |
A utility class for reading from plArchive files.
plResult plArchiveReader::ExtractAllFiles | ( | plStringView | sTargetFolder | ) | const |
Extracts all files to the target folder.
Calls ExtractNextFileCallback() for every file that is being extracted.
plResult plArchiveReader::ExtractFile | ( | plUInt32 | uiEntryIdx, |
plStringView | sTargetFolder ) const |
Extracts the given entry to the target folder.
Calls ExtractFileProgressCallback() to report progress.