1 #ifndef GALAXY_I_CLOUDSTORAGE_H
2 #define GALAXY_I_CLOUDSTORAGE_H
93 const char* container,
97 const char* savegameID
273 typedef int (*
WriteFunc)(
void* userParam,
const char* data,
int size);
332 typedef int (*
ReadFunc)(
void* userParam,
char* data,
int size);
377 const char* container,
384 uint32_t timeStamp = 0,
385 const char* hash = NULL
409 const char* container,
412 uint32_t bufferLength,
415 uint32_t timeStamp = 0,
416 const char* hash = NULL
446 uint32_t hashBufferSize
464 uint32_t bufferLength,
466 uint32_t hashBufferSize
Contains data structures and interfaces related to callback listeners.
The class that is inherited by all specific callback listeners and provides a static method that retu...
Definition: IListenerRegistrar.h:117
Listener for the event of deleting a file stored in cloud storage.
Definition: ICloudStorage.h:171
FailureReason
The reason of a failure in deleting a file.
Definition: ICloudStorage.h:186
@ FAILURE_REASON_NOT_FOUND
Container not found.
Definition: ICloudStorage.h:190
@ FAILURE_REASON_FORBIDDEN
No access to specified container.
Definition: ICloudStorage.h:189
@ FAILURE_REASON_UNAUTHORIZED
Authorization lost.
Definition: ICloudStorage.h:188
@ FAILURE_REASON_ABORTED
Request aborted.
Definition: ICloudStorage.h:192
@ FAILURE_REASON_CONFLICT
< Expected hash parameter doesn't match the hash in the container.
Definition: ICloudStorage.h:194
@ FAILURE_REASON_UNAVAILABLE
Service unavailable.
Definition: ICloudStorage.h:191
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: ICloudStorage.h:187
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: ICloudStorage.h:193
virtual void OnDeleteFileFailure(const char *container, const char *name, FailureReason failureReason)=0
Notification for the event of a failure in deleting a file.
virtual void OnDeleteFileSuccess(const char *container, const char *name)=0
Notification for the event of a success in deleting a file.
Listener for the event of downloading a list of files stored in cloud storage.
Definition: ICloudStorage.h:38
virtual void OnGetFileListSuccess(uint32_t fileCount, uint32_t quota, uint32_t quotaUsed)=0
Notification for the event of a success in downloading a list of files.
FailureReason
The reason of a failure in downloading a list of files.
Definition: ICloudStorage.h:58
@ FAILURE_REASON_NOT_FOUND
Container not found.
Definition: ICloudStorage.h:62
@ FAILURE_REASON_FORBIDDEN
No access to specified container.
Definition: ICloudStorage.h:61
@ FAILURE_REASON_UNAUTHORIZED
Authorization lost.
Definition: ICloudStorage.h:60
@ FAILURE_REASON_ABORTED
Request aborted.
Definition: ICloudStorage.h:64
@ FAILURE_REASON_UNAVAILABLE
Service unavailable.
Definition: ICloudStorage.h:63
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: ICloudStorage.h:59
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: ICloudStorage.h:65
virtual void OnGetFileListFailure(FailureReason failureReason)=0
Notification for the event of a failure in downloading a list of files.
Listener for the event of downloading a file stored in cloud storage.
Definition: ICloudStorage.h:80
virtual void OnGetFileSuccess(const char *container, const char *name, uint32_t fileSize, SavegameType savegameType, const char *savegameID)=0
Notification for the event of a success in downloading a file.
FailureReason
The reason of a failure in downloading a file.
Definition: ICloudStorage.h:104
@ FAILURE_REASON_BUFFER_TOO_SMALL
Buffer passed to ICloudStorage::GetFile() is too small to fit the file content.
Definition: ICloudStorage.h:112
@ FAILURE_REASON_NOT_FOUND
Container not found.
Definition: ICloudStorage.h:108
@ FAILURE_REASON_FORBIDDEN
No access to specified container.
Definition: ICloudStorage.h:107
@ FAILURE_REASON_UNAUTHORIZED
Authorization lost.
Definition: ICloudStorage.h:106
@ FAILURE_REASON_ABORTED
Request aborted.
Definition: ICloudStorage.h:110
@ FAILURE_REASON_UNAVAILABLE
Service unavailable.
Definition: ICloudStorage.h:109
@ FAILURE_REASON_WRITE_FUNC_ERROR
Function writeFunc passed to ICloudStorage::GetFile() returned an error.
Definition: ICloudStorage.h:113
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: ICloudStorage.h:105
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: ICloudStorage.h:111
virtual void OnGetFileFailure(const char *container, const char *name, FailureReason failureReason)=0
Notification for the event of a failure in downloading a file.
Listener for the event of uploading a local file to the cloud storage.
Definition: ICloudStorage.h:130
virtual void OnPutFileFailure(const char *container, const char *name, FailureReason failureReason)=0
Notification for the event of a failure in uploading a file.
FailureReason
The reason of a failure in uploading a file.
Definition: ICloudStorage.h:145
@ FAILURE_REASON_FORBIDDEN
No access to specified container.
Definition: ICloudStorage.h:148
@ FAILURE_REASON_UNAUTHORIZED
Authorization lost.
Definition: ICloudStorage.h:147
@ FAILURE_REASON_ABORTED
Request aborted.
Definition: ICloudStorage.h:150
@ FAILURE_REASON_UNAVAILABLE
Service unavailable.
Definition: ICloudStorage.h:149
@ FAILURE_REASON_QUOTA_EXCEEDED
Unable to upload the file because there is no free space on cloud storage.
Definition: ICloudStorage.h:153
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: ICloudStorage.h:146
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: ICloudStorage.h:151
@ FAILURE_REASON_READ_FUNC_ERROR
Function readFunc passed to ICloudStorage::PutFile() returned an error.
Definition: ICloudStorage.h:152
virtual void OnPutFileSuccess(const char *container, const char *name)=0
Notification for the event of a success in uploading a file.
The interface for cross-platform CloudStorage file management.
Definition: ICloudStorage.h:210
virtual void GetFileList(const char *container, ICloudStorageGetFileListListener *listener)=0
Function used to get a list of files stored in cloud storage.
virtual void PutFile(const char *container, const char *name, const void *buffer, uint32_t bufferLength, ICloudStoragePutFileListener *listener, SavegameType savegameType=SAVEGAME_TYPE_UNDEFINED, uint32_t timeStamp=0, const char *hash=NULL)=0
Upload a file to the cloud storage.
virtual const char * GetFileHashByIndex(uint32_t index) const =0
Function used to get a file hash from the retrieved list of files stored in cloud storage.
int(* WriteFunc)(void *userParam, const char *data, int size)
Function used to write the downloaded data.
Definition: ICloudStorage.h:273
virtual uint32_t GetFileSizeByIndex(uint32_t index) const =0
Function used to get a file size from the retrieved list of files stored in cloud storage.
virtual const char * GetFileNameByIndex(uint32_t index) const =0
Function used to get a file name from the retrieved list of files stored in cloud storage.
virtual void CloseSavegame()=0
Closes savegame.
int(* ReadFunc)(void *userParam, char *data, int size)
Function used to read the data to be uploaded.
Definition: ICloudStorage.h:332
virtual void PutFile(const char *container, const char *name, void *userParam, ReadFunc readFunc, RewindFunc rewindFunc, ICloudStoragePutFileListener *listener, SavegameType savegameType=SAVEGAME_TYPE_UNDEFINED, uint32_t timeStamp=0, const char *hash=NULL)=0
Upload a file to the cloud storage.
static const uint32_t MIN_HASH_BUFFER_SIZE
Minimum size of the hashBuffer in CalculateHash method.
Definition: ICloudStorage.h:422
virtual void OpenSavegame()=0
Starts new savegame.
ReadPhase
The phase of reading data to be uploaded.
Definition: ICloudStorage.h:338
@ UPLOADING
Uploading phase.
Definition: ICloudStorage.h:340
@ CHECKSUM_CALCULATING
Checksum calculating phase.
Definition: ICloudStorage.h:339
virtual void DeleteFile(const char *container, const char *name, ICloudStorageDeleteFileListener *listener, const char *expectedHash=NULL)=0
Delete a file from cloud storage.
virtual uint32_t GetFileTimestampByIndex(uint32_t index) const =0
Function used to get a file timestamp from the retrieved list of files stored in cloud storage.
virtual void CalculateHash(const void *buffer, uint32_t bufferLength, char *hashBuffer, uint32_t hashBufferSize)=0
Calculate hash for the specified object.
virtual void GetFileMetadata(const char *container, const char *name, ICloudStorageGetFileListener *listener)=0
Get a file metadata from cloud storage.
virtual void GetFile(const char *container, const char *name, void *dataBuffer, uint32_t bufferLength, ICloudStorageGetFileListener *listener)=0
Download a file from cloud storage.
int(* RewindFunc)(void *userParam, ReadPhase phase)
Function used to restart read data process.
Definition: ICloudStorage.h:353
virtual void CalculateHash(void *userParam, ReadFunc readFunc, RewindFunc rewindFunc, char *hashBuffer, uint32_t hashBufferSize)=0
Calculate hash for the specified object.
virtual void GetFile(const char *container, const char *name, void *userParam, WriteFunc writeFunc, ICloudStorageGetFileListener *listener)=0
Download a file from cloud storage.
SavegameType
The type of savegame.
Definition: ICloudStorage.h:24
@ SAVEGAME_TYPE_QUICK
Quick savegame.
Definition: ICloudStorage.h:27
@ SAVEGAME_TYPE_CHECKPOINT
Savegame at a certain in-game event, e.g. quest completion.
Definition: ICloudStorage.h:31
@ SAVEGAME_TYPE_ENDGAME_SAVE
Savegame at the end of the game.
Definition: ICloudStorage.h:30
@ SAVEGAME_TYPE_POINT_OF_NO_RETURN
Savegame at the point of no return.
Definition: ICloudStorage.h:29
@ SAVEGAME_TYPE_MANUAL
Manual savegame.
Definition: ICloudStorage.h:28
@ SAVEGAME_TYPE_UNDEFINED
Not defined savegame type.
Definition: ICloudStorage.h:25
@ SAVEGAME_TYPE_AUTO
Auto savegame, triggered automatically over time.
Definition: ICloudStorage.h:26