30 #ifndef HASH_FICHIER_HPP
31 #define HASH_FICHIER_HPP
33 #include "../my_config.h"
38 #ifndef GCRYPT_NO_DEPRECATED
39 #define GCRYPT_NO_DEPRECATED
65 extern std::string hash_algo_to_string(
hash_algo algo);
67 class hash_fichier :
public fichier
73 hash_fichier(user_interaction & dialog, S_I fd);
74 hash_fichier(user_interaction & dialog,
const char *name,
gf_mode m, U_I perm,
bool furtive_mode =
false);
75 hash_fichier(user_interaction & dialog,
const std::string & chemin,
gf_mode m, U_I perm,
bool furtive_mode =
false);
76 hash_fichier(
const std::string & chemin,
bool furtive_mode =
false) : fichier(chemin, furtive_mode) {
throw SRC_BUG; };
77 hash_fichier(
const hash_fichier & ref) : fichier(ref) {
throw SRC_BUG; };
80 const hash_fichier & operator = (
const hash_fichier & ref) {
throw SRC_BUG; };
94 void set_hash_file_name(
const std::string & filename,
hash_algo algo,
const std::string & extension);
97 void change_permission(U_I perm) { x_perm = perm; force_perm =
true; fichier::change_permission(perm); };
98 void change_ownership(
const std::string & user,
const std::string & group) { user_ownership = user; group_ownership = group; fichier::change_ownership(user, group); };
102 bool skip(
const infinint & pos) {
if(pos != fichier::get_position())
throw SRC_BUG;
else return true; };
103 bool skip_to_eof() {
throw SRC_BUG; };
104 bool skip_relative(S_I x) {
if(x != 0)
throw SRC_BUG;
else return true; };
107 #ifdef LIBDAR_SPECIAL_ALLOC
108 USE_SPECIAL_ALLOC(hash_fichier);
110 void set_only_hash() { only_hash =
true; };
114 U_I inherited_read(
char *a, U_I size) {
throw SRC_BUG; };
115 void inherited_write(
const char *a, U_I size);
117 void inherited_terminate();
122 std::string hash_filename;
123 std::string hash_extension;
126 std::string user_ownership;
127 std::string group_ownership;
129 gcry_md_hd_t hash_handle;
class fichier definition. This is a full implementation of a generic_file applied to a plain file ...
class generic_file is defined here as well as class fichierthe generic_file interface is widely used ...
gf_mode
generic_file openning modes