10#ifndef BITABSTRACTARCHIVECREATOR_HPP
11#define BITABSTRACTARCHIVECREATOR_HPP
13#include "bit7zlibrary.hpp"
14#include "bitabstractarchivehandler.hpp"
15#include "bitcompressionlevel.hpp"
16#include "bitcompressionmethod.hpp"
17#include "bitdefines.hpp"
18#include "bitformat.hpp"
19#include "bitinputarchive.hpp"
20#include "bitpropvariant.hpp"
21#include "bittypes.hpp"
30struct ISequentialOutStream;
34class ArchiveProperties;
43 BIT7Z_DEPRECATED_ENUMERATOR(
Overwrite,
Update,
"Since v4.0. Please use the UpdateMode::Update enumerator." )
57class BitAbstractArchiveCreator :
public BitAbstractArchiveHandler {
59 BitAbstractArchiveCreator(
const BitAbstractArchiveCreator& ) =
delete;
61 BitAbstractArchiveCreator( BitAbstractArchiveCreator&& ) =
delete;
63 auto operator=(
const BitAbstractArchiveCreator& ) -> BitAbstractArchiveCreator& =
delete;
65 auto operator=( BitAbstractArchiveCreator&& ) -> BitAbstractArchiveCreator& =
delete;
67 ~BitAbstractArchiveCreator()
override =
default;
102 BIT7Z_NODISCARD auto
wordSize() const noexcept -> std::uint32_t;
107 BIT7Z_NODISCARD auto
solidMode() const noexcept ->
bool;
118 BIT7Z_NODISCARD auto
volumeSize() const noexcept -> std::uint64_t;
219 BIT7Z_DEPRECATED_MSG(
"Since v4.1. Please use the setPassword overload taking an EncryptionScope enumerator." )
280 BIT7Z_DEPRECATED_MSG(
"Since v4.0. Please use the overloaded function that takes an UpdateMode enumerator." )
353 template< std::
size_t N, typename T, typename = typename std::enable_if< std::is_integral< T >::value >::type >
355 mExtraProperties[ name ] = value;
370 template< std::size_t N, typename T, typename = typename std::enable_if< !std::is_integral< T >::value >::type >
372 mExtraProperties[ name ] = value;
383 BIT7Z_NODISCARD
auto archiveProperties() const -> ArchiveProperties;
385 friend class BitOutputArchive;
388 const BitInOutFormat& mFormat;
393 std::uint32_t mDictionarySize;
394 std::uint32_t mWordSize;
397 std::uint64_t mVolumeSize;
398 std::uint32_t mThreadsCount;
399 bool mStoreSymbolicLinks;
400 bool mStoreOpenFiles;
401 std::map< std::wstring, BitPropVariant > mExtraProperties;
The Bit7zLibrary class allows accessing the basic functionalities provided by the 7z DLLs.
Definition bit7zlibrary.hpp:55
Abstract class representing a generic archive creator.
Definition bitabstractarchivecreator.hpp:57
void setPassword(const tstring &password) override
Sets up a password for the output archives.
void setCompressionMethod(BitCompressionMethod method)
Sets the compression method to be used when creating/updating an archive.
void setFormatProperty(const wchar_t(&name)[N], const T &value) noexcept
Sets a property for the output archive format as described by the 7-zip documentation (e....
Definition bitabstractarchivecreator.hpp:371
auto storeCreationTime() const noexcept -> bool
auto threadsCount() const noexcept -> std::uint32_t
auto compressionFormat() const noexcept -> const BitInOutFormat &
void setWordSize(std::uint32_t wordSize)
Sets the word size to be used when creating/updating an archive.
auto dictionarySize() const noexcept -> std::uint32_t
auto compressionLevel() const noexcept -> BitCompressionLevel
void setSolidMode(bool solidMode) noexcept
Sets whether to use solid compression or not.
auto cryptHeaders() const noexcept -> bool
auto solidMode() const noexcept -> bool
void setStoreLastAccessTime(bool storeLastAccessTime) noexcept
Sets whether the creator will store last access timestamps of items.
auto wordSize() const noexcept -> std::uint32_t
void setStoreOpenFiles(bool storeOpenFiles) noexcept
Sets whether the creator will attempt to compress files that are locked by other processes.
auto storeOpenFiles() const noexcept -> bool
void setThreadsCount(std::uint32_t threadsCount) noexcept
Sets the number of threads to be used when creating/updating an archive.
void setStoreLastWriteTime(bool storeLastWriteTime) noexcept
Sets whether the creator will store last write timestamps of items.
auto format() const noexcept -> const BitInFormat &override
void setStoreSymbolicLinks(bool storeSymlinks) noexcept
Sets whether the creator will store symbolic links as links in the output archive.
auto storeSymbolicLinks() const noexcept -> bool
virtual void setUpdateMode(UpdateMode mode)
Sets whether and how the creator can update existing archives or not.
auto volumeSize() const noexcept -> std::uint64_t
void setCompressionLevel(BitCompressionLevel level) noexcept
Sets the compression level to be used when creating/updating an archive.
void setDictionarySize(std::uint32_t dictionarySize)
Sets the dictionary size to be used when creating/updating an archive.
auto compressionMethod() const noexcept -> BitCompressionMethod
auto storeLastAccessTime() const noexcept -> bool
void setVolumeSize(std::uint64_t volumeSize) noexcept
Sets the volumeSize (in bytes) of the output archive volumes.
auto storeLastWriteTime() const noexcept -> bool
void setFormatProperty(const wchar_t(&name)[N], T value) noexcept
Sets a property for the output archive format as described by the 7-zip documentation (e....
Definition bitabstractarchivecreator.hpp:354
auto updateMode() const noexcept -> UpdateMode
void setStoreCreationTime(bool storeCreationTime) noexcept
Sets whether the creator will store creation timestamps of items.
auto password() const -> const tstring &
virtual auto format() const noexcept -> const BitInFormat &=0
The main namespace of the bit7z library.
Definition bit7zlibrary.hpp:29
UpdateMode
Enumeration representing how an archive creator should deal when the output archive already exists.
Definition bitabstractarchivecreator.hpp:39
@ Update
New items whose path already exists in the archive will overwrite the old ones, other will be appende...
Definition bitabstractarchivecreator.hpp:42
@ Append
The creator will append the new items to the existing archive.
Definition bitabstractarchivecreator.hpp:41
@ None
The creator will throw an exception (unless the OverwriteMode is not None).
Definition bitabstractarchivecreator.hpp:40
@ Overwrite
Definition bitabstractarchivecreator.hpp:43
BitCompressionLevel
The BitCompressionLevel enum represents the compression level used by 7z when creating archives.
Definition bitcompressionlevel.hpp:21
EncryptionScope
The EncryptionScope enum represents the scope of encryption applied when setting a password on an arc...
Definition bitabstractarchivecreator.hpp:49
@ DataOnly
Only the archive's file data is encrypted.
Definition bitabstractarchivecreator.hpp:50
@ DataAndHeaders
Both the archive's file data and headers are encrypted (valid only for the 7z format).
Definition bitabstractarchivecreator.hpp:51
std::basic_string< tchar > tstring
Definition bittypes.hpp:104
BitCompressionMethod
The BitCompressionMethod enum represents the compression methods used by 7z when creating archives.
Definition bitcompressionmethod.hpp:20