10#ifndef BITEXTRACTOR_HPP
11#define BITEXTRACTOR_HPP
13#include "bit7zlibrary.hpp"
14#include "bitabstractarchivehandler.hpp"
15#include "bitabstractarchiveopener.hpp"
16#include "biterror.hpp"
17#include "bitexception.hpp"
18#include "bitformat.hpp"
19#include "bitinputarchive.hpp"
20#include "bittypes.hpp"
29#ifdef BIT7Z_REGEX_MATCHING
37 auto wildcardMatch(
const tstring& pattern,
const tstring& str ) -> bool;
46template<
typename Input >
65 : BitAbstractArchiveOpener( lib,
format ) {}
75 inputArchive.extractTo( outDir );
97 "Since v4.1; the RenameCallback now receives the BitArchiveItem being extracted. "
98 "The (index, path) form will be removed in v4.2."
102 inputArchive.extractTo(
106#
if BIT7Z_CPP_STANDARD >= 14
111 return callback( item.
index(), item.
path() );
162 inputArchive.
extractTo( outBuffer, index );
174 template< std::
size_t N >
177 inputArchive.
extractTo( outBuffer, index );
189 template< std::
size_t N >
192 inputArchive.
extractTo( outBuffer, index );
206 inputArchive.
extractTo( outBuffer, size, index );
218 inputArchive.
extractTo( outStream, index );
242 inputArchive.extractTo(
std::move( callback ), indices );
256 inputArchive.extractTo(
std::move( callback ), indices );
309 if ( indices.
empty() ) {
313 const BitInputArchive inputArchive( *
this, inArchive );
314 inputArchive.
extractTo( outDir, indices );
317#ifdef BIT7Z_REGEX_MATCHING
397 inputArchive.
test( indices );
The Bit7zLibrary class allows accessing the basic functionalities provided by the 7z DLLs.
Definition bit7zlibrary.hpp:55
auto format() const noexcept -> const BitInFormat &override
The BitArchiveItem class represents a generic item inside an archive.
Definition bitarchiveitem.hpp:25
auto path() const -> tstring final
auto index() const noexcept -> std::uint32_t
The BitException class represents a generic exception thrown from the bit7z classes.
Definition bitexception.hpp:54
A non-owning, read-only view over a contiguous sequence of archive item indices.
Definition bitindicesview.hpp:44
constexpr auto empty() const noexcept -> bool
Definition bitindicesview.hpp:169
The main namespace of the bit7z library.
Definition bit7zlibrary.hpp:29
std::function< tstring(std::uint32_t, const tstring &) > LegacyRenameCallback
The (index, path) form of RenameCallback.
Definition bitabstractarchivehandler.hpp:73
unsigned char byte_t
A type representing a byte.
Definition bittypes.hpp:38
auto make_error_code(BitError error) noexcept -> std::error_code
Creates a std::error_code from the given BitError value.
std::function< tstring(const BitArchiveItem &) > RenameCallback
A function returning a new name for the item currently being extracted.
Definition bitabstractarchivehandler.hpp:65
std::function< bool(const byte_t *, std::size_t) > RawDataCallback
A function providing the raw extracted data and its size to the user.
Definition bitabstractarchivehandler.hpp:56
std::basic_string< tchar > tstring
Definition bittypes.hpp:104
std::function< buffer_t &(std::uint32_t, const tstring &) > BufferCallback
A function returning a reference to the buffer where to extract the item at the given index/path.
Definition bitabstractarchivehandler.hpp:78
FilterPolicy
Enumeration representing the policy according to which the archive handler should treat the items tha...
Definition bitabstractarchivehandler.hpp:112
@ Include
Extract/compress the items that match the pattern.
Definition bitabstractarchivehandler.hpp:113
@ IndicesNotSpecified
No item indices were specified.
Definition biterror.hpp:28
std::function< FilterResult(const BitArchiveItem &) > FilterCallback
A function returning what to do with the given archive item.
Definition bitabstractarchivehandler.hpp:95
FolderPathPolicy
Policy controlling how a folder's path is reflected in the extracted items' paths.
Definition bitinputarchive.hpp:55
@ Strip
Remove the folder path from the extracted path.
Definition bitinputarchive.hpp:56