27 #ifndef FICHIER_LOCAL_HPP 28 #define FICHIER_LOCAL_HPP 31 #include "../my_config.h" 60 fichier_local(
const std::shared_ptr<user_interaction> & dialog,
61 const std::string & chemin,
71 fichier_local(
const std::string & chemin,
bool furtive_mode =
false);
90 virtual void change_ownership(
const std::string & user,
const std::string & group)
override;
102 virtual bool skippable(skippability direction,
const infinint & amount)
override {
return true; };
128 void open(
const std::string & chemin,
137 void detruit() {
if(filedesc >= 0) close(filedesc); filedesc = -1; };
138 int advise_to_int(
advise arg)
const;
~fichier_local()
destructor
virtual void fadvise(advise adv) const override
set posix_fadvise for the whole file
virtual bool skip_relative(S_I x) override
skip relatively to the current position
are defined here basic integer types that tend to be portable
virtual bool skippable(skippability direction, const infinint &amount) override
whether the implementation is able to skip
virtual void change_ownership(const std::string &user, const std::string &group) override
set the ownership of the file
virtual void inherited_read_ahead(const infinint &amount) override
tells the object that several calls to read() will follow to probably obtain at least the given amoun...
virtual U_I fichier_global_inherited_write(const char *a, U_I size) override
replaces generic_file::inherited_write() method, to allow the return of partial writings ...
fichier_global(const std::shared_ptr< user_interaction > &dialog, gf_mode mode)
constructor
virtual bool skip_to_eof() override
skip to the end of file
gf_mode
generic_file openning modes
virtual void inherited_flush_read() override
reset internal engine, flush caches in order to read the data at current position ...
defines the interaction interface between libdar and users.
virtual void inherited_terminate() override
destructor-like call, except that it is allowed to throw exceptions
fichier_local(const std::shared_ptr< user_interaction > &dialog, const std::string &chemin, gf_mode m, U_I permission, bool fail_if_exists, bool erase, bool furtive_mode)
full featured constructors
class fichier_global definition. This class is a pure virtual class class fichier_global is an abstra...
abstraction of filesystem files for entrepot
virtual void change_permission(U_I perm) override
change the permission of the file
fichier_local & operator=(const fichier_local &ref)
assignment operator
virtual U_I read(char *a, U_I size) override
read data from the generic_file inherited from proto_generic_file
virtual bool fichier_global_inherited_read(char *a, U_I size, U_I &read, std::string &message) override
replaces generic_file::inherited_read() method, to allow the return of partial reading ...
virtual infinint get_position() const override
get the current read/write position
fichier_local(fichier_local &&ref) noexcept
move constructor
virtual infinint get_size() const override
return the size of the file
virtual bool skip(const infinint &pos) override
skip at the absolute position
the arbitrary large positive integer class
void fsync() const
sync the data to disk
application will not read the data in near future
virtual void inherited_sync_write() override
write down any pending data
S_I give_fd_and_terminate()
provide the low level filedescriptor to the call and terminate()
fichier_local(const fichier_local &ref)
copy constructor
void terminate()
destructor-like call, except that it is allowed to throw exceptions
fichier_global & operator=(const fichier_global &ref)=default
assignment operator
libdar namespace encapsulate all libdar symbols