36#include "../my_config.h"
98 void set_group_ownership(
const std::string & x_group) { group = x_group; };
100 virtual const path & get_location()
const {
return where; };
104 const std::string & get_group_ownership()
const {
return group; };
120 const std::string & filename,
122 bool force_permission,
127 bool provide_a_plain_file =
true)
const;
178 virtual void create_dir(
const std::string & dirname, U_I permission) = 0;
181 void unlink(
const std::string & filename)
const { inherited_unlink(filename); };
191 const std::string & filename,
193 bool force_permission,
199 virtual void inherited_unlink(
const std::string & filename)
const = 0;
set of datastructures used to interact with a catalogue object
fichier_global * open(const std::shared_ptr< user_interaction > &dialog, const std::string &filename, gf_mode mode, bool force_permission, U_I permission, bool fail_if_exists, bool erase, hash_algo algo, bool provide_a_plain_file=true) const
defines the way to open a file and return a "class fichier_global" object as last argument upon succe...
virtual void change_user_interaction(const std::shared_ptr< user_interaction > &new_dialog)
change user_interaction if the implementation recorded it (at construction time for example)
virtual path get_full_path() const
returns the full path of location
virtual void read_dir_flush() const =0
ends the read_dir_next, (no more entry available)
virtual void read_dir_reset() const =0
routines to read existing files in the current directory (see set_location() / set_root() methods)
entrepot(entrepot &&ref) noexcept=default
move constructor
entrepot(const entrepot &ref)=default
copy constructor
virtual void set_location(const path &chemin)
defines the directory where to proceed to future open() – this is a "chdir" semantics
bool operator==(const entrepot &ref) const
says whether two entrepot objects points to the same location
virtual void create_dir(const std::string &dirname, U_I permission)=0
create a new directory in the current directory
virtual fichier_global * inherited_open(const std::shared_ptr< user_interaction > &dialog, const std::string &filename, gf_mode mode, bool force_permission, U_I permission, bool fail_if_exists, bool erase) const =0
void set_user_ownership(const std::string &x_user)
set default ownership for files to be created thanks to the open() or create_dir() methods
virtual ~entrepot()=default
destructor
entrepot & operator=(const entrepot &ref)=default
assignment operator
virtual std::string get_url() const =0
full path of current directory + anything necessary to provide URL formated information
virtual void set_root(const path &p_root)
defines the root to use if set_location is given a relative path
virtual const path & get_root() const
retreives relative to root path the current location points to
virtual void read_dir_reset_dirinfo() const =0
routines to read existing files with dir information
virtual bool read_dir_next_dirinfo(std::string &filename, inode_type &tp) const =0
alternative to the method read_dir_next, should be implemented also
virtual std::shared_ptr< user_interaction > get_current_user_interaction() const
get the current user_interaction if the implementation reocrded it at construction time (may be nullp...
const std::string & get_user_ownership() const
retrieves the given root location
virtual bool read_dir_next(std::string &filename) const =0
read the next filename of the current directory
void unlink(const std::string &filename) const
remove the target file from the entrepot
virtual entrepot * clone() const =0
done this way for homogeneity with open/inherited_open
abstraction of filesystem files for entrepot
the class path is here to manipulate paths in the Unix notation: using'/'
set of datastructures used to interact with entrepot objects
generic modes to open file
hash_algo
hashing algorithm available
gf_mode
generic_file openning modes
libdar namespace encapsulate all libdar symbols
here is the definition of the path class
defines the interaction interface between libdar and users.