bit7z 4.0.0
A C++ library for interfacing with the 7-zip shared libs.
Loading...
Searching...
No Matches
bitfilecompressor.hpp
1/*
2 * bit7z - A C++ static library to interface with the 7-zip shared libraries.
3 * Copyright (c) 2014-2023 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 BITFILECOMPRESSOR_HPP
11#define BITFILECOMPRESSOR_HPP
12
13#include <map>
14#include <ostream>
15#include <vector>
16
17#include "bitcompressor.hpp"
18
19namespace bit7z {
20
21using std::vector;
22using std::map;
23using std::ostream;
24
25using namespace filesystem;
26
34class BitFileCompressor final : public BitCompressor< const tstring& > {
35 public:
47
48 /* Compression from the file system to the file system. */
49
59 void compress( const std::vector< tstring >& inPaths, const tstring& outFile ) const;
60
72 void compress( const std::map< tstring, tstring >& inPaths, const tstring& outFile ) const;
73
82 void compressFiles( const std::vector< tstring >& inFiles, const tstring& outFile ) const;
83
92 void compressFiles( const tstring& inDir,
93 const tstring& outFile,
94 bool recursive = true,
95 const tstring& filter = BIT7Z_STRING( "*" ) ) const;
96
105 void compressDirectory( const tstring& inDir, const tstring& outFile ) const;
106
107 /* Compression from the file system to standard streams. */
108
118 void compress( const std::vector< tstring >& inPaths, std::ostream& outStream ) const;
119
131 void compress( const std::map< tstring, tstring >& inPaths, std::ostream& outStream ) const;
132};
133
134} // namespace bit7z
135#endif // BITFILECOMPRESSOR_HPP
The Bit7zLibrary class allows accessing the basic functionalities provided by the 7z DLLs.
Definition bit7zlibrary.hpp:56
auto format() const noexcept -> const BitInFormat &override
The BitCompressor template class allows compressing files into archives.
Definition bitcompressor.hpp:45
The BitFileCompressor class allows compressing files and directories.
Definition bitfilecompressor.hpp:34
void compress(const std::vector< tstring > &inPaths, const tstring &outFile) const
Compresses the given files or directories.
void compress(const std::map< tstring, tstring > &inPaths, const tstring &outFile) const
Compresses the given files or directories using the specified aliases.
void compressDirectory(const tstring &inDir, const tstring &outFile) const
Compresses an entire directory.
void compress(const std::vector< tstring > &inPaths, std::ostream &outStream) const
Compresses the given files or directories.
void compress(const std::map< tstring, tstring > &inPaths, std::ostream &outStream) const
Compresses the given files or directories using the specified aliases.
void compressFiles(const tstring &inDir, const tstring &outFile, bool recursive=true, const tstring &filter="*") const
Compresses the files contained in a directory.
void compressFiles(const std::vector< tstring > &inFiles, const tstring &outFile) const
Compresses a group of files.
BitFileCompressor(const Bit7zLibrary &lib, const BitInOutFormat &format)
Constructs a BitFileCompressor object.
The BitInOutFormat class specifies a format available for creating new archives and extract old ones.
Definition bitformat.hpp:105
The main namespace of the bit7z library.
Definition bit7zlibrary.hpp:30