23 #ifndef WEBDAV_CLIENT_H 24 #define WEBDAV_CLIENT_H 35 using progress_t = std::function<int(
void *context,
41 using callback_t = std::function<void(bool)> ;
43 using strings_t = std::vector<std::string>;
44 using dict_t = std::map<std::string, std::string>;
68 static auto Init(
const dict_t& options) noexcept ->
Client *;
78 auto free_size()
const noexcept ->
unsigned long long;
85 auto check(
const std::string& remote_resource =
"/")
const noexcept -> bool;
92 auto info(
const std::string& remote_resource)
const noexcept -> dict_t;
99 auto clean(
const std::string& remote_resource)
const noexcept -> bool;
105 auto is_directory(
const std::string& remote_resource)
const noexcept -> bool;
112 auto list(
const std::string& remote_directory =
"")
const noexcept -> strings_t;
121 const std::string& remote_directory,
122 bool recursive =
false 123 )
const noexcept -> bool;
132 const std::string& remote_source_resource,
133 const std::string& remote_destination_resource
134 )
const noexcept -> bool;
143 const std::string& remote_source_resource,
144 const std::string& remote_destination_resource
145 )
const noexcept -> bool;
155 const std::string& remote_file,
156 const std::string& local_file,
157 progress_t progress =
nullptr 158 )
const noexcept -> bool;
169 const std::string& remote_file,
171 unsigned long long & buffer_size,
172 progress_t progress =
nullptr 173 )
const noexcept -> bool;
183 const std::string& remote_file,
184 std::ostream& stream,
185 progress_t progress =
nullptr 186 )
const noexcept -> bool;
197 const std::string& remote_file,
198 const std::string& local_file,
199 callback_t callback =
nullptr,
200 progress_t progress =
nullptr 201 )
const noexcept -> void;
211 const std::string& remote_file,
212 const std::string& local_file,
213 progress_t progress =
nullptr 214 )
const noexcept -> bool;
225 const std::string& remote_file,
227 unsigned long long buffer_size,
228 progress_t progress =
nullptr 229 )
const noexcept -> bool;
239 const std::string& remote_file,
240 std::istream& stream,
241 progress_t progress =
nullptr 242 )
const noexcept -> bool;
253 const std::string& remote_file,
254 const std::string& local_file,
255 callback_t callback =
nullptr,
256 progress_t progress =
nullptr 257 )
const noexcept -> void;
264 enum { buffer_size = 1000 * 1000 };
auto list(const std::string &remote_directory="") const noexcept -> strings_t
auto create_directory(const std::string &remote_directory, bool recursive=false) const noexcept -> bool
auto async_download(const std::string &remote_file, const std::string &local_file, callback_t callback=nullptr, progress_t progress=nullptr) const noexcept -> void
auto upload(const std::string &remote_file, const std::string &local_file, progress_t progress=nullptr) const noexcept -> bool
static void Cleanup() noexcept
This function releases resources acquired by curl_global_init.
auto check(const std::string &remote_resource="/") const noexcept -> bool
auto is_directory(const std::string &remote_resource) const noexcept -> bool
auto download(const std::string &remote_file, const std::string &local_file, progress_t progress=nullptr) const noexcept -> bool
auto free_size() const noexcept -> unsigned long long
Definition: client.hpp:33
auto download_to(const std::string &remote_file, char *&buffer_ptr, unsigned long long &buffer_size, progress_t progress=nullptr) const noexcept -> bool
WebDAV Client.
Definition: client.hpp:52
auto info(const std::string &remote_resource) const noexcept -> dict_t
auto clean(const std::string &remote_resource) const noexcept -> bool
auto async_upload(const std::string &remote_file, const std::string &local_file, callback_t callback=nullptr, progress_t progress=nullptr) const noexcept -> void
auto upload_from(const std::string &remote_file, char *buffer_ptr, unsigned long long buffer_size, progress_t progress=nullptr) const noexcept -> bool
auto move(const std::string &remote_source_resource, const std::string &remote_destination_resource) const noexcept -> bool
auto copy(const std::string &remote_source_resource, const std::string &remote_destination_resource) const noexcept -> bool
static auto Init(const dict_t &options) noexcept -> Client *