aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud/googledrive/googledrivestorage.h
diff options
context:
space:
mode:
authorAlexander Tkachev2016-07-14 08:50:31 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit0b5bd18d8525e16749ad422913800b2120021240 (patch)
treece5ff9e80a67f8e724bc73b9dd7b9059c4661e58 /backends/cloud/googledrive/googledrivestorage.h
parent5cbb3e8705f51337c6455ecb5dc7004abf82bd89 (diff)
downloadscummvm-rg350-0b5bd18d8525e16749ad422913800b2120021240.tar.gz
scummvm-rg350-0b5bd18d8525e16749ad422913800b2120021240.tar.bz2
scummvm-rg350-0b5bd18d8525e16749ad422913800b2120021240.zip
CLOUD: Update GoogleDriveStorage
It now derives from IdStorage, so lots of GoogleDrive*Request classes are removed and replaced with generic IdStorage*Request ones.
Diffstat (limited to 'backends/cloud/googledrive/googledrivestorage.h')
-rw-r--r--backends/cloud/googledrive/googledrivestorage.h23
1 files changed, 4 insertions, 19 deletions
diff --git a/backends/cloud/googledrive/googledrivestorage.h b/backends/cloud/googledrive/googledrivestorage.h
index 8093ef1938..435f9998a3 100644
--- a/backends/cloud/googledrive/googledrivestorage.h
+++ b/backends/cloud/googledrive/googledrivestorage.h
@@ -23,14 +23,14 @@
#ifndef BACKENDS_CLOUD_GOOGLEDRIVE_GOOGLEDRIVESTORAGE_H
#define BACKENDS_CLOUD_GOOGLEDRIVE_GOOGLEDRIVESTORAGE_H
-#include "backends/cloud/storage.h"
+#include "backends/cloud/id/idstorage.h"
#include "common/callback.h"
#include "backends/networking/curl/curljsonrequest.h"
namespace Cloud {
namespace GoogleDrive {
-class GoogleDriveStorage: public Cloud::Storage {
+class GoogleDriveStorage: public Id::IdStorage {
static char *KEY, *SECRET;
static void loadKeyAndSecret();
@@ -49,11 +49,7 @@ class GoogleDriveStorage: public Cloud::Storage {
/** Returns bool based on JSON response from cloud. */
void createDirectoryInnerCallback(BoolCallback outerCallback, Networking::JsonResponse json);
- void printJson(Networking::JsonResponse response);
void fileDownloaded(BoolResponse response);
- void printFiles(FileArrayResponse response);
- void printBool(BoolResponse response);
- void printFile(UploadResponse response);
void printInfo(StorageInfoResponse response);
public:
/** This constructor uses OAuth code flow to get tokens. */
@@ -81,12 +77,6 @@ public:
/** Public Cloud API comes down there. */
- /** Returns StorageFile with the resolved file's id. */
- virtual Networking::Request *resolveFileId(Common::String path, UploadCallback callback, Networking::ErrorCallback errorCallback);
-
- /** Returns Array<StorageFile> - the list of files. */
- virtual Networking::Request *listDirectory(Common::String path, ListDirectoryCallback callback, Networking::ErrorCallback errorCallback, bool recursive = false);
-
/** Returns Array<StorageFile> - the list of files. */
virtual Networking::Request *listDirectoryById(Common::String id, ListDirectoryCallback callback, Networking::ErrorCallback errorCallback);
@@ -94,19 +84,12 @@ public:
virtual Networking::Request *upload(Common::String path, Common::SeekableReadStream *contents, UploadCallback callback, Networking::ErrorCallback errorCallback);
/** Returns pointer to Networking::NetworkReadStream. */
- virtual Networking::Request *streamFile(Common::String path, Networking::NetworkReadStreamCallback callback, Networking::ErrorCallback errorCallback);
virtual Networking::Request *streamFileById(Common::String id, Networking::NetworkReadStreamCallback callback, Networking::ErrorCallback errorCallback);
/** Calls the callback when finished. */
- virtual Networking::Request *download(Common::String remotePath, Common::String localPath, BoolCallback callback, Networking::ErrorCallback errorCallback);
-
- /** Calls the callback when finished. */
virtual Networking::Request *remove(Common::String path, BoolCallback callback, Networking::ErrorCallback errorCallback) { return nullptr; } //TODO
/** Calls the callback when finished. */
- virtual Networking::Request *createDirectory(Common::String path, BoolCallback callback, Networking::ErrorCallback errorCallback);
-
- /** Calls the callback when finished. */
virtual Networking::Request *createDirectoryWithParentId(Common::String parentId, Common::String name, BoolCallback callback, Networking::ErrorCallback errorCallback);
/** Returns the StorageInfo struct. */
@@ -126,6 +109,8 @@ public:
*/
static Common::String getAuthLink();
+ virtual Common::String getRootDirectoryId();
+
/**
* Show message with GoogleDrive auth instructions. (Temporary)
*/