![]() |
Disk ARchive 2.8.0
Full featured and portable backup and archiving tool
|
#include <entrepot_libssh.hpp>
Public Member Functions | |
entrepot_libssh (const std::shared_ptr< user_interaction > &dialog, 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) | |
constructor More... | |
entrepot_libssh (const entrepot_libssh &ref) | |
entrepot_libssh (entrepot_libssh &&ref) noexcept=delete | |
entrepot_libssh & | operator= (const entrepot_libssh &ref)=delete |
entrepot_libssh & | operator= (entrepot_libssh &&ref) noexcept=delete |
virtual std::string | get_url () const override |
full path of current directory + anything necessary to provide URL formated information More... | |
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 |
read the next filename of the current directory More... | |
virtual void | read_dir_reset_dirinfo () const override |
routines to read existing files with dir information More... | |
virtual bool | read_dir_next_dirinfo (std::string &filename, inode_type &tp) const override |
alternative to the method read_dir_next, should be implemented also More... | |
virtual void | create_dir (const std::string &dirname, U_I permission) override |
create a new directory in the current directory More... | |
virtual entrepot * | clone () const override |
done this way for homogeneity with open/inherited_open More... | |
![]() | |
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 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() or create_dir() methods More... | |
void | set_group_ownership (const std::string &x_group) |
virtual const path & | get_location () const |
virtual const path & | get_root () const |
retreives relative to root path the current location points to More... | |
const std::string & | get_user_ownership () const |
retrieves the given root location More... | |
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 More... | |
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) More... | |
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 nullptr if not) 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 |
read the next filename of the current directory More... | |
virtual void | read_dir_reset_dirinfo () const =0 |
routines to read existing files with dir information More... | |
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 More... | |
virtual void | create_dir (const std::string &dirname, U_I permission)=0 |
create a new directory in the current directory More... | |
void | unlink (const std::string &filename) const |
remove the target file from the entrepot More... | |
virtual entrepot * | clone () const =0 |
done this way for homogeneity with open/inherited_open More... | |
![]() | |
mem_ui (const std::shared_ptr< user_interaction > &dialog) | |
constructor More... | |
mem_ui (const mem_ui &ref)=default | |
the copy constructor More... | |
mem_ui (mem_ui &&ref) noexcept=default | |
the move constructor | |
mem_ui & | operator= (const mem_ui &ref)=default |
assignement operator More... | |
mem_ui & | operator= (mem_ui &&ref) noexcept=default |
move operator | |
virtual | ~mem_ui () noexcept(false) |
destructor More... | |
Protected Member Functions | |
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 override |
virtual void | inherited_unlink (const std::string &filename) const override |
virtual void | read_dir_flush () const override |
ends the read_dir_next, (no more entry available) More... | |
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 () const =0 |
ends the read_dir_next, (no more entry available) More... | |
![]() | |
user_interaction & | get_ui () const |
get access to the user_interaction object More... | |
std::shared_ptr< user_interaction > | get_pointer () const |
get access to the shared_ptr pointing to the user_interaction More... | |
void | change_ui (const std::shared_ptr< user_interaction > &new_dialog) |
change the user_interaction object More... | |
implementation for SFTP entrepot unsing libssh backend
entrepot_libssh generates objects of class "fichier_libssh" inherited class of fichier_global
Definition at line 57 of file entrepot_libssh.hpp.
libdar::entrepot_libssh::entrepot_libssh | ( | const std::shared_ptr< user_interaction > & | dialog, |
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 |
||
) |
constructor
dialog | for user interaction |
login | user login on remote host |
password | user password on remote host (empty for file auth or user interaction) |
host | the remote server to connect to |
port | TCP/UDP port to connec to (empty string for default) |
auth_from_file | if true, use private/public key authentication and password is then the key pass, else use password authentication |
sftp_pub_keyfile | where to fetch the public key (sftp only) |
sftp_prv_keyfile | where to fetch the private key (sftp only) |
sftp_known_hosts | location of the known_hosts file (empty string to disable this security check) |
waiting_time | time in second to wait before retrying in case of network error |
verbose | whether to have verbose messages from libcurl |
Referenced by clone().
|
inlinenoexcept |
Definition at line 80 of file entrepot_libssh.hpp.
|
inlineoverridevirtual |
done this way for homogeneity with open/inherited_open
generate a clone of "this"
Implements libdar::entrepot.
Definition at line 91 of file entrepot_libssh.hpp.
References entrepot_libssh().
|
overridevirtual |
create a new directory in the current directory
[in] | dirname | is the name of the subdirectory to create (not its path!) It is created in as sub-directory of the directory given to set_location() |
[in] | permission | is the usual POSIX user/group/other permission bits to set to the directory to create |
Implements libdar::entrepot.
|
overridevirtual |
full path of current directory + anything necessary to provide URL formated information
Implements libdar::entrepot.
|
overrideprotectedvirtual |
Implements libdar::entrepot.
|
overrideprotectedvirtual |
Implements libdar::entrepot.
|
overrideprotectedvirtual |
ends the read_dir_next, (no more entry available)
Implements libdar::entrepot.
|
overridevirtual |
read the next filename of the current directory
[out] | filename | name of the next entry in the directory, (valid only if this method returned true) |
Implements libdar::entrepot.
|
overridevirtual |
alternative to the method read_dir_next, should be implemented also
[out] | filename | name of the next entry in the directory, (valid only if this method returned true) |
[out] | tp | gives the nature of the entry |
Implements libdar::entrepot.
|
overridevirtual |
routines to read existing files in the current directory (see set_location() / set_root() methods)
[in] | dir_details,if | set to true, use read_dir_next() with the isdir argument, else use the read_dir_next() with a single argument. By default and for backward compatibility dir_details is set to false. |
Implements libdar::entrepot.
|
overridevirtual |
routines to read existing files with dir information
to be used before calling read_dir_next_dirinfo().
Implements libdar::entrepot.