Plasma Engine  2.0
Loading...
Searching...
No Matches
plArchiveReader Class Reference

A utility class for reading from plArchive files. More...

#include <ArchiveReader.h>

Inheritance diagram for plArchiveReader:

Public Member Functions

plResult OpenArchive (plStringView sPath)
 Opens the given file and validates that it is a valid archive file.
 
const plArchiveTOCGetArchiveTOC ()
 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< plStreamReaderCreateEntryReader (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
 

Detailed Description

A utility class for reading from plArchive files.

Member Function Documentation

◆ ExtractAllFiles()

plResult plArchiveReader::ExtractAllFiles ( plStringView sTargetFolder) const

Extracts all files to the target folder.

Calls ExtractNextFileCallback() for every file that is being extracted.

◆ ExtractFile()

plResult plArchiveReader::ExtractFile ( plUInt32 uiEntryIdx,
plStringView sTargetFolder ) const

Extracts the given entry to the target folder.

Calls ExtractFileProgressCallback() to report progress.


The documentation for this class was generated from the following files: