Disk ARchive: compress_module.hpp Source File

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

Loading...
Searching...
No Matches
compress_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
22
26
27#ifndef COMPRESS_MODULE_HPP
28#define COMPRESS_MODULE_HPP
29
30#include "../my_config.h"
31#include "integers.hpp"
32#include "compression.hpp"
33#include <memory>
34
35namespace libdar
36{
39
40
41 class compress_module
42 {
43 public:
44 compress_module() {};
45 compress_module(const compress_module & ref) = default;
46 compress_module(compress_module && ref) noexcept = default;
47 compress_module & operator = (const compress_module & ref) = default;
48 compress_module & operator = (compress_module && ref) noexcept = default;
49 virtual ~compress_module() = default;
50
52 virtual compression get_algo() const = 0;
53
55 virtual U_I get_max_compressing_size() const = 0;
56
58
61 virtual U_I get_min_size_to_compress(U_I clear_size) const = 0;
62
64
71 virtual U_I compress_data(const char *normal,
72 const U_I normal_size,
73 char *zip_buf,
74 U_I zip_buf_size) const = 0;
75
77
85 virtual U_I uncompress_data(const char *zip_buf,
86 const U_I zip_buf_size,
87 char *normal,
88 U_I normal_size) const = 0;
89
91
93 virtual std::unique_ptr<compress_module> clone() const = 0;
94
95 };
96
98
99} // end of namespace
100
101#endif
compression.hpp
compression parameters for API
libdar::compression
compression
the different compression algorithm available
Definition compression.hpp:46
integers.hpp
are defined here basic integer types that tend to be portable
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