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

#include <boxstorage.h>

Inheritance diagram for Cloud::Box::BoxStorage:
Collaboration diagram for Cloud::Box::BoxStorage:

List of all members.

Public Member Functions

 BoxStorage (Common::String code, Networking::ErrorCallback cb)
 This constructor uses OAuth code flow to get tokens.
virtual ~BoxStorage ()
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::RequestcreateDirectoryWithParentId (Common::String parentId, Common::String directoryName, BoolCallback callback, Networking::ErrorCallback errorCallback)
virtual Networking::Requestupload (Common::String remotePath, Common::String localPath, UploadCallback callback, Networking::ErrorCallback errorCallback)
 Returns UploadStatus struct with info about uploaded file.
virtual Networking::Requestupload (Common::String path, Common::SeekableReadStream *contents, UploadCallback callback, Networking::ErrorCallback errorCallback)
virtual bool uploadStreamSupported ()
 Returns whether Storage supports upload(ReadStream).
virtual Networking::RequeststreamFileById (Common::String path, Networking::NetworkReadStreamCallback callback, Networking::ErrorCallback errorCallback)
 Returns pointer to Networking::NetworkReadStream.
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 BoxStorageloadFromConfig (Common::String keyPrefix)
 Load token and user id from configs and return BoxStorage for those.
static void removeFromConfig (Common::String keyPrefix)
 Remove all BoxStorage-related data from config.

Protected Member Functions

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

Private Member Functions

 BoxStorage (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 response)

Detailed Description

Definition at line 32 of file boxstorage.h.


Constructor & Destructor Documentation

Cloud::Box::BoxStorage::BoxStorage ( Common::String  token,
Common::String  refreshToken,
bool  enabled 
) [private]

This private constructor is called from loadFromConfig().

Definition at line 45 of file boxstorage.cpp.

Cloud::Box::BoxStorage::BoxStorage ( Common::String  code,
Networking::ErrorCallback  cb 
)

This constructor uses OAuth code flow to get tokens.

Definition at line 48 of file boxstorage.cpp.

Cloud::Box::BoxStorage::~BoxStorage (  )  [virtual]

Definition at line 52 of file boxstorage.cpp.


Member Function Documentation

Common::String Cloud::Box::BoxStorage::accessToken (  )  const [inline]

Definition at line 114 of file boxstorage.h.

bool Cloud::Box::BoxStorage::canReuseRefreshToken (  )  [protected, virtual]

Definition at line 60 of file boxstorage.cpp.

Common::String Cloud::Box::BoxStorage::cloudProvider (  )  [protected, virtual]
Returns:
"box"

Definition at line 54 of file boxstorage.cpp.

void Cloud::Box::BoxStorage::createDirectoryInnerCallback ( BoolCallback  outerCallback,
Networking::JsonResponse  response 
) [private]

Definition at line 130 of file boxstorage.cpp.

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

Implements Cloud::Id::IdStorage.

Definition at line 151 of file boxstorage.cpp.

Common::String Cloud::Box::BoxStorage::getRootDirectoryId (  )  [virtual]

Implements Cloud::Id::IdStorage.

Definition at line 237 of file boxstorage.cpp.

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

Returns the StorageInfo struct.

Definition at line 206 of file boxstorage.cpp.

void Cloud::Box::BoxStorage::infoInnerCallback ( StorageInfoCallback  outerCallback,
Networking::JsonResponse  json 
) [private]

Constructs StorageInfo based on JSON response from cloud.

Definition at line 72 of file boxstorage.cpp.

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

Public Cloud API comes down there.

Implements Cloud::Id::IdStorage.

Definition at line 122 of file boxstorage.cpp.

BoxStorage * Cloud::Box::BoxStorage::loadFromConfig ( Common::String  keyPrefix  )  [static]

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

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

Definition at line 215 of file boxstorage.cpp.

Common::String Cloud::Box::BoxStorage::name (  )  const [virtual]

Return unique storage name.

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

Definition at line 68 of file boxstorage.cpp.

bool Cloud::Box::BoxStorage::needsRefreshToken (  )  [protected, virtual]

Definition at line 58 of file boxstorage.cpp.

void Cloud::Box::BoxStorage::removeFromConfig ( Common::String  keyPrefix  )  [static]

Remove all BoxStorage-related data from config.

Definition at line 231 of file boxstorage.cpp.

void Cloud::Box::BoxStorage::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 62 of file boxstorage.cpp.

Common::String Cloud::Box::BoxStorage::savesDirectoryPath (  )  [virtual]

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

Definition at line 213 of file boxstorage.cpp.

uint32 Cloud::Box::BoxStorage::storageIndex (  )  [protected, virtual]
Returns:
kStorageBoxId

Definition at line 56 of file boxstorage.cpp.

Networking::Request * Cloud::Box::BoxStorage::streamFileById ( Common::String  path,
Networking::NetworkReadStreamCallback  callback,
Networking::ErrorCallback  errorCallback 
) [virtual]

Returns pointer to Networking::NetworkReadStream.

Implements Cloud::Id::IdStorage.

Definition at line 193 of file boxstorage.cpp.

Networking::Request * Cloud::Box::BoxStorage::upload ( Common::String  remotePath,
Common::String  localPath,
UploadCallback  callback,
Networking::ErrorCallback  errorCallback 
) [virtual]

Returns UploadStatus struct with info about uploaded file.

Definition at line 174 of file boxstorage.cpp.

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

Definition at line 180 of file boxstorage.cpp.

bool Cloud::Box::BoxStorage::uploadStreamSupported (  )  [virtual]

Returns whether Storage supports upload(ReadStream).

Definition at line 189 of file boxstorage.cpp.


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


Generated on Sat Jan 25 2020 05:02:01 for ResidualVM by doxygen 1.7.1
curved edge   curved edge