ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

#include <googledrivestorage.h>

Inheritance diagram for Cloud::GoogleDrive::GoogleDriveStorage:
Collaboration diagram for Cloud::GoogleDrive::GoogleDriveStorage:

List of all members.

Public Member Functions

 GoogleDriveStorage (Common::String code, Networking::ErrorCallback cb)
 This constructor uses OAuth code flow to get tokens.
virtual ~GoogleDriveStorage ()
virtual void saveConfig (Common::String keyPrefix)
 Storage methods, which are used by CloudManager to save storage in configuration file.
virtual Common::String name () const
 Return unique storage name.
virtual Networking::RequestlistDirectoryById (Common::String id, ListDirectoryCallback callback, Networking::ErrorCallback errorCallback)
 Public Cloud API comes down there.
virtual Networking::Requestupload (Common::String path, Common::SeekableReadStream *contents, UploadCallback callback, Networking::ErrorCallback errorCallback)
 Returns UploadStatus struct with info about uploaded file.
virtual Networking::RequeststreamFileById (Common::String id, Networking::NetworkReadStreamCallback callback, Networking::ErrorCallback errorCallback)
 Returns pointer to Networking::NetworkReadStream.
virtual Networking::RequestcreateDirectoryWithParentId (Common::String parentId, Common::String directoryName, BoolCallback callback, Networking::ErrorCallback errorCallback)
 Calls the callback when finished.
virtual Networking::Requestinfo (StorageInfoCallback callback, Networking::ErrorCallback errorCallback)
 Returns the StorageInfo struct.
virtual Common::String savesDirectoryPath ()
 Returns storage's saves directory path with the trailing slash.
virtual Common::String getRootDirectoryId ()
Common::String accessToken () const

Static Public Member Functions

static GoogleDriveStorageloadFromConfig (Common::String keyPrefix)
 Load token and user id from configs and return GoogleDriveStorage for those.
static void removeFromConfig (Common::String keyPrefix)
 Remove all GoogleDriveStorage-related data from config.

Protected Member Functions

virtual Common::String cloudProvider ()
virtual uint32 storageIndex ()
virtual bool needsRefreshToken ()
virtual bool canReuseRefreshToken ()

Private Member Functions

 GoogleDriveStorage (Common::String token, Common::String refreshToken, bool enabled)
 This private constructor is called from loadFromConfig().
void infoInnerCallback (StorageInfoCallback outerCallback, Networking::JsonResponse json)
 Constructs StorageInfo based on JSON response from cloud.
void createDirectoryInnerCallback (BoolCallback outerCallback, Networking::JsonResponse json)
 Returns bool based on JSON response from cloud.
void printInfo (StorageInfoResponse response)

Detailed Description

Definition at line 32 of file googledrivestorage.h.


Constructor & Destructor Documentation

Cloud::GoogleDrive::GoogleDriveStorage::GoogleDriveStorage ( Common::String  token,
Common::String  refreshToken,
bool  enabled 
) [private]

This private constructor is called from loadFromConfig().

Definition at line 46 of file googledrivestorage.cpp.

Cloud::GoogleDrive::GoogleDriveStorage::GoogleDriveStorage ( Common::String  code,
Networking::ErrorCallback  cb 
)

This constructor uses OAuth code flow to get tokens.

Definition at line 49 of file googledrivestorage.cpp.

Cloud::GoogleDrive::GoogleDriveStorage::~GoogleDriveStorage (  )  [virtual]

Definition at line 53 of file googledrivestorage.cpp.


Member Function Documentation

Common::String Cloud::GoogleDrive::GoogleDriveStorage::accessToken (  )  const [inline]

Definition at line 116 of file googledrivestorage.h.

bool Cloud::GoogleDrive::GoogleDriveStorage::canReuseRefreshToken (  )  [protected, virtual]

Definition at line 61 of file googledrivestorage.cpp.

Common::String Cloud::GoogleDrive::GoogleDriveStorage::cloudProvider (  )  [protected, virtual]
Returns:
"gdrive"

Definition at line 55 of file googledrivestorage.cpp.

void Cloud::GoogleDrive::GoogleDriveStorage::createDirectoryInnerCallback ( BoolCallback  outerCallback,
Networking::JsonResponse  json 
) [private]

Returns bool based on JSON response from cloud.

Definition at line 131 of file googledrivestorage.cpp.

Networking::Request * Cloud::GoogleDrive::GoogleDriveStorage::createDirectoryWithParentId ( Common::String  parentId,
Common::String  directoryName,
BoolCallback  callback,
Networking::ErrorCallback  errorCallback 
) [virtual]

Calls the callback when finished.

Implements Cloud::Id::IdStorage.

Definition at line 184 of file googledrivestorage.cpp.

Common::String Cloud::GoogleDrive::GoogleDriveStorage::getRootDirectoryId (  )  [virtual]

Implements Cloud::Id::IdStorage.

Definition at line 241 of file googledrivestorage.cpp.

Networking::Request * Cloud::GoogleDrive::GoogleDriveStorage::info ( StorageInfoCallback  callback,
Networking::ErrorCallback  errorCallback 
) [virtual]

Returns the StorageInfo struct.

Definition at line 208 of file googledrivestorage.cpp.

void Cloud::GoogleDrive::GoogleDriveStorage::infoInnerCallback ( StorageInfoCallback  outerCallback,
Networking::JsonResponse  json 
) [private]

Constructs StorageInfo based on JSON response from cloud.

Definition at line 73 of file googledrivestorage.cpp.

Networking::Request * Cloud::GoogleDrive::GoogleDriveStorage::listDirectoryById ( Common::String  id,
ListDirectoryCallback  callback,
Networking::ErrorCallback  errorCallback 
) [virtual]

Public Cloud API comes down there.

Returns Array<StorageFile> - the list of files.

Implements Cloud::Id::IdStorage.

Definition at line 152 of file googledrivestorage.cpp.

GoogleDriveStorage * Cloud::GoogleDrive::GoogleDriveStorage::loadFromConfig ( Common::String  keyPrefix  )  [static]

Load token and user id from configs and return GoogleDriveStorage for those.

Returns:
pointer to the newly created GoogleDriveStorage or 0 if some problem occured.

Definition at line 219 of file googledrivestorage.cpp.

Common::String Cloud::GoogleDrive::GoogleDriveStorage::name (  )  const [virtual]

Return unique storage name.

Returns:
some unique storage name (for example, "Dropbox (user@example.com)")

Definition at line 69 of file googledrivestorage.cpp.

bool Cloud::GoogleDrive::GoogleDriveStorage::needsRefreshToken (  )  [protected, virtual]

Definition at line 59 of file googledrivestorage.cpp.

void Cloud::GoogleDrive::GoogleDriveStorage::printInfo ( StorageInfoResponse  response  )  [private]

Definition at line 177 of file googledrivestorage.cpp.

void Cloud::GoogleDrive::GoogleDriveStorage::removeFromConfig ( Common::String  keyPrefix  )  [static]

Remove all GoogleDriveStorage-related data from config.

Definition at line 235 of file googledrivestorage.cpp.

void Cloud::GoogleDrive::GoogleDriveStorage::saveConfig ( Common::String  keyPrefix  )  [virtual]

Storage methods, which are used by CloudManager to save storage in configuration file.

Save storage data using ConfMan.

Parameters:
keyPrefix all saved keys must start with this prefix.
Note:
every Storage must write keyPrefix + "type" key with common value (e.g. "Dropbox").

Definition at line 63 of file googledrivestorage.cpp.

Common::String Cloud::GoogleDrive::GoogleDriveStorage::savesDirectoryPath (  )  [virtual]

Returns storage's saves directory path with the trailing slash.

Definition at line 217 of file googledrivestorage.cpp.

uint32 Cloud::GoogleDrive::GoogleDriveStorage::storageIndex (  )  [protected, virtual]
Returns:
kStorageGoogleDriveId

Definition at line 57 of file googledrivestorage.cpp.

Networking::Request * Cloud::GoogleDrive::GoogleDriveStorage::streamFileById ( Common::String  id,
Networking::NetworkReadStreamCallback  callback,
Networking::ErrorCallback  errorCallback 
) [virtual]

Returns pointer to Networking::NetworkReadStream.

Implements Cloud::Id::IdStorage.

Definition at line 164 of file googledrivestorage.cpp.

Networking::Request * Cloud::GoogleDrive::GoogleDriveStorage::upload ( Common::String  path,
Common::SeekableReadStream contents,
UploadCallback  callback,
Networking::ErrorCallback  errorCallback 
) [virtual]

Returns UploadStatus struct with info about uploaded file.

Definition at line 160 of file googledrivestorage.cpp.


The documentation for this class was generated from the following files:


Generated on Sat Mar 28 2020 05:02:21 for ResidualVM by doxygen 1.7.1
curved edge   curved edge