| Disk ARchive 2.7.18 Full featured and portable backup and archiving tool

Loading...
Searching...
No Matches
zstd_module.hpp
Go to the documentation of this file.
1/*********************************************************************/
2// dar - disk archive - a backup/restoration program
3// Copyright (C) 2002-2025 Denis Corbin
4//
5// This program is free software; you can redistribute it and/or
6// modify it under the terms of the GNU General Public License
7// as published by the Free Software Foundation; either version 2
8// of the License, or (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program; if not, write to the Free Software
17// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18//
19// to contact the author, see the AUTHOR file
20/*********************************************************************/
21
26
27#ifndef ZSTD_MODULE_HPP
28#define ZSTD_MODULE_HPP
29
30 extern "C"
31{
32}
33
34#include "../my_config.h"
35
36#include "compress_module.hpp"
37#include "infinint.hpp"
38
39 namespace libdar
40{
41
44
45 class zstd_module: public compress_module
46 {
47 public:
48 zstd_module(U_I compression_level = 9);
49 zstd_module(const zstd_module & ref) = default;
50 zstd_module(zstd_module && ref) noexcept = default;
51 zstd_module & operator = (const zstd_module & ref) = default;
52 zstd_module & operator = (zstd_module && ref) noexcept = default;
53 virtual ~zstd_module() noexcept = default;
54
55 // inherited from compress_module interface
56
57 virtual compression get_algo() const override { return compression::zstd; };
58
59 virtual U_I get_max_compressing_size() const override;
60
61 virtual U_I get_min_size_to_compress(U_I clear_size) const override;
62
63 virtual U_I compress_data(const char *normal,
64 const U_I normal_size,
65 char *zip_buf,
66 U_I zip_buf_size) const override;
67
68 virtual U_I uncompress_data(const char *zip_buf,
69 const U_I zip_buf_size,
70 char *normal,
71 U_I normal_size) const override;
72
73
74 virtual std::unique_ptr<compress_module> clone() const override;
75
76 private:
77 U_I level;
78
79 };
81
82} // end of namespace
83
84#endif
compress_module.hpp
provides abstracted interface of per-block compression/decompression
libdar::compression
compression
the different compression algorithm available
Definition compression.hpp:46
libdar::compression::zstd
@ zstd
zstd compression
infinint.hpp
switch module to limitint (32 ou 64 bits integers) or infinint
my_config.h
include macro defined by the configure script and some specific additional ones
libdar
libdar namespace encapsulate all libdar symbols
Definition archive.hpp:47