Loading...
Searching...
No Matches
entrepot_libcurl.hpp
Go to the documentation of this file.
/*********************************************************************/
// dar - disk archive - a backup/restoration program
// Copyright (C) 2002-2025 Denis Corbin
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// to contact the author, see the AUTHOR file
/*********************************************************************/
#ifndef ENTREPOT_LIBCURL_HPP
#define ENTREPOT_LIBCURL_HPP
#include "../my_config.h"
extern "C"
{
}
#include <string>
#include <deque>
#include "entrepot.hpp"
#include "secu_string.hpp"
#include "mycurl_protocol.hpp"
namespace libdar
{
class entrepot_libcurl : public entrepot
{
public:
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_libcurl & operator = (const entrepot_libcurl & ref) = default;
entrepot_libcurl & operator = (entrepot_libcurl && ref) noexcept = default;
~entrepot_libcurl() throw () {};
// inherited from class entrepot
virtual void set_location(const path & chemin) override;
virtual void set_root(const path & p_root) override;
virtual path get_full_path() const override;
virtual std::string get_url() const override;
virtual const path & get_location() const override;
virtual const path & get_root() const override;
virtual void read_dir_reset() const override;
virtual bool read_dir_next(std::string & filename) const override;
virtual entrepot *clone() const override { return new (std::nothrow) entrepot_libcurl(*this); };
protected:
// inherited from class entrepot
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() override;
private:
#if defined ( LIBCURL_AVAILABLE ) && defined ( LIBTHREADAR_AVAILABLE )
class i_entrepot_libcurl;
std::shared_ptr<i_entrepot_libcurl> pimpl;
#endif
};
} // end of namespace
#endif
libdar::entrepot_libcurl
for managing archive into a remote repository
Definition entrepot_libcurl.hpp:50
libdar::entrepot_libcurl::read_dir_reset
virtual void read_dir_reset() const override
routines to read existing files in the current directory (see set_location() / set_root() methods)
libdar::entrepot_libcurl::get_full_path
virtual path get_full_path() const override
returns the full path of location
libdar::entrepot_libcurl::set_root
virtual void set_root(const path &p_root) override
defines the root to use if set_location is given a relative path
libdar::entrepot_libcurl::set_location
virtual void set_location(const path &chemin) override
defines the directory where to proceed to future open() – this is a "chdir" semantics
libdar::entrepot_libcurl::clone
virtual entrepot * clone() const override
generate a clone of "this"
Definition entrepot_libcurl.hpp:85
libdar::entrepot_libcurl::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)
libdar::entrepot_libcurl::get_url
virtual std::string get_url() const override
libdar::entrepot
the Entrepot interface
Definition entrepot.hpp:56
libdar::fichier_global
abstraction of filesystem files for entrepot
Definition fichier_global.hpp:59
libdar::path
the class path is here to manipulate paths in the Unix notation: using'/'
Definition path.hpp:51
libdar::secu_string
class secu_string
Definition secu_string.hpp:54
entrepot.hpp
defines the entrepot interface.
libdar::mycurl_protocol
mycurl_protocol
libcurl protocols supported by libdar
Definition mycurl_protocol.hpp:49
libdar::gf_mode
gf_mode
generic_file openning modes
Definition gf_mode.hpp:44
my_config.h
include macro defined by the configure script and some specific additional ones
mycurl_protocol.hpp
datastructure defining the network protocols available for entrepot_libcurl class
libdar
libdar namespace encapsulate all libdar symbols
Definition archive.hpp:47
secu_string.hpp
this file contains the definition of secu_string class, a std::string like class but allocated in sec...