Disk ARchive  2.6.1
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-2019 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 //
19 // to contact the author : http://dar.linux.free.fr/email.html
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  };
69 
71  extern std::string hash_algo_to_string(hash_algo algo);
72 
74 
78  extern bool string_to_hash_algo(const std::string & arg, hash_algo & val);
79 
81  extern U_I hash_algo_to_gcrypt_hash(hash_algo algo);
82 
84  extern unsigned char hash_algo_to_char(hash_algo algo);
85 
87 
89  extern hash_algo char_to_hash_algo(unsigned char arg);
90 
92 
93 } // end of namespace
94 
95 #endif
comparison_fields
how to consider file change during comparison and incremental backup
Definition: archive_aux.hpp:52
hash_algo char_to_hash_algo(unsigned char arg)
convert char to hash_algo
U_I hash_algo_to_gcrypt_hash(hash_algo algo)
convert hash value to libgcrypt hash value
are defined here basic integer types that tend to be portable
std::string hash_algo_to_string(hash_algo algo)
convert hash value to human readable string
consider any available field except ownership and permission fields
SHA1 algorithm.
consider any available field for comparing inodes
only consider the file type
unsigned char hash_algo_to_char(hash_algo algo)
convert hash value to char value
SHA-512 algorithm.
consider any available field except ownership fields
no hashing algorithm
default behavior since release 2.6.0 resave only if file size of mtime changed
modified_data_detection
how to detect data has changed when some fields
Definition: archive_aux.hpp:43
MD5 algorithm.
hash_algo
hashing algorithm available
Definition: archive_aux.hpp:62
historical behavior, resave an inode on any metadata change
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:46
bool string_to_hash_algo(const std::string &arg, hash_algo &val)
convert string to hash algorithm