the Entrepot interface
More...
#include <entrepot.hpp>
Inherited by libdar::entrepot_libcurl, and libdar::entrepot_local.
|
| entrepot () |
| constructor
|
|
| entrepot (const entrepot &ref)=default |
| copy constructor
|
|
| entrepot (entrepot &&ref) noexcept=default |
| move constructor
|
|
entrepot & | operator= (const entrepot &ref)=default |
| assignment operator
|
|
entrepot & | operator= (entrepot &&ref) noexcept=default |
| move operator
|
|
virtual | ~entrepot ()=default |
| destructor
|
|
bool | operator== (const entrepot &ref) const |
| says whether two entrepot objects points to the same location
|
|
virtual void | set_location (const path &chemin) |
| defines the directory where to proceed to future open() – this is a "chdir" semantics
|
|
virtual void | set_root (const path &p_root) |
| defines the root to use if set_location is given a relative path
|
|
virtual path | get_full_path () const |
| returns the full path of location
|
|
virtual std::string | get_url () const =0 |
| full path of current directory + anything necessary to provide URL formated information
|
|
void | set_user_ownership (const std::string &x_user) |
| set default ownership for files to be created thanks to the open() methods
|
|
void | set_group_ownership (const std::string &x_group) |
|
virtual const path & | get_location () const |
|
virtual const path & | get_root () const |
|
const std::string & | get_user_ownership () const |
|
const std::string & | get_group_ownership () const |
|
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 success
|
|
virtual void | read_dir_reset () const =0 |
| routines to read existing files in the current directory (see set_location() / set_root() methods)
|
|
virtual bool | read_dir_next (std::string &filename) const =0 |
|
void | unlink (const std::string &filename) const |
|
virtual entrepot * | clone () const =0 |
| generate a clone of "this"
|
|
|
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 |
|
virtual void | inherited_unlink (const std::string &filename) const =0 |
|
virtual void | read_dir_flush ()=0 |
|
the Entrepot interface
Definition at line 55 of file entrepot.hpp.
◆ clone()
virtual entrepot * libdar::entrepot::clone |
( |
| ) |
const |
|
pure virtual |
◆ get_full_path()
virtual path libdar::entrepot::get_full_path |
( |
| ) |
const |
|
virtual |
◆ get_group_ownership()
const std::string & libdar::entrepot::get_group_ownership |
( |
| ) |
const |
|
inline |
◆ get_location()
virtual const path & libdar::entrepot::get_location |
( |
| ) |
const |
|
inlinevirtual |
◆ get_root()
virtual const path & libdar::entrepot::get_root |
( |
| ) |
const |
|
inlinevirtual |
◆ get_url()
virtual std::string libdar::entrepot::get_url |
( |
| ) |
const |
|
pure virtual |
◆ get_user_ownership()
const std::string & libdar::entrepot::get_user_ownership |
( |
| ) |
const |
|
inline |
◆ open()
fichier_global * libdar::entrepot::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 success
- Parameters
-
[in] | dialog | for user interaction |
[in] | filename | is the full path+name of the file to open (read/create/write to) |
[in] | mode | defines which way to open the file (read-only, read-write or write-only) |
[in] | force_permission | whether to set the file permission to the value given in the permission argument |
[in] | permission | if force_permission is set, change the file permission to that value |
[in] | fail_if_exists | tells whether the underlying implementation have to fail throwing Erange("exists") if the file already exist when write access is required |
[in] | erase | tells whether the underlying implementation will empty an existing file before writing to it |
[in] | algo | defines the hash file to create, other value than hash_none are accepted only in writeonly mode with erase or fail_if_exist set |
[in] | provide_a_plain_file | if true a plainly seekable object is returned which mimics the available features of a plain file, else a pipe-like object which has limited seek features but which can still record the offset position is returned and is suitable to be used on real named/anonymous pipes (if the provided filename is expected to be of such type for example) |
- Returns
- upon success returns an object from a class inherited from fichier_global that the caller has the duty to delete, else an exception is thrown (most of the time it should be a Esystem object) by the called inherited class
◆ operator==()
bool libdar::entrepot::operator== |
( |
const entrepot & |
ref | ) |
const |
|
inline |
says whether two entrepot objects points to the same location
Definition at line 78 of file entrepot.hpp.
References get_url().
◆ read_dir_reset()
virtual void libdar::entrepot::read_dir_reset |
( |
| ) |
const |
|
pure virtual |
◆ set_group_ownership()
void libdar::entrepot::set_group_ownership |
( |
const std::string & |
x_group | ) |
|
|
inline |
◆ set_location()
virtual void libdar::entrepot::set_location |
( |
const path & |
chemin | ) |
|
|
virtual |
◆ set_root()
virtual void libdar::entrepot::set_root |
( |
const path & |
p_root | ) |
|
|
virtual |
◆ set_user_ownership()
void libdar::entrepot::set_user_ownership |
( |
const std::string & |
x_user | ) |
|
|
inline |
set default ownership for files to be created thanks to the open() methods
Definition at line 96 of file entrepot.hpp.
◆ unlink()
void libdar::entrepot::unlink |
( |
const std::string & |
filename | ) |
const |
|
inline |
◆ group
std::string libdar::entrepot::group |
|
private |
◆ root
path libdar::entrepot::root |
|
private |
◆ user
std::string libdar::entrepot::user |
|
private |
◆ where
path libdar::entrepot::where |
|
private |
The documentation for this class was generated from the following file: