Disk ARchive  2.7.14
Full featured and portable backup and archiving tool
archive_aux.hpp
Go to the documentation of this file.
1 /*********************************************************************/
2 // dar - disk archive - a backup/restoration program
3 // Copyright (C) 2002-2024 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 
25 
26 
27 #ifndef ARCHIVE_AUX_HPP
28 #define ARCHIVE_AUX_HPP
29 
30 #include "../my_config.h"
31 
32 #include "integers.hpp"
33 #include <string>
34 
35 namespace libdar
36 {
37 
40 
42 
44  {
46  mtime_size,
47  };
48 
49 
51 
52  enum class comparison_fields
53  {
54  all,
55  ignore_owner,
56  mtime,
57  inode_type
58  };
59 
61 
62  enum class hash_algo
63  {
64  none,
65  md5,
66  sha1,
67  sha512,
68  argon2
69  };
70 
72  extern std::string hash_algo_to_string(hash_algo algo);
73 
75 
79  extern bool string_to_hash_algo(const std::string & arg, hash_algo & val);
80 
83 
85  extern unsigned char hash_algo_to_char(hash_algo algo);
86 
88 
90  extern hash_algo char_to_hash_algo(unsigned char arg);
91 
93 
94 } // end of namespace
95 
96 #endif
modified_data_detection
how to detect data has changed when some fields
Definition: archive_aux.hpp:44
comparison_fields
how to consider file change during comparison and incremental backup
Definition: archive_aux.hpp:53
hash_algo char_to_hash_algo(unsigned char arg)
convert char to hash_algo
bool string_to_hash_algo(const std::string &arg, hash_algo &val)
convert string to hash algorithm
std::string hash_algo_to_string(hash_algo algo)
convert hash value to human readable string
hash_algo
hashing algorithm available
Definition: archive_aux.hpp:63
unsigned char hash_algo_to_char(hash_algo algo)
convert hash value to char value
U_I hash_algo_to_gcrypt_hash(hash_algo algo)
convert hash value to libgcrypt hash value
@ any_inode_change
historical behavior, resave an inode on any metadata change
@ mtime_size
default behavior since release 2.6.0 resave only if file size of mtime changed
@ inode_type
only consider the file type
@ ignore_owner
consider any available field except ownership fields
@ mtime
consider any available field except ownership and permission fields
@ all
consider any available field for comparing inodes
@ argon2
argon2 hash algo
@ md5
MD5 algorithm.
@ none
no hashing algorithm
@ sha1
SHA1 algorithm.
@ sha512
SHA-512 algorithm.
are defined here basic integer types that tend to be portable
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47