| Disk ARchive 2.8.5 Full featured and portable backup and archiving tool

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
libdar::entrepot_libcurl Class Reference
API

for managing archive into a remote repository More...

`#include <entrepot_libcurl.hpp>`

Inherits libdar::entrepot.

## Public Member Functions
| entrepot_libcurl (const std::shared_ptr< user_interaction > &dialog, remote_entrepot_type 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_libcurl & | operator= (const entrepot_libcurl &ref)=default
entrepot_libcurl & | operator= (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
virtual void | set_root (const path &p_root) override
| defines the root to use if set_location is given a relative path
virtual path | get_full_path () const override
| returns the full path of location
virtual std::string | get_url () const override
virtual const path & | get_location () const override
virtual const path & | get_root () const override
| retreives relative to root path the current location points to
virtual void | change_user_interaction (const std::shared_ptr< user_interaction > &new_dialog) override
| change user_interaction if the implementation recorded it (at construction time for example)
virtual std::shared_ptr< user_interaction > | get_current_user_interaction () const override
| get the current user_interaction if the implementation reocrded it at construction time (may be nullptr if not)
virtual void | read_dir_reset () const override
| routines to read existing files in the current directory (see set_location() / set_root() methods)
virtual bool | read_dir_next (std::string &filename) const override
| read the next filename of the current directory
virtual void | read_dir_reset_dirinfo () const override
| routines to read existing files with dir information
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
virtual void | create_dir (const std::string &dirname, U_I permission) override
| create a new directory in the current directory
virtual entrepot * | clone () const override
| done this way for homogeneity with open/inherited_open
Public Member Functions inherited from libdar::entrepot
| 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
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
void | set_group_ownership (const std::string &x_group)
const std::string & | get_user_ownership () const
| retrieves the given root location
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
void | unlink (const std::string &filename) const
| remove the target file from the entrepot

## 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)

## 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,
|  | remote_entrepot_type | 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

  dialog | for user interaction
  proto | network protocol to use
  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 | whether to check $HOME/.netrc for password
  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

References entrepot_libcurl().

Referenced by clone(), and entrepot_libcurl().

## ◆ ~entrepot_libcurl()

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

Definition at line 70 of file entrepot_libcurl.hpp.

## Member Function Documentation

## ◆ change_user_interaction()

virtual void libdar::entrepot_libcurl::change_user_interaction | ( | const std::shared_ptr< user_interaction > & | new_dialog | ) |
| override virtual

change user_interaction if the implementation recorded it (at construction time for example)

Note
  method open() just above uses the specified user_interaction provided as its first argument

Reimplemented from libdar::entrepot.

## ◆ clone()

virtual entrepot * libdar::entrepot_libcurl::clone | ( |  | ) | const
| inline override virtual

done this way for homogeneity with open/inherited_open

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 92 of file entrepot_libcurl.hpp.

References libdar::entrepot::entrepot(), and entrepot_libcurl().

## ◆ create_dir()

virtual void libdar::entrepot_libcurl::create_dir | ( | const std::string & | dirname,
|  | U_I | permission )
| override virtual

create a new directory in the current directory

Parameters

  [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

Note
  the operation fails if an entry of that name already exists
  the implementation should set the user and group ownership according to the argument provided to set_user_ownership() and set_group_ownership(), if this feature is supported in the underlying implementation

Implements libdar::entrepot.

## ◆ get_current_user_interaction()

virtual std::shared_ptr< user_interaction > libdar::entrepot_libcurl::get_current_user_interaction | ( |  | ) | const
| override virtual

get the current user_interaction if the implementation reocrded it at construction time (may be nullptr if not)

Reimplemented from libdar::entrepot.

## ◆ get_full_path()

virtual path libdar::entrepot_libcurl::get_full_path | ( |  | ) | const
| override virtual

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
| override virtual

Reimplemented from libdar::entrepot.

## ◆ get_root()

virtual const path & libdar::entrepot_libcurl::get_root | ( |  | ) | const
| override virtual

retreives relative to root path the current location points to

Reimplemented from libdar::entrepot.

## ◆ get_url()

virtual std::string libdar::entrepot_libcurl::get_url | ( |  | ) | const
| override virtual

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
| override protected virtual

Implements libdar::entrepot.

## ◆ inherited_unlink()

virtual void libdar::entrepot_libcurl::inherited_unlink | ( | const std::string & | filename | ) | const
| override protected virtual

Implements libdar::entrepot.

## ◆ read_dir_flush()

virtual void libdar::entrepot_libcurl::read_dir_flush | ( |  | ) | const
| override protected virtual

ends the read_dir_next, (no more entry available)

Implements libdar::entrepot.

## ◆ read_dir_next()

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

read the next filename of the current directory

Parameters

  [out] | filename | name of the next entry in the directory, (valid only if this method returned true)

Returns
  false if no more filename could be fould

Note
  either use read_dir_reset() followed by read_dir_next() calls, or call read_dir_reset_dirinfo() followed by read_dir_next_dirinfo() calls

Implements libdar::entrepot.

## ◆ read_dir_next_dirinfo()

virtual bool libdar::entrepot_libcurl::read_dir_next_dirinfo | ( | std::string & | filename,
|  | inode_type & | tp ) const
| override virtual

alternative to the method read_dir_next, should be implemented also

Parameters

  [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

Note
  a call to read_dir_reset_dirinfo() should be done before the first call to this method
  either use read_dir_reset() followed by read_dir_next() calls, or call read_dir_reset_dirinfo() followed by read_dir_next_dirinfo() calls

Implements libdar::entrepot.

## ◆ read_dir_reset()

virtual void libdar::entrepot_libcurl::read_dir_reset | ( |  | ) | const
| override virtual

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

Parameters

  [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.

## ◆ read_dir_reset_dirinfo()

virtual void libdar::entrepot_libcurl::read_dir_reset_dirinfo | ( |  | ) | const
| override virtual

routines to read existing files with dir information

to be used before calling read_dir_next_dirinfo().

Note
  after calling read_dir_reset_dirinfo() calling read_dir_next() gives undefined result, you first need to call read_dir_reset() or continue using read_dir_next_dirinfo()

Implements libdar::entrepot.

## ◆ set_location()

virtual void libdar::entrepot_libcurl::set_location | ( | const path & | chemin | ) |
| override virtual

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 | ) |
| override virtual

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:

- entrepot_libcurl.hpp