Commit 4c7e9a97 authored by Paweł Wegner's avatar Paweł Wegner

Added deleteItemAsync.

parent 0719b0fb
......@@ -176,6 +176,16 @@ ICloudProvider::DownloadFileRequest::Pointer CloudProvider::getThumbnailAsync(
std::bind(&CloudProvider::getThumbnailRequest, this, _1, _2));
}
ICloudProvider::DeleteItemRequest::Pointer CloudProvider::deleteItemAsync(
IItem::Pointer, DeleteItemCallback callback) {
auto r = make_unique<Request<bool>>(shared_from_this());
r->set_resolver([callback](Request<bool>*) {
callback(false);
return false;
});
return r;
}
HttpRequest::Pointer CloudProvider::getItemDataRequest(const std::string&,
std::ostream&) const {
return nullptr;
......
......@@ -70,6 +70,8 @@ class CloudProvider : public ICloudProvider,
GetItemDataCallback f);
DownloadFileRequest::Pointer getThumbnailAsync(
IItem::Pointer, IDownloadFileCallback::Pointer);
DeleteItemRequest::Pointer deleteItemAsync(IItem::Pointer,
DeleteItemCallback);
virtual HttpRequest::Pointer getItemDataRequest(
const std::string& id, std::ostream& input_stream) const;
......
......@@ -44,6 +44,7 @@ class ICloudProvider {
using DownloadFileRequest = IRequest<void>;
using UploadFileRequest = IRequest<void>;
using GetItemDataRequest = IRequest<IItem::Pointer>;
using DeleteItemRequest = IRequest<bool>;
class ICallback {
public:
......@@ -82,6 +83,8 @@ class ICloudProvider {
GetItemDataCallback) = 0;
virtual DownloadFileRequest::Pointer getThumbnailAsync(
IItem::Pointer item, IDownloadFileCallback::Pointer) = 0;
virtual DeleteItemRequest::Pointer deleteItemAsync(IItem::Pointer,
DeleteItemCallback) = 0;
};
} // namespace cloudstorage
......
......@@ -81,6 +81,7 @@ class IUploadFileCallback {
using GetItemCallback = std::function<void(IItem::Pointer)>;
using GetItemDataCallback = std::function<void(IItem::Pointer)>;
using DeleteItemCallback = std::function<void(bool)>;
} // namespace cloudstorage
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment