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
69 extern std::string hash_algo_to_string(
hash_algo algo);
71 class hash_fichier :
public fichier_global
84 hash_fichier(user_interaction & dialog,
85 fichier_global *under,
86 const std::string & under_filename,
87 fichier_global *hash_file,
91 hash_fichier(
const hash_fichier & ref) : fichier_global(ref) {
throw SRC_BUG; };
94 const hash_fichier & operator = (
const hash_fichier & ref) {
throw SRC_BUG; };
100 void change_ownership(
const std::string & user,
const std::string & group) {
if(ref ==
nullptr || hash_ref ==
nullptr)
throw SRC_BUG; ref->change_ownership(user, group); hash_ref->change_ownership(user, group); };
101 void change_permission(U_I perm) {
if(ref ==
nullptr || hash_ref ==
nullptr)
throw SRC_BUG; ref->change_permission(perm); hash_ref->change_permission(perm); };
102 infinint get_size()
const {
if(ref ==
nullptr)
throw SRC_BUG;
return ref->get_size(); };
103 void fadvise(advise adv)
const {
if(ref ==
nullptr)
throw SRC_BUG; ref->fadvise(adv); };
106 bool skippable(skippability direction,
const infinint & amount) {
return false; };
107 bool skip(
const infinint & pos) {
if(ref ==
nullptr || pos != ref->get_position())
throw SRC_BUG;
else return true; };
109 bool skip_relative(S_I x) {
if(x != 0)
throw SRC_BUG;
else return true; };
110 infinint get_position()
const {
if(ref ==
nullptr)
throw SRC_BUG;
return ref->get_position(); };
113 void set_only_hash() { only_hash =
true; };
117 void inherited_read_ahead(
const infinint & amount) { ref->read_ahead(amount); };
118 U_I fichier_global_inherited_write(
const char *a, U_I size);
119 bool fichier_global_inherited_read(
char *a, U_I size, U_I & read, std::string & message);
122 void inherited_sync_write() {};
123 void inherited_flush_read() {};
124 void inherited_terminate();
128 fichier_global *hash_ref;
131 gcry_md_hd_t hash_handle;
133 std::string ref_filename;
are defined here basic integer types that tend to be portable
class generic_file is defined here as well as class fichierthe generic_file interface is widely used ...
class fichier_global definition. This class is a pure virtual class class fichier_global is an abstra...
gf_mode get_mode() const
retreive the openning mode for this object
libdar namespace encapsulate all libdar symbols