forked from rikyoz/bit7z
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitmemextractor.hpp
53 lines (46 loc) · 2 KB
/
bitmemextractor.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef BITMEMEXTRACTOR_HPP
#define BITMEMEXTRACTOR_HPP
#include <iostream>
#include <vector>
#include "../include/bit7zlibrary.hpp"
#include "../include/bitguids.hpp"
#include "../include/bittypes.hpp"
#include "../include/bitarchiveopener.hpp"
namespace bit7z {
using std::wstring;
using std::vector;
/**
* @brief The BitMemExtractor class allows to extract the content of in-memory archives.
*/
class BitMemExtractor : public BitArchiveOpener {
public:
/**
* @brief Constructs a BitMemExtractor object.
*
* The Bit7zLibrary parameter is needed in order to have access to the functionalities
* of the 7z DLLs. On the other hand, the BitInFormat is required in order to know the
* format of the input archive.
*
* @param lib the 7z library used.
* @param format the input archive format.
*/
BitMemExtractor( const Bit7zLibrary& lib, const BitInFormat& format );
/**
* @brief Extracts the given buffer archive into the choosen directory.
*
* @param in_buffer the buffer containing the archive to be extracted.
* @param out_dir the output directory where to put the file extracted.
*/
void extract( const vector< byte_t >& in_buffer, const wstring& out_dir = L"" ) const;
/**
* @brief Extracts the given buffer archive into the output buffer.
*
* @param in_buffer the buffer containing the archive to be extracted.
* @param out_buffer the output buffer where the content of the archive will be put.
* @param index the index of the file to be extracted from in_buffer.
*/
void extract( const vector< byte_t >& in_buffer, vector< byte_t >& out_buffer,
unsigned int index = 0 ) const;
};
}
#endif // BITMEMEXTRACTOR_HPP