Commit 5db5308f authored by Paweł Wegner's avatar Paweł Wegner
Browse files

Request::Ptr -> Request::Pointer.

parent d6baba0f
......@@ -34,7 +34,7 @@ namespace cloudstorage {
namespace {
void move(Request<EitherError<void>>::Ptr r, IHttp* http,
void move(Request<EitherError<void>>::Pointer r, IHttp* http,
std::string metadata_url,
std::shared_ptr<std::vector<std::string>> lst, IItem::Pointer source,
IItem::Pointer destination,
......@@ -98,7 +98,7 @@ ICloudProvider::MoveItemRequest::Pointer AmazonDrive::moveItemAsync(
IItem::Pointer source, IItem::Pointer destination,
MoveItemCallback callback) {
auto r = std::make_shared<Request<EitherError<void>>>(shared_from_this());
r->set([=](Request<EitherError<void>>::Ptr r) {
r->set([=](Request<EitherError<void>>::Pointer r) {
move(r, http(), metadata_url(),
std::make_shared<std::vector<std::string>>(
static_cast<Item*>(source.get())->parents()),
......
......@@ -33,7 +33,7 @@ namespace cloudstorage {
namespace {
void rename(Request<EitherError<void>>::Ptr r, IHttp* http, std::string region,
void rename(Request<EitherError<void>>::Pointer r, IHttp* http, std::string region,
std::string dest_id, std::string source_id,
std::function<void(EitherError<void>)> complete);
......@@ -52,7 +52,7 @@ std::string escapePath(const std::string& str) {
return result;
}
void remove(Request<EitherError<void>>::Ptr r,
void remove(Request<EitherError<void>>::Pointer r,
std::shared_ptr<std::vector<IItem::Pointer>> lst,
std::function<void(EitherError<void>)> complete) {
if (lst->empty()) return complete(nullptr);
......@@ -66,7 +66,7 @@ void remove(Request<EitherError<void>>::Ptr r,
}));
}
void rename(Request<EitherError<void>>::Ptr r, IHttp* http, std::string region,
void rename(Request<EitherError<void>>::Pointer r, IHttp* http, std::string region,
std::shared_ptr<std::vector<IItem::Pointer>> lst,
std::string dest_id, std::string source_id,
std::function<void(EitherError<void>)> complete) {
......@@ -82,7 +82,7 @@ void rename(Request<EitherError<void>>::Ptr r, IHttp* http, std::string region,
});
}
void rename(Request<EitherError<void>>::Ptr r, IHttp* http, std::string region,
void rename(Request<EitherError<void>>::Pointer r, IHttp* http, std::string region,
std::string dest_id, std::string source_id,
std::function<void(EitherError<void>)> complete) {
auto finalize = [=]() {
......@@ -211,7 +211,7 @@ ICloudProvider::MoveItemRequest::Pointer AmazonS3::moveItemAsync(
IItem::Pointer source, IItem::Pointer destination,
MoveItemCallback callback) {
auto r = std::make_shared<Request<EitherError<void>>>(shared_from_this());
r->set([=](Request<EitherError<void>>::Ptr r) {
r->set([=](Request<EitherError<void>>::Pointer r) {
rename(r, http(), region(), destination->id() + source->filename(),
source->id(), callback);
});
......@@ -221,7 +221,7 @@ ICloudProvider::MoveItemRequest::Pointer AmazonS3::moveItemAsync(
ICloudProvider::RenameItemRequest::Pointer AmazonS3::renameItemAsync(
IItem::Pointer item, const std::string& name, RenameItemCallback callback) {
auto r = std::make_shared<Request<EitherError<void>>>(shared_from_this());
r->set([=](Request<EitherError<void>>::Ptr r) {
r->set([=](Request<EitherError<void>>::Pointer r) {
std::string path = split(item->id()).second;
if (!path.empty() && path.back() == '/') path.pop_back();
if (path.find_first_of('/') == std::string::npos)
......@@ -237,7 +237,7 @@ ICloudProvider::CreateDirectoryRequest::Pointer AmazonS3::createDirectoryAsync(
IItem::Pointer parent, const std::string& name,
CreateDirectoryCallback callback) {
auto r = std::make_shared<Request<EitherError<IItem>>>(shared_from_this());
r->set([=](Request<EitherError<IItem>>::Ptr r) {
r->set([=](Request<EitherError<IItem>>::Pointer r) {
auto output = std::make_shared<std::stringstream>();
r->sendRequest(
[=](util::Output) {
......@@ -268,7 +268,7 @@ ICloudProvider::CreateDirectoryRequest::Pointer AmazonS3::createDirectoryAsync(
ICloudProvider::DeleteItemRequest::Pointer AmazonS3::deleteItemAsync(
IItem::Pointer item, DeleteItemCallback callback) {
auto r = std::make_shared<Request<EitherError<void>>>(shared_from_this());
r->set([=](Request<EitherError<void>>::Ptr r) {
r->set([=](Request<EitherError<void>>::Pointer r) {
auto release = [=] {
auto output = std::make_shared<std::stringstream>();
r->sendRequest(
......@@ -314,7 +314,7 @@ ICloudProvider::DeleteItemRequest::Pointer AmazonS3::deleteItemAsync(
ICloudProvider::GetItemDataRequest::Pointer AmazonS3::getItemDataAsync(
const std::string& id, GetItemCallback callback) {
auto r = std::make_shared<Request<EitherError<IItem>>>(shared_from_this());
r->set([=](Request<EitherError<IItem>>::Ptr r) {
r->set([=](Request<EitherError<IItem>>::Pointer r) {
auto work = [=]() {
auto data = split(id);
auto item = std::make_shared<Item>(
......
......@@ -50,7 +50,7 @@ bool Box::reauthorize(int code) const {
ICloudProvider::GetItemDataRequest::Pointer Box::getItemDataAsync(
const std::string& id, GetItemDataCallback callback) {
auto r = std::make_shared<Request<EitherError<IItem>>>(shared_from_this());
r->set([=](Request<EitherError<IItem>>::Ptr r) {
r->set([=](Request<EitherError<IItem>>::Pointer r) {
auto output = std::make_shared<std::stringstream>();
r->sendRequest(
[this, id](util::Output) {
......
......@@ -262,7 +262,7 @@ IHttpServerFactory* CloudProvider::http_server() const {
return http_server_.get();
}
ExchangeCodeRequest::Pointer CloudProvider::exchangeCodeAsync(
ICloudProvider::ExchangeCodeRequest::Pointer CloudProvider::exchangeCodeAsync(
const std::string& code, ExchangeCodeCallback callback) {
return std::make_shared<cloudstorage::ExchangeCodeRequest>(shared_from_this(),
code, callback)
......
......@@ -52,7 +52,7 @@ bool Dropbox::reauthorize(int code) const {
ICloudProvider::GetItemDataRequest::Pointer Dropbox::getItemDataAsync(
const std::string& id, GetItemDataCallback callback) {
auto r = std::make_shared<Request<EitherError<IItem>>>(shared_from_this());
r->set([=](Request<EitherError<IItem>>::Ptr r) {
r->set([=](Request<EitherError<IItem>>::Pointer r) {
auto output = std::make_shared<std::stringstream>();
r->sendRequest(
[=](util::Output input) {
......
......@@ -441,7 +441,7 @@ ICloudProvider::Hints MegaNz::hints() const {
ICloudProvider::ExchangeCodeRequest::Pointer MegaNz::exchangeCodeAsync(
const std::string& code, ExchangeCodeCallback callback) {
auto r = std::make_shared<Request<EitherError<Token>>>(shared_from_this());
r->set([=](Request<EitherError<Token>>::Ptr r) {
r->set([=](Request<EitherError<Token>>::Pointer r) {
auto token = authorizationCodeToToken(code);
EitherError<Token> ret =
token->token_.empty()
......@@ -497,7 +497,7 @@ AuthorizeRequest::Pointer MegaNz::authorizeAsync() {
ICloudProvider::GetItemDataRequest::Pointer MegaNz::getItemDataAsync(
const std::string& id, GetItemDataCallback callback) {
auto r = std::make_shared<Request<EitherError<IItem>>>(shared_from_this());
r->set([=](Request<EitherError<IItem>>::Ptr r) {
r->set([=](Request<EitherError<IItem>>::Pointer r) {
ensureAuthorized<EitherError<IItem>>(r, callback, [=] {
std::unique_ptr<mega::MegaNode> node(mega_->getNodeByPath(id.c_str()));
if (!node) {
......@@ -517,7 +517,7 @@ ICloudProvider::ListDirectoryRequest::Pointer MegaNz::listDirectoryAsync(
IItem::Pointer item, IListDirectoryCallback::Pointer callback) {
using ItemList = EitherError<std::vector<IItem::Pointer>>;
auto r = std::make_shared<Request<ItemList>>(shared_from_this());
r->set([=](Request<ItemList>::Ptr r) {
r->set([=](Request<ItemList>::Pointer r) {
ensureAuthorized<ItemList>(
r, std::bind(&IListDirectoryCallback::done, callback.get(), _1), [=] {
std::unique_ptr<mega::MegaNode> node(
......@@ -556,7 +556,7 @@ ICloudProvider::UploadFileRequest::Pointer MegaNz::uploadFileAsync(
IItem::Pointer item, const std::string& filename,
IUploadFileCallback::Pointer callback) {
auto r = std::make_shared<Request<EitherError<void>>>(shared_from_this());
r->set([=](Request<EitherError<void>>::Ptr r) {
r->set([=](Request<EitherError<void>>::Pointer r) {
ensureAuthorized<EitherError<void>>(
r, std::bind(&IUploadFileCallback::done, callback.get(), _1), [=] {
std::string cache = temporaryFileName();
......@@ -603,7 +603,7 @@ ICloudProvider::UploadFileRequest::Pointer MegaNz::uploadFileAsync(
ICloudProvider::DownloadFileRequest::Pointer MegaNz::getThumbnailAsync(
IItem::Pointer item, IDownloadFileCallback::Pointer callback) {
auto r = std::make_shared<Request<EitherError<void>>>(shared_from_this());
r->set([=](Request<EitherError<void>>::Ptr r) {
r->set([=](Request<EitherError<void>>::Pointer r) {
ensureAuthorized<EitherError<void>>(
r, std::bind(&IDownloadFileCallback::done, callback.get(), _1), [=] {
std::string cache = temporaryFileName();
......@@ -643,7 +643,7 @@ ICloudProvider::DownloadFileRequest::Pointer MegaNz::getThumbnailAsync(
ICloudProvider::DeleteItemRequest::Pointer MegaNz::deleteItemAsync(
IItem::Pointer item, DeleteItemCallback callback) {
auto r = std::make_shared<Request<EitherError<void>>>(shared_from_this());
r->set([=](Request<EitherError<void>>::Ptr r) {
r->set([=](Request<EitherError<void>>::Pointer r) {
ensureAuthorized<EitherError<void>>(r, callback, [=] {
std::unique_ptr<mega::MegaNode> node(
mega_->getNodeByPath(item->id().c_str()));
......@@ -670,7 +670,7 @@ ICloudProvider::CreateDirectoryRequest::Pointer MegaNz::createDirectoryAsync(
IItem::Pointer parent, const std::string& name,
CreateDirectoryCallback callback) {
auto r = std::make_shared<Request<EitherError<IItem>>>(shared_from_this());
r->set([=](Request<EitherError<IItem>>::Ptr r) {
r->set([=](Request<EitherError<IItem>>::Pointer r) {
ensureAuthorized<EitherError<IItem>>(r, callback, [=] {
std::unique_ptr<mega::MegaNode> parent_node(
mega_->getNodeByPath(parent->id().c_str()));
......@@ -703,7 +703,7 @@ ICloudProvider::MoveItemRequest::Pointer MegaNz::moveItemAsync(
IItem::Pointer source, IItem::Pointer destination,
MoveItemCallback callback) {
auto r = std::make_shared<Request<EitherError<void>>>(shared_from_this());
r->set([=](Request<EitherError<void>>::Ptr r) {
r->set([=](Request<EitherError<void>>::Pointer r) {
ensureAuthorized<EitherError<void>>(r, callback, [=] {
std::unique_ptr<mega::MegaNode> source_node(
mega_->getNodeByPath(source->id().c_str()));
......@@ -732,7 +732,7 @@ ICloudProvider::MoveItemRequest::Pointer MegaNz::moveItemAsync(
ICloudProvider::RenameItemRequest::Pointer MegaNz::renameItemAsync(
IItem::Pointer item, const std::string& name, RenameItemCallback callback) {
auto r = std::make_shared<Request<EitherError<void>>>(shared_from_this());
r->set([=](Request<EitherError<void>>::Ptr r) {
r->set([=](Request<EitherError<void>>::Pointer r) {
ensureAuthorized<EitherError<void>>(r, callback, [=] {
std::unique_ptr<mega::MegaNode> node(
mega_->getNodeByPath(item->id().c_str()));
......@@ -759,7 +759,7 @@ ICloudProvider::ListDirectoryPageRequest::Pointer
MegaNz::listDirectoryPageAsync(IItem::Pointer item, const std::string&,
ListDirectoryPageCallback complete) {
auto r = std::make_shared<Request<EitherError<PageData>>>(shared_from_this());
r->set([=](Request<EitherError<PageData>>::Ptr r) {
r->set([=](Request<EitherError<PageData>>::Pointer r) {
ensureAuthorized<EitherError<PageData>>(r, complete, [=] {
std::unique_ptr<mega::MegaNode> node(
mega_->getNodeByPath(item->id().c_str()));
......@@ -784,10 +784,10 @@ MegaNz::listDirectoryPageAsync(IItem::Pointer item, const std::string&,
return r->run();
}
std::function<void(Request<EitherError<void>>::Ptr)> MegaNz::downloadResolver(
std::function<void(Request<EitherError<void>>::Pointer)> MegaNz::downloadResolver(
IItem::Pointer item, IDownloadFileCallback::Pointer callback, int64_t start,
int64_t size) {
return [=](Request<EitherError<void>>::Ptr r) {
return [=](Request<EitherError<void>>::Pointer r) {
ensureAuthorized<EitherError<void>>(
r, std::bind(&IDownloadFileCallback::done, callback.get(), _1), [=] {
std::unique_ptr<mega::MegaNode> node(
......@@ -807,7 +807,7 @@ std::function<void(Request<EitherError<void>>::Ptr)> MegaNz::downloadResolver(
};
}
void MegaNz::login(Request<EitherError<void>>::Ptr r,
void MegaNz::login(Request<EitherError<void>>::Pointer r,
AuthorizeRequest::AuthorizeCompleted complete) {
auto auth_listener = std::make_shared<RequestListener>(
[=](EitherError<void> e, Listener*) { complete(e); }, this);
......@@ -849,7 +849,7 @@ std::string MegaNz::temporaryFileName() {
}
template <class T>
void MegaNz::ensureAuthorized(typename Request<T>::Ptr r,
void MegaNz::ensureAuthorized(typename Request<T>::Pointer r,
std::function<void(T)> on_error,
std::function<void()> on_success) {
auto f = [=](EitherError<void> e) {
......
......@@ -89,11 +89,11 @@ class MegaNz : public CloudProvider {
ListDirectoryPageRequest::Pointer listDirectoryPageAsync(
IItem::Pointer, const std::string&, ListDirectoryPageCallback) override;
std::function<void(Request<EitherError<void>>::Ptr)> downloadResolver(
std::function<void(Request<EitherError<void>>::Pointer)> downloadResolver(
IItem::Pointer item, IDownloadFileCallback::Pointer, int64_t start = 0,
int64_t size = -1);
void login(Request<EitherError<void>>::Ptr,
void login(Request<EitherError<void>>::Pointer,
AuthorizeRequest::AuthorizeCompleted);
std::string passwordHash(const std::string& password) const;
......@@ -104,7 +104,7 @@ class MegaNz : public CloudProvider {
std::string temporaryFileName();
template <class T>
void ensureAuthorized(typename Request<T>::Ptr,
void ensureAuthorized(typename Request<T>::Pointer,
std::function<void(T)> on_error,
std::function<void()> on_success);
......
......@@ -36,7 +36,7 @@ using namespace std::placeholders;
namespace cloudstorage {
namespace {
void upload(Request<EitherError<void>>::Ptr r, int sent,
void upload(Request<EitherError<void>>::Pointer r, int sent,
IUploadFileCallback::Pointer callback, Json::Value response) {
auto output = std::make_shared<std::stringstream>();
int size = callback->size();
......@@ -81,7 +81,7 @@ ICloudProvider::UploadFileRequest::Pointer OneDrive::uploadFileAsync(
IItem::Pointer parent, const std::string& filename,
IUploadFileCallback::Pointer callback) {
auto r = std::make_shared<Request<EitherError<void>>>(shared_from_this());
r->set([=](Request<EitherError<void>>::Ptr r) {
r->set([=](Request<EitherError<void>>::Pointer r) {
auto output = std::make_shared<std::stringstream>();
r->sendRequest(
[=](util::Output) {
......
......@@ -58,7 +58,7 @@ ICloudProvider::CreateDirectoryRequest::Pointer OwnCloud::createDirectoryAsync(
IItem::Pointer parent, const std::string& name,
CreateDirectoryCallback callback) {
auto r = std::make_shared<Request<EitherError<IItem>>>(shared_from_this());
r->set([=](Request<EitherError<IItem>>::Ptr r) {
r->set([=](Request<EitherError<IItem>>::Pointer r) {
auto response = std::make_shared<std::stringstream>();
r->sendRequest(
[=](util::Output) {
......
......@@ -50,7 +50,7 @@ IItem::Pointer YandexDisk::rootDirectory() const {
ICloudProvider::GetItemDataRequest::Pointer YandexDisk::getItemDataAsync(
const std::string& id, GetItemDataCallback callback) {
auto r = std::make_shared<Request<EitherError<IItem>>>(shared_from_this());
r->set([=](Request<EitherError<IItem>>::Ptr r) {
r->set([=](Request<EitherError<IItem>>::Pointer r) {
auto output = std::make_shared<std::stringstream>();
r->sendRequest(
[=](util::Output) {
......@@ -112,7 +112,7 @@ ICloudProvider::GetItemDataRequest::Pointer YandexDisk::getItemDataAsync(
ICloudProvider::DownloadFileRequest::Pointer YandexDisk::downloadFileAsync(
IItem::Pointer item, IDownloadFileCallback::Pointer callback) {
auto r = std::make_shared<Request<EitherError<void>>>(shared_from_this());
r->set([=](Request<EitherError<void>>::Ptr r) {
r->set([=](Request<EitherError<void>>::Pointer r) {
auto output = std::make_shared<std::stringstream>();
r->sendRequest(
[=](util::Output) {
......@@ -162,7 +162,7 @@ ICloudProvider::UploadFileRequest::Pointer YandexDisk::uploadFileAsync(
IItem::Pointer directory, const std::string& filename,
IUploadFileCallback::Pointer callback) {
auto r = std::make_shared<Request<EitherError<void>>>(shared_from_this());
r->set([=](Request<EitherError<void>>::Ptr r) {
r->set([=](Request<EitherError<void>>::Pointer r) {
auto output = std::make_shared<std::stringstream>();
r->sendRequest(
[=](util::Output) {
......@@ -223,7 +223,7 @@ ICloudProvider::CreateDirectoryRequest::Pointer
YandexDisk::createDirectoryAsync(IItem::Pointer parent, const std::string& name,
CreateDirectoryCallback callback) {
auto r = std::make_shared<Request<EitherError<IItem>>>(shared_from_this());
r->set([=](Request<EitherError<IItem>>::Ptr r) {
r->set([=](Request<EitherError<IItem>>::Pointer r) {
auto output = std::make_shared<std::stringstream>();
r->sendRequest(
[=](util::Output) {
......
......@@ -63,9 +63,10 @@ std::string YouTube::name() const { return "youtube"; }
std::string YouTube::endpoint() const { return "https://www.googleapis.com"; }
ListDirectoryPageRequest::Pointer YouTube::listDirectoryPageAsync(
IItem::Pointer directory, const std::string& token,
ListDirectoryPageCallback complete) {
ICloudProvider::ListDirectoryPageRequest::Pointer
YouTube::listDirectoryPageAsync(IItem::Pointer directory,
const std::string& token,
ListDirectoryPageCallback complete) {
return std::make_shared<cloudstorage::ListDirectoryPageRequest>(
shared_from_this(), directory, token, complete,
[](int code) { return code == IHttpRequest::NotFound; })
......@@ -83,7 +84,7 @@ ICloudProvider::ListDirectoryRequest::Pointer YouTube::listDirectoryAsync(
ICloudProvider::GetItemDataRequest::Pointer YouTube::getItemDataAsync(
const std::string& id, GetItemDataCallback callback) {
auto r = std::make_shared<Request<EitherError<IItem>>>(shared_from_this());
r->set([=](Request<EitherError<IItem>>::Ptr r) {
r->set([=](Request<EitherError<IItem>>::Pointer r) {
if (id == AUDIO_DIRECTORY) {
IItem::Pointer i = std::make_shared<Item>(
AUDIO_DIRECTORY, AUDIO_DIRECTORY, IItem::FileType::Directory);
......@@ -152,7 +153,7 @@ ICloudProvider::GetItemDataRequest::Pointer YouTube::getItemDataAsync(
ICloudProvider::DownloadFileRequest::Pointer YouTube::downloadFileAsync(
IItem::Pointer item, IDownloadFileCallback::Pointer callback) {
auto r = std::make_shared<Request<EitherError<void>>>(shared_from_this());
r->set([=](Request<EitherError<void>>::Ptr r) {
r->set([=](Request<EitherError<void>>::Pointer r) {
std::string url = item->url();
auto download = [=](std::string url) {
auto wrapper = std::make_shared<DownloadStreamWrapper>(std::bind(
......
......@@ -32,7 +32,7 @@ AuthorizeRequest::AuthorizeRequest(std::shared_ptr<CloudProvider> p,
: Request(p), state_(provider()->auth()->state()), server_cancelled_() {
if (!provider()->auth_callback())
throw std::logic_error("CloudProvider's callback can't be null.");
set([=](Request::Ptr request) {
set([=](Request::Pointer request) {
auto on_complete = [=](EitherError<void> result) {
std::unique_lock<std::mutex> lock(
provider()->current_authorization_mutex_);
......@@ -168,7 +168,7 @@ void AuthorizeRequest::oauth2Authorization(AuthorizeCompleted complete) {
}
SimpleAuthorization::SimpleAuthorization(std::shared_ptr<CloudProvider> p)
: AuthorizeRequest(p, [=](AuthorizeRequest::Ptr r,
: AuthorizeRequest(p, [=](AuthorizeRequest::Pointer r,
AuthorizeRequest::AuthorizeCompleted complete) {
if (p->auth_callback()->userConsentRequired(*p) !=
ICloudProvider::IAuthCallback::Status::WaitForAuthorizationCode) {
......
......@@ -32,7 +32,7 @@ CreateDirectoryRequest::CreateDirectoryRequest(std::shared_ptr<CloudProvider> p,
const std::string& name,
CreateDirectoryCallback callback)
: Request(p) {
set([=](Request::Ptr request) {
set([=](Request::Pointer request) {
if (parent->type() != IItem::FileType::Directory) {
Error e{IHttpRequest::Forbidden, "parent not a directory"};
callback(e);
......
......@@ -31,7 +31,7 @@ DeleteItemRequest::DeleteItemRequest(std::shared_ptr<CloudProvider> p,
IItem::Pointer item,
DeleteItemCallback callback)
: Request(p) {
set([=](Request::Ptr request) {
set([=](Request::Pointer request) {
auto output = std::make_shared<std::stringstream>();
sendRequest(
[=](util::Output stream) {
......
......@@ -36,7 +36,7 @@ DownloadFileRequest::DownloadFileRequest(std::shared_ptr<CloudProvider> p,
: Request(p),
stream_wrapper_(
std::bind(&ICallback::receivedData, callback.get(), _1, _2)) {
set([=](Request::Ptr request) {
set([=](Request::Pointer request) {
auto response_stream = std::make_shared<std::ostream>(&stream_wrapper_);
sendRequest(
[=](util::Output input) { return request_factory(*file, *input); },
......
......@@ -31,7 +31,7 @@ ExchangeCodeRequest::ExchangeCodeRequest(std::shared_ptr<CloudProvider> p,
const std::string& authorization_code,
ExchangeCodeCallback callback)
: Request(p) {
set([=](Request<EitherError<Token>>::Ptr r) {
set([=](Request<EitherError<Token>>::Pointer r) {
std::stringstream stream;
if (!provider()->auth()->exchangeAuthorizationCodeRequest(stream)) {
Token token{authorization_code, ""};
......
......@@ -31,7 +31,7 @@ namespace cloudstorage {
GetItemDataRequest::GetItemDataRequest(std::shared_ptr<CloudProvider> p,
const std::string& id, Callback callback)
: Request(p) {
set([=](Request::Ptr request) {
set([=](Request::Pointer request) {
auto response_stream = std::make_shared<std::stringstream>();
sendRequest(
[=](util::Output input) {
......
......@@ -30,7 +30,7 @@ namespace cloudstorage {
GetItemRequest::GetItemRequest(std::shared_ptr<CloudProvider> p,
const std::string& path, Callback callback)
: Request(p) {
set([=](Request::Ptr) {
set([=](Request::Pointer) {
if (path.empty() || path.front() != '/') {
Error e{IHttpRequest::Forbidden, "invalid path"};
callback(e);
......
......@@ -32,7 +32,7 @@ ListDirectoryPageRequest::ListDirectoryPageRequest(
const std::string& token, ListDirectoryPageCallback completed,
std::function<bool(int)> fault_tolerant)
: Request(p) {
set([=](Request<EitherError<PageData>>::Ptr r) {
set([=](Request<EitherError<PageData>>::Pointer r) {
if (directory->type() != IItem::FileType::Directory) {
Error e{IHttpRequest::Bad, "file not a directory"};
completed(e);
......
......@@ -31,7 +31,7 @@ ListDirectoryRequest::ListDirectoryRequest(
std::shared_ptr<CloudProvider> p, IItem::Pointer directory,
ICallback::Pointer callback, std::function<bool(int)> fault_tolerant)
: Request(p) {
set([=](Request::Ptr request) {
set([=](Request::Pointer request) {
if (directory->type() != IItem::FileType::Directory) {
Error e{IHttpRequest::Forbidden, "trying to list non directory"};
callback->done(e);
......
Supports Markdown
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