bit7z 4.1.0
A C++ library for interfacing with the 7-zip shared libs.
Loading...
Searching...
No Matches
bititemsvector.hpp
1/*
2 * bit7z - A C++ static library to interface with the 7-zip shared libraries.
3 * Copyright (c) Riccardo Ostani - All Rights Reserved.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
8 */
9
10#ifndef BITITEMSVECTOR_HPP
11#define BITITEMSVECTOR_HPP
12
13#include "bitabstractarchivehandler.hpp"
14#include "bitfs.hpp"
15#include "bitinputitem.hpp"
16#include "bittypes.hpp"
17
18#include <map>
19#include <vector>
20
21namespace bit7z {
22
24struct IndexingOptions {
25 FilterPolicy filterPolicy = FilterPolicy::Include;
26 bool recursive = true;
27 bool retainFolderStructure = false;
28 bool onlyFiles = false;
29 SymlinkPolicy symlinkPolicy = SymlinkPolicy::Follow;
30};
32
37
49 BitItemsVector& outVector,
50 const tstring& inDir,
51 const tstring& filter = {},
52 IndexingOptions options = {}
53);
54
66 BitItemsVector& outVector,
67 const tstring& inDir,
68 const tstring& filter = {},
69 IndexingOptions options = {}
70);
71
80void indexPaths( BitItemsVector& outVector, const std::vector< tstring >& inPaths, IndexingOptions options = {} );
81
94 BitItemsVector& outVector,
96 IndexingOptions options = {}
97);
98
112 BitItemsVector& outVector,
113 const std::map< tstring, tstring >& inPaths,
114 IndexingOptions options = {}
115);
116
128 BitItemsVector& outVector,
129 const tstring& inFile,
130 const tstring& name = {},
132);
133
141void indexBuffer( BitItemsVector& outVector, const buffer_t& inBuffer, const tstring& name );
142
150void indexStream( BitItemsVector& outVector, std::istream& inStream, const tstring& name );
151
152} // namespace bit7z
153
154#endif //BITITEMSVECTOR_HPP
The main namespace of the bit7z library.
Definition bit7zlibrary.hpp:29
void indexDirectory(BitItemsVector &outVector, const tstring &inDir, const tstring &filter={}, IndexingOptions options={})
Indexes the given directory, adding to the vector all the files that match the wildcard filter.
SymlinkPolicy
Enumeration representing how an input item should deal with symbolic links.
Definition bitinputitem.hpp:26
@ Follow
Follow symbolic links, storing the content of the pointed-to file.
Definition bitinputitem.hpp:27
std::vector< BitInputItem > BitItemsVector
A vector of items to be compressed into an archive.
Definition bititemsvector.hpp:36
void indexFile(BitItemsVector &outVector, const tstring &inFile, const tstring &name={}, SymlinkPolicy symlinkPolicy=SymlinkPolicy::Follow)
Indexes the given file path, with an optional user-defined path to be used in output archives.
void indexPathsMap(BitItemsVector &outVector, const std::map< tstring, tstring > &inPaths, IndexingOptions options={})
Indexes the given map of filesystem paths, adding to the vector all the files.
std::basic_string< tchar > tstring
Definition bittypes.hpp:104
FilterPolicy
Enumeration representing the policy according to which the archive handler should treat the items tha...
Definition bitabstractarchivehandler.hpp:112
void indexBuffer(BitItemsVector &outVector, const buffer_t &inBuffer, const tstring &name)
Indexes the given buffer, using the given name as a path when compressed in archives.
void indexPaths(BitItemsVector &outVector, const std::vector< tstring > &inPaths, IndexingOptions options={})
Indexes the given vector of filesystem paths, adding to the item vector all the files.
void indexDirectoryContent(BitItemsVector &outVector, const tstring &inDir, const tstring &filter={}, IndexingOptions options={})
Indexes the content of the given directory, adding to the vector all the files that match the wildcar...
void indexStream(BitItemsVector &outVector, std::istream &inStream, const tstring &name)
Indexes the given standard input stream, using the given name as a path when compressed in archives.