26#ifndef I_ENTREPOT_LIBCURL_HPP
27#define I_ENTREPOT_LIBCURL_HPP
55#if defined ( LIBCURL_AVAILABLE ) && defined ( LIBTHREADAR_AVAILABLE )
57 class entrepot_libcurl::i_entrepot_libcurl :
public entrepot,
public mem_ui
60 i_entrepot_libcurl(
const std::shared_ptr<user_interaction> & dialog,
61 mycurl_protocol proto,
62 const std::string & login,
63 const secu_string & password,
64 const std::string & host,
65 const std::string & port,
67 const std::string & sftp_pub_keyfile,
68 const std::string & sftp_prv_keyfile,
69 const std::string & sftp_known_hosts,
73 i_entrepot_libcurl(
const i_entrepot_libcurl & ref) =
default;
74 i_entrepot_libcurl(i_entrepot_libcurl && ref) =
default;
75 i_entrepot_libcurl & operator = (
const i_entrepot_libcurl & ref) =
delete;
76 i_entrepot_libcurl & operator = (i_entrepot_libcurl && ref)
noexcept =
delete;
77 ~i_entrepot_libcurl() throw () {};
84 virtual std::string get_url()
const override {
return base_URL + get_full_path().display_without_root(); };
85 virtual void read_dir_reset()
const override;
86 virtual bool read_dir_next(std::string & filename)
const override;
87 virtual entrepot *clone()
const override {
return new (std::nothrow) i_entrepot_libcurl(*
this); };
93 virtual fichier_global *inherited_open(
const std::shared_ptr<user_interaction> & dialog,
94 const std::string & filename,
96 bool force_permission,
99 bool erase)
const override;
101 virtual void inherited_unlink(
const std::string & filename)
const override;
102 virtual void read_dir_flush()
override;
105 mycurl_protocol x_proto;
106 std::string base_URL;
107 mycurl_easyhandle_sharing easyh;
108 std::deque<std::string> current_dir;
109 std::string reading_dir_tmp;
113 std::string get_libcurl_URL()
const;
114 void set_libcurl_authentication(user_interaction & dialog,
115 const std::string & location,
116 const std::string & login,
117 const secu_string & password,
119 const std::string & sftp_pub_keyfile,
120 const std::string & sftp_prv_keyfile,
121 const std::string & sftp_known_hosts
125 static std::string mycurl_protocol2string(mycurl_protocol proto);
126 static std::string build_url_from(mycurl_protocol proto,
const std::string & host,
const std::string & port);
127 static size_t get_ftp_listing_callback(
void *buffer,
size_t size,
size_t nmemb,
void *userp);
128 static size_t null_callback(
void *buffer,
size_t size,
size_t nmemb,
void *userp) {
return size*nmemb; };
129 static bool mycurl_is_protocol_available(mycurl_protocol proto);
132 friend class entrepot_libcurl;
defines the implementation for remote filesystem entrepot using libcurl
class mem_ui definition. This class is to be used as parent class to handle user_interaction object m...
include macro defined by the configure script and some specific additional ones
used to optimize network session establised by libcurl
libdar namespace encapsulate all libdar symbols
this file contains the definition of secu_string class, a std::string like class but allocated in sec...