Disk ARchive 2.7.16
Full featured and portable backup and archiving tool
Public Member Functions | Protected Member Functions | List of all members
libdar::entrepot_libcurl Class Reference

for managing archive into a remote repository More...

#include <entrepot_libcurl.hpp>

+ Inheritance diagram for libdar::entrepot_libcurl:
+ Collaboration diagram for libdar::entrepot_libcurl:

Public Member Functions

 entrepot_libcurl (const std::shared_ptr< user_interaction > &dialog, mycurl_protocol proto, const std::string &login, const secu_string &password, const std::string &host, const std::string &port, bool auth_from_file, const std::string &sftp_pub_keyfile, const std::string &sftp_prv_keyfile, const std::string &sftp_known_hosts, U_I waiting_time, bool verbose=false)
 
 entrepot_libcurl (const entrepot_libcurl &ref)=default
 
 entrepot_libcurl (entrepot_libcurl &&ref) noexcept=default
 
entrepot_libcurloperator= (const entrepot_libcurl &ref)=default
 
entrepot_libcurloperator= (entrepot_libcurl &&ref) noexcept=default
 
virtual void set_location (const path &chemin) override
 defines the directory where to proceed to future open() – this is a "chdir" semantics More...
 
virtual void set_root (const path &p_root) override
 defines the root to use if set_location is given a relative path More...
 
virtual path get_full_path () const override
 returns the full path of location More...
 
virtual std::string get_url () const override
 
virtual const pathget_location () const override
 
virtual const pathget_root () const override
 
virtual void read_dir_reset () const override
 routines to read existing files in the current directory (see set_location() / set_root() methods) More...
 
virtual bool read_dir_next (std::string &filename) const override
 
virtual entrepotclone () const override
 generate a clone of "this" More...
 
- Public Member Functions inherited from libdar::entrepot
 entrepot ()
 constructor
 
 entrepot (const entrepot &ref)=default
 copy constructor
 
 entrepot (entrepot &&ref) noexcept=default
 move constructor
 
entrepotoperator= (const entrepot &ref)=default
 assignment operator
 
entrepotoperator= (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 More...
 
virtual void set_location (const path &chemin)
 defines the directory where to proceed to future open() – this is a "chdir" semantics More...
 
virtual void set_root (const path &p_root)
 defines the root to use if set_location is given a relative path More...
 
virtual path get_full_path () const
 returns the full path of location More...
 
virtual std::string get_url () const =0
 full path of current directory + anything necessary to provide URL formated information More...
 
void set_user_ownership (const std::string &x_user)
 set default ownership for files to be created thanks to the open() methods More...
 
void set_group_ownership (const std::string &x_group)
 
virtual const pathget_location () const
 
virtual const pathget_root () const
 
const std::string & get_user_ownership () const
 
const std::string & get_group_ownership () const
 
fichier_globalopen (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 More...
 
virtual void read_dir_reset () const =0
 routines to read existing files in the current directory (see set_location() / set_root() methods) More...
 
virtual bool read_dir_next (std::string &filename) const =0
 
void unlink (const std::string &filename) const
 
virtual entrepotclone () const =0
 generate a clone of "this" More...
 

Protected Member Functions

virtual fichier_globalinherited_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 override
 
virtual void inherited_unlink (const std::string &filename) const override
 
virtual void read_dir_flush () override
 
virtual fichier_globalinherited_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
 

Detailed Description

for managing archive into a remote repository

Definition at line 49 of file entrepot_libcurl.hpp.

Constructor & Destructor Documentation

◆ entrepot_libcurl()

libdar::entrepot_libcurl::entrepot_libcurl ( const std::shared_ptr< user_interaction > &  dialog,
mycurl_protocol  proto,
const std::string &  login,
const secu_string password,
const std::string &  host,
const std::string &  port,
bool  auth_from_file,
const std::string &  sftp_pub_keyfile,
const std::string &  sftp_prv_keyfile,
const std::string &  sftp_known_hosts,
U_I  waiting_time,
bool  verbose = false 
)
Parameters
dialogfor user interaction
protonetwork protocol to use
loginuser login on remote host
passworduser password on remote host (empty for file auth or user interaction)
hostthe remote server to connect to
portTCP/UDP port to connec to (empty string for default)
auth_from_filewhether to check $HOME/.netrc for password
sftp_pub_keyfilewhere to fetch the public key (sftp only)
sftp_prv_keyfilewhere to fetch the private key (sftp only)
sftp_known_hostslocation of the known_hosts file (empty string to disable this security check)
waiting_timetime in second to wait before retrying in case of network error
verbosewhether to have verbose messages from libcurl

Referenced by clone().

◆ ~entrepot_libcurl()

libdar::entrepot_libcurl::~entrepot_libcurl ( )
throw (
)
inline

Definition at line 70 of file entrepot_libcurl.hpp.

Member Function Documentation

◆ clone()

virtual entrepot * libdar::entrepot_libcurl::clone ( ) const
inlineoverridevirtual

generate a clone of "this"

Deprecated:
this method will disapear in the future it is only kept there to allow the APIv5 adaptation layer to work over APIv6

Implements libdar::entrepot.

Definition at line 85 of file entrepot_libcurl.hpp.

References entrepot_libcurl().

◆ get_full_path()

virtual path libdar::entrepot_libcurl::get_full_path ( ) const
overridevirtual

returns the full path of location

Note
this is equivalent to get_root()/get_location() if get_location() is relative path else get_location()

Reimplemented from libdar::entrepot.

◆ get_location()

virtual const path & libdar::entrepot_libcurl::get_location ( ) const
overridevirtual

Reimplemented from libdar::entrepot.

◆ get_root()

virtual const path & libdar::entrepot_libcurl::get_root ( ) const
overridevirtual

Reimplemented from libdar::entrepot.

◆ get_url()

virtual std::string libdar::entrepot_libcurl::get_url ( ) const
overridevirtual
Note
this is expected to have a double slash after the host:port like ftp://www.some.where:8021//tmp/sub/dir5A

Implements libdar::entrepot.

◆ inherited_open()

virtual fichier_global * libdar::entrepot_libcurl::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
overrideprotectedvirtual

Implements libdar::entrepot.

◆ inherited_unlink()

virtual void libdar::entrepot_libcurl::inherited_unlink ( const std::string &  filename) const
overrideprotectedvirtual

Implements libdar::entrepot.

◆ read_dir_flush()

virtual void libdar::entrepot_libcurl::read_dir_flush ( )
overrideprotectedvirtual

Implements libdar::entrepot.

◆ read_dir_next()

virtual bool libdar::entrepot_libcurl::read_dir_next ( std::string &  filename) const
overridevirtual

Implements libdar::entrepot.

◆ read_dir_reset()

virtual void libdar::entrepot_libcurl::read_dir_reset ( ) const
overridevirtual

routines to read existing files in the current directory (see set_location() / set_root() methods)

Implements libdar::entrepot.

◆ set_location()

virtual void libdar::entrepot_libcurl::set_location ( const path chemin)
overridevirtual

defines the directory where to proceed to future open() – this is a "chdir" semantics

Reimplemented from libdar::entrepot.

◆ set_root()

virtual void libdar::entrepot_libcurl::set_root ( const path p_root)
overridevirtual

defines the root to use if set_location is given a relative path

Reimplemented from libdar::entrepot.


The documentation for this class was generated from the following file: