diff options
author | Alexander Tkachev | 2016-07-13 14:13:23 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | e0a6b2135de6a83f2ed4177c96fabf216412e5fb (patch) | |
tree | fc64ae05bc0f18594fed565b72eed3466cdc513c /backends/cloud/box/boxstorage.cpp | |
parent | eb269e137f8a494a670bd4f2ee3370fdfb81e113 (diff) | |
download | scummvm-rg350-e0a6b2135de6a83f2ed4177c96fabf216412e5fb.tar.gz scummvm-rg350-e0a6b2135de6a83f2ed4177c96fabf216412e5fb.tar.bz2 scummvm-rg350-e0a6b2135de6a83f2ed4177c96fabf216412e5fb.zip |
CLOUD: Add BoxListDirectoryRequest
And used in it BoxResolveIdRequest.
TODO: make some generic ResolveIdRequest and ListDirectoryRequest for
id-based storages. It's really similar, I just had to change a few
details in GoogleDrive ListDirectory and ResolveId requests.
Diffstat (limited to 'backends/cloud/box/boxstorage.cpp')
-rw-r--r-- | backends/cloud/box/boxstorage.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/backends/cloud/box/boxstorage.cpp b/backends/cloud/box/boxstorage.cpp index 9842ed2796..65f90a51d2 100644 --- a/backends/cloud/box/boxstorage.cpp +++ b/backends/cloud/box/boxstorage.cpp @@ -23,6 +23,8 @@ #include "backends/cloud/box/boxstorage.h" #include "backends/cloud/box/boxlistdirectorybyidrequest.h" +#include "backends/cloud/box/boxlistdirectoryrequest.h" +#include "backends/cloud/box/boxresolveidrequest.h" #include "backends/cloud/box/boxtokenrefresher.h" #include "backends/cloud/cloudmanager.h" #include "backends/networking/curl/connectionmanager.h" @@ -210,11 +212,16 @@ void BoxStorage::fileInfoCallback(Networking::NetworkReadStreamCallback outerCal delete response.value; } +Networking::Request *BoxStorage::resolveFileId(Common::String path, UploadCallback callback, Networking::ErrorCallback errorCallback) { + if (!errorCallback) errorCallback = getErrorPrintingCallback(); + if (!callback) callback = new Common::Callback<BoxStorage, UploadResponse>(this, &BoxStorage::printFile); + return addRequest(new BoxResolveIdRequest(this, path, callback, errorCallback)); +} + Networking::Request *BoxStorage::listDirectory(Common::String path, ListDirectoryCallback callback, Networking::ErrorCallback errorCallback, bool recursive) { if (!errorCallback) errorCallback = getErrorPrintingCallback(); if (!callback) callback = new Common::Callback<BoxStorage, FileArrayResponse>(this, &BoxStorage::printFiles); - //return addRequest(new BoxListDirectoryRequest(this, path, callback, errorCallback, recursive)); - return nullptr; //TODO + return addRequest(new BoxListDirectoryRequest(this, path, callback, errorCallback, recursive)); } Networking::Request *BoxStorage::listDirectoryById(Common::String id, ListDirectoryCallback callback, Networking::ErrorCallback errorCallback) { |