1 #ifndef GALAXY_I_STORAGE_H
2 #define GALAXY_I_STORAGE_H
126 virtual void FileWrite(
const char* fileName,
const void* data, uint32_t dataSize) = 0;
136 virtual uint32_t
FileRead(
const char* fileName,
void* data, uint32_t dataSize) = 0;
Contains GalaxyID, which is the class that represents the ID of an entity used by Galaxy Peer.
Contains data structures and interfaces related to callback listeners.
Represents the ID of an entity used by Galaxy Peer.
Definition: GalaxyID.h:30
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 sharing a file.
Definition: IStorage.h:30
FailureReason
The reason of a failure in sharing a file.
Definition: IStorage.h:45
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IStorage.h:46
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IStorage.h:47
virtual void OnFileShareSuccess(const char *fileName, SharedFileID sharedFileID)=0
Notification for the event of a success in sharing a file.
virtual void OnFileShareFailure(const char *fileName, FailureReason failureReason)=0
Notification for the event of a failure in sharing a file.
Listener for the event of downloading a shared file.
Definition: IStorage.h:68
FailureReason
The reason of a failure in downloading a shared file.
Definition: IStorage.h:83
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IStorage.h:84
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IStorage.h:85
virtual void OnSharedFileDownloadSuccess(SharedFileID sharedFileID, const char *fileName)=0
Notification for the event of a success in downloading a shared file.
virtual void OnSharedFileDownloadFailure(SharedFileID sharedFileID, FailureReason failureReason)=0
Notification for the event of a failure in downloading a shared file.
The interface for managing of cloud storage files.
Definition: IStorage.h:106
virtual void FileShare(const char *fileName, IFileShareListener *const listener=NULL)=0
Uploads the file for sharing.
virtual SharedFileID GetDownloadedSharedFileByIndex(uint32_t index)=0
Returns the ID of the open downloaded shared file.
virtual uint32_t GetFileCount()=0
Returns number of the files in the storage.
virtual void FileWrite(const char *fileName, const void *data, uint32_t dataSize)=0
Writes data into the file.
virtual bool FileExists(const char *fileName)=0
Returns if the file exists.
virtual void SharedFileClose(SharedFileID sharedFileID)=0
Closes downloaded shared file and frees the memory.
virtual void GetFileNameCopyByIndex(uint32_t index, char *buffer, uint32_t bufferLength)=0
Copies the name of the file to a buffer.
virtual void FileDelete(const char *fileName)=0
Deletes the file.
virtual GalaxyID GetSharedFileOwner(SharedFileID sharedFileID)=0
Gets the owner of downloaded shared file.
virtual uint32_t GetFileTimestamp(const char *fileName)=0
Returns the timestamp of the last file modification.
virtual void GetSharedFileNameCopy(SharedFileID sharedFileID, char *buffer, uint32_t bufferLength)=0
Copies the name of downloaded shared file to a buffer.
virtual const char * GetSharedFileName(SharedFileID sharedFileID)=0
Gets name of downloaded shared file.
virtual uint32_t GetFileSize(const char *fileName)=0
Returns the size of the file.
virtual void DownloadSharedFile(SharedFileID sharedFileID, ISharedFileDownloadListener *const listener=NULL)=0
Downloads previously shared file.
virtual const char * GetFileNameByIndex(uint32_t index)=0
Returns name of the file.
virtual uint32_t FileRead(const char *fileName, void *data, uint32_t dataSize)=0
Reads file content into the buffer.
virtual uint32_t GetDownloadedSharedFileCount()=0
Returns the number of open downloaded shared files.
virtual uint32_t GetSharedFileSize(SharedFileID sharedFileID)=0
Gets size of downloaded shared file.
virtual uint32_t SharedFileRead(SharedFileID sharedFileID, void *data, uint32_t dataSize, uint32_t offset=0)=0
Reads downloaded shared file content into the buffer.
The class that is inherited by the self-registering versions of all specific callback listeners.
Definition: IListenerRegistrar.h:211
uint64_t SharedFileID
ID of a shared file.
Definition: IStorage.h:24
SelfRegisteringListener< ISharedFileDownloadListener > GlobalSharedFileDownloadListener
Globally self-registering version of ISharedFileDownloadListener.
Definition: IStorage.h:100
SelfRegisteringListener< IFileShareListener > GlobalFileShareListener
Globally self-registering version of IFileShareListener.
Definition: IStorage.h:62