![]() |
XII Release 0.1.0
|
Utility class to build a xiiArchive 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 = xiiDelegate<InclusionMode(xiiStringView)> |
Custom decider whether to include a file into the archive. | |
Public Member Functions | |
void | AddFolder (xiiStringView sAbsFolderPath, xiiArchiveCompressionMode defaultMode=xiiArchiveCompressionMode::Uncompressed, InclusionCallback callback=InclusionCallback()) |
Iterates over all files in a folder and adds them to m_Entries for later. | |
xiiResult | WriteArchive (xiiStringView sFile) const |
Overwrites the given file with the archive. | |
xiiResult | WriteArchive (xiiStreamWriter &ref_stream) const |
Writes the previously gathered files to the file stream. | |
Public Attributes | |
xiiDeque< SourceEntry > | m_Entries |
Protected Member Functions | |
virtual bool | WriteNextFileCallback (xiiUInt32 uiCurEntry, xiiUInt32 uiMaxEntries, xiiStringView 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 (xiiUInt64 bytesWritten, xiiUInt64 bytesTotal) const |
Override this to get a progress report for writing a single file to the output. | |
virtual void | WriteFileResultCallback (xiiUInt32 uiCurEntry, xiiUInt32 uiMaxEntries, xiiStringView sSourceFile, xiiUInt64 uiSourceSize, xiiUInt64 uiStoredSize, xiiTime 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 a xiiArchive file from files/folders on disk.
All functionality for writing a xiiArchive file is available through xiiArchiveUtils.
|
strong |
void xiiArchiveBuilder::AddFolder | ( | xiiStringView | sAbsFolderPath, |
xiiArchiveCompressionMode | defaultMode = xiiArchiveCompressionMode::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.