27 #ifndef FICHIER_LOCAL_HPP
28 #define FICHIER_LOCAL_HPP
31 #include "../my_config.h"
57 class fichier_local :
public fichier_global
63 fichier_local(user_interaction & dialog,
64 const std::string & chemin,
70 fichier_local(
const std::string & chemin,
bool furtive_mode =
false);
71 fichier_local(
const fichier_local & ref) : fichier_global(ref) { copy_from(ref); };
74 const fichier_local & operator = (
const fichier_local & ref) { detruit(); copy_parent_from(ref); copy_from(ref);
return *
this; };
77 ~fichier_local() { detruit(); };
81 virtual void change_ownership(
const std::string & user,
const std::string & group);
84 virtual void change_permission(U_I perm);
87 infinint get_size()
const;
90 void fadvise(advise adv)
const;
93 bool skippable(skippability direction,
const infinint & amount) {
return true; };
94 bool skip(
const infinint & pos);
96 bool skip_relative(S_I x);
97 infinint get_position()
const;
102 S_I give_fd_and_terminate() {
int ret = filedesc; filedesc = -1;
terminate();
return ret; };
106 void inherited_read_ahead(
const infinint & amount) { fadvise(fichier_global::advise_sequential); };
107 void inherited_sync_write() { fsync(); };
108 void inherited_flush_read() {};
109 void inherited_terminate() {
if(adv == advise_dontneed) fadvise(adv); };
112 U_I fichier_global_inherited_write(
const char *a, U_I size);
113 bool fichier_global_inherited_read(
char *a, U_I size, U_I & read, std::string & message);
119 void open(
const std::string & chemin,
126 void copy_from(
const fichier_local & ref);
127 void copy_parent_from(
const fichier_local & ref);
128 void detruit() {
if(filedesc >= 0) close(filedesc); filedesc = -1; };
129 int advise_to_int(advise arg)
const;
class mem_ui definition. This class is to be used as parent class to handle user_interaction object m...
are defined here basic integer types that tend to be portable
class crc definition, used to handle Cyclic Redundancy Checks
define the datastructure "label" used to identify slice membership to an archive
gf_mode
generic_file openning modes
void terminate() const
destructor-like call, except that it is allowed to throw exceptions
defines the interaction between libdar and the user.Three classes are defined
class fichier_global definition. This class is a pure virtual class class fichier_global is an abstra...
to be able to cancel libdar operation while running in a given thread.the class thread_cancellation i...
libdar namespace encapsulate all libdar symbols