diff options
author | Alexander Tkachev | 2016-07-13 13:54:45 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | eb269e137f8a494a670bd4f2ee3370fdfb81e113 (patch) | |
tree | 8069ed40d921bd3e530ac3a53c87af844e3652bb /backends/cloud/box/boxstorage.cpp | |
parent | 85f1ce8ece7d4f4c6e54cfe29eaebe2c4ec13aec (diff) | |
download | scummvm-rg350-eb269e137f8a494a670bd4f2ee3370fdfb81e113.tar.gz scummvm-rg350-eb269e137f8a494a670bd4f2ee3370fdfb81e113.tar.bz2 scummvm-rg350-eb269e137f8a494a670bd4f2ee3370fdfb81e113.zip |
CLOUD: Add BoxListDirectoryByIdRequest
Similarly to Google Drive, Box uses only ids of files. That means id
resolving would be slow.
Diffstat (limited to 'backends/cloud/box/boxstorage.cpp')
-rw-r--r-- | backends/cloud/box/boxstorage.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/backends/cloud/box/boxstorage.cpp b/backends/cloud/box/boxstorage.cpp index 85bbf34221..9842ed2796 100644 --- a/backends/cloud/box/boxstorage.cpp +++ b/backends/cloud/box/boxstorage.cpp @@ -22,6 +22,7 @@ #define FORBIDDEN_SYMBOL_ALLOW_ALL #include "backends/cloud/box/boxstorage.h" +#include "backends/cloud/box/boxlistdirectorybyidrequest.h" #include "backends/cloud/box/boxtokenrefresher.h" #include "backends/cloud/cloudmanager.h" #include "backends/networking/curl/connectionmanager.h" @@ -210,10 +211,18 @@ void BoxStorage::fileInfoCallback(Networking::NetworkReadStreamCallback outerCal } 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 } +Networking::Request *BoxStorage::listDirectoryById(Common::String id, ListDirectoryCallback callback, Networking::ErrorCallback errorCallback) { + if (!errorCallback) errorCallback = getErrorPrintingCallback(); + if (!callback) callback = new Common::Callback<BoxStorage, FileArrayResponse>(this, &BoxStorage::printFiles); + return addRequest(new BoxListDirectoryByIdRequest(this, id, callback, errorCallback)); +} + Networking::Request *BoxStorage::upload(Common::String path, Common::SeekableReadStream *contents, UploadCallback callback, Networking::ErrorCallback errorCallback) { //return addRequest(new BoxUploadRequest(this, path, contents, callback, errorCallback)); return nullptr; //TODO |