![]() |
Plasma Engine
2.0
|
Utility class to build an plArchive file from files/folders on disk. More...
#include <ArchiveBuilder.h>

Classes | |
| struct | SourceEntry |
Public Types | |
| enum class | InclusionMode { Exclude , Uncompressed , Compress_zstd_fastest , Compress_zstd_fast , Compress_zstd_average , Compress_zstd_high , Compress_zstd_highest } |
| using | InclusionCallback = plDelegate<InclusionMode(plStringView)> |
| Custom decider whether to include a file into the archive. | |
Public Member Functions | |
| void | AddFolder (plStringView sAbsFolderPath, plArchiveCompressionMode defaultMode=plArchiveCompressionMode::Uncompressed, InclusionCallback callback=InclusionCallback()) |
| Iterates over all files in a folder and adds them to m_Entries for later. | |
| plResult | WriteArchive (plStringView sFile) const |
| Overwrites the given file with the archive. | |
| plResult | WriteArchive (plStreamWriter &inout_stream) const |
| Writes the previously gathered files to the file stream. | |
Public Attributes | |
| plDeque< SourceEntry > | m_Entries |
Protected Member Functions | |
| virtual bool | WriteNextFileCallback (plUInt32 uiCurEntry, plUInt32 uiMaxEntries, plStringView sSourceFile) const |
| Override this to get a callback when the next file is being written to the output. Return 'true' to continue, 'false' to cancel the entire archive generation. | |
| virtual bool | WriteFileProgressCallback (plUInt64 bytesWritten, plUInt64 bytesTotal) const |
| Override this to get a progress report for writing a single file to the output. | |
| virtual void | WriteFileResultCallback (plUInt32 uiCurEntry, plUInt32 uiMaxEntries, plStringView sSourceFile, plUInt64 uiSourceSize, plUInt64 uiStoredSize, plTime duration) const |
| Override this to get a callback after a file has been processed. Gets additional information about the compression result and duration. | |
Utility class to build an plArchive file from files/folders on disk.
All functionality for writing an plArchive file is available through plArchiveUtils.
|
strong |
| void plArchiveBuilder::AddFolder | ( | plStringView | sAbsFolderPath, |
| plArchiveCompressionMode | defaultMode = plArchiveCompressionMode::Uncompressed, | ||
| InclusionCallback | callback = InclusionCallback() ) |
Iterates over all files in a folder and adds them to m_Entries for later.
The callback can be used to exclude certain files or to deactivate compression on them.