CloudPolis / Webdav Client Cpp
Licence: other
☁️ C++ WebDAV Client provides easy and convenient to work with WebDAV-servers.
Stars: ✭ 92
Programming Languages
cpp
1120 projects
Projects that are alternatives of or similar to Webdav Client Cpp
Gowebdav
A golang WebDAV client library and command line tool.
Stars: ✭ 97 (+5.43%)
Mutual labels: webdav, client
Kaidan
[Replaced by https://invent.kde.org/network/kaidan] Kaidan, a simple and user-friendly Jabber/XMPP client for every device and platform.
Stars: ✭ 67 (-27.17%)
Mutual labels: cmake, client
Mumble
Mumble is an open-source, low-latency, high quality voice chat software.
Stars: ✭ 4,418 (+4702.17%)
Mutual labels: cmake, client
Packer Ubuntu 1404
DEPRECATED - Packer Example - Ubuntu 14.04 Vagrant Box using Ansible provisioner
Stars: ✭ 81 (-11.96%)
Mutual labels: box
Torchlambda
Lightweight tool to deploy PyTorch models to AWS Lambda
Stars: ✭ 83 (-9.78%)
Mutual labels: cmake
Beagle Im
XMPP client for macOS based on TigaseSwift XMPP library
Stars: ✭ 86 (-6.52%)
Mutual labels: client
Zhihu Oauth
尝试解析出知乎官方未开放的 OAuth2 接口,并提供优雅的使用方式,作为 zhihu-py3 项目的替代者,目前还在实验阶段
Stars: ✭ 1,237 (+1244.57%)
Mutual labels: client
Llvm Amdgpu Assembler Extra
LLVM AMDGPU Assembler Helper Tools
Stars: ✭ 80 (-13.04%)
Mutual labels: cmake
WebDAV Client
Package WebDAV Client
provides easy and convenient to work with WebDAV-servers:
- Yandex.Disk
- Dropbox
- Google Drive
- Box
- 4shared
- ownCloud
- ...
Install old version
# via brew or homebrew
$ brew install wdc
Build
Building WebDAV Client from sources:
$ git clone --recursive https://github.com/CloudPolis/webdav-client-cpp
$ cd webdav-client-cpp
$ ./tools/polly/bin/polly --install
Building documentation:
$ doxygen docs/doxygen.conf
$ open docs/html/index.html
Running tests
For run tests you need to set environment variables WEBDAV_HOSTNAME
,
WEBDAV_USERNAME
and WEBDAV_PASSWORD
(optional WEBDAV_ROOT
).
$ export WEBDAV_HOSTNAME=<your_webdav_hostname>
$ export WEBDAV_USERNAME=<your_webdav_username>
$ export WEBDAV_PASSWORD=<your_webdav_password>
$ ./tools/polly/bin/polly --test --reconfig --fwd BUILD_TESTS=yes
Usage
#include <webdav/client.hpp>
#include <iostream>
#include <map>
#include <memory>
int main()
{
std::map<std::string, std::string> options =
{
{"webdav_hostname", "https://webdav.yandex.ru"},
{"webdav_username", "webdav_username"},
{"webdav_password", "webdav_password"}
};
// additional keys:
// - webdav_root
// - cert_path, key_path
// - proxy_hostname, proxy_username, proxy_password
std::unique_ptr<WebDAV::Client> client{ new WebDAV::Client{ options } };
bool check_connection = client->check();
std::cout << "test connection with WebDAV drive is "
<< (check_connection ? "" : "not ")
<< "successful"<< std::endl;
bool is_dir = client->is_directory("/path/to/remote/resource");
std::cout << "remote resource is "
<< (is_dir ? "" : "not ")
<< "directory" << std::endl;
client->create_directory("/path/to/remote/directory/");
client->clean("/path/to/remote/directory/");
std::cout << "On WebDAV-disk available free space: "
<< client->free_size()
<< std::endl;
std::cout << "remote_directory_name";
for (const auto& resource_name : client->list("/path/to/remote/directory/"))
{
std::cout << "\t" << "-" << resource_name;
}
std::cout << std::endl;
client->download("/path/to/remote/file", "/path/to/local/file");
client->clean("/path/to/remote/file");
client->upload("/path/to/remote/file", "/path/to/local/file");
const auto meta_info = client->info("/path/to/remote/resource");
for (const auto& field : meta_info) {
std::cout << field.first << ":" << "\t" << field.second;
}
std::cout << std::endl;
client->copy("/path/to/remote/file1", "/path/to/remote/file2");
client->move("/path/to/remote/file1", "/path/to/remote/file3");
client->async_upload("/path/to/remote/file", "/path/to/local/file");
client->async_download("/path/to/remote/file", "/path/to/local/file");
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.4)
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.23.83.tar.gz"
SHA1 "12dec078717539eb7b03e6d2a17797cba9be9ba9"
)
project(example)
hunter_add_package(WDC)
find_package(WDC CONFIG REQUIRED)
add_executable(example example.cpp)
target_link_libraries(example WDC::libwdc)
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].