Public Member Functions | |
| DataStorageBinaryFile (FString DirectoryPath=TEXT("")) | |
| void | Reset (const THandler< bool > &Result, const FString &FileName=TEXT("DefaultFileName")) override |
| Reset an existing Table in the Storage. | |
| void | DeleteItem (const FString &Key, const FVoidHandler OnDone, const FString &Filename=TEXT("DefaultFileName")) override |
| Delete an Item in the file. | |
| void | SaveItemOverwiteEntireFile (FString Key, FString Item, const THandler< bool > &OnDone, const FString &Filename=TEXT("DefaultFileName")) override |
| Insert Item to a file by overwrite operation. | |
| void | SaveItem (const FString &Key, const TArray< uint8 > &Item, const THandler< bool > &OnDone, const FString &Filename=TEXT("DefaultFileName")) override |
| Insert Item to the Key Value file. | |
| void | SaveItem (const FString &Key, const FString &Item, const THandler< bool > &OnDone, const FString &Filename=TEXT("DefaultFileName")) override |
| Insert Item to the Key Value file. | |
| void | SaveItem (const FString &Key, const FJsonObjectWrapper &Item, const THandler< bool > &OnDone, const FString &Filename=TEXT("DefaultFileName")) override |
| Insert Item to the Key Value file. | |
| void | GetItem (const FString &Key, const THandler< TPair< FString, TArray< uint8 > > > &OnDone, const FString &Filename=TEXT("DefaultFileName")) override |
| Get an Item from the Key Value file. | |
| void | GetItem (const FString &Key, const THandler< TPair< FString, FString > > &OnDone, const FString &Filename=TEXT("DefaultFileName")) override |
| Get an Item from the Key Value file. | |
| void | GetItem (const FString &Key, const THandler< TPair< FString, FJsonObjectWrapper > > &OnDone, const FString &Filename=TEXT("DefaultFileName")) override |
| Get an Item from the Key Value file. | |
| FDirectoryPath | GetAbsoluteFileDirectory () |
| Helper function. | |
| void | ConvertExistingCache (const FString &OldCacheFilename, const FString &NewCacheFilenameForTelemetry, const FString &NewCacheFilenameForGeneralPurpose) override |
| Change the old JSON-Array structure into new-line ( ) separated JSON. Telemetry will be extracted from the old cache into a Telemetry specific cache. DeviceID & refresh token will be extracted as well into a GeneralPurpose cache. | |
Protected Member Functions | |
| virtual FString | CompleteAbsoluteFilePath (const FString &FileName) |
| Convert the filename within the storage directory into fullpath. | |
| virtual TOptional< FString > | LoadFromFile (const FString &FileName) |
| Obtain the content of the specified file and return it. | |
| virtual bool | SaveToFile (const FString &FileName, const FString &Key, const TArray< uint8 > &Value) |
| Load the targeted file, modify the specified key, and then save it again. | |
| virtual FString | FABBinaryFileStructureToString (FABBinaryFileStructure *Structure) |
| Serialize an Array of Struct manually due to UE limitation Using Newline as delimiter. | |
| virtual TSharedPtr< FABBinaryFileStructure > | ParseStructureFromFile (const FString &FileName) |
| Read file content and deserialize it. | |
| virtual TSharedPtr< FABBinaryFileStructure > | ParseStructureOnly (const FString &TargetedString) |
| Deserialize string into an array string of FABBinaryFileStructure. | |
| virtual bool | IsFileExist (const FString &FileName) |
| Check the existing file within the file storage directory. | |
| virtual FABBinaryFileStructure | ConvertOldCacheToNewFormat (const FString &Input) |
| Convert the old cache format into new cache format. | |
| virtual void | MoveOldCacheToNewCacheFiles (const FABBinaryFileStructure &CacheContent, const FString &NewTelemetryCacheFilename, const FString &NewGenerelPurposeCacheFilename) |
| Migrate the value from the converted old cache into each new files. | |
| bool | CopyFile (const FString &FileName, const FString &DestinationAbsoluteDirPath, const FString &SourceAbsoluteDirPath) |
| Read file from Source directory then write to destination directory, effectively copying. | |
| bool | MigrateStorageFiles (const FDirectoryPath &SourceDirectory, const FDirectoryPath &DestinationDirectory) |
Protected Attributes | |
| FDirectoryPath | RelativeFileDirectory |
| The main storage directory. | |
|
protectedvirtual |
Convert the filename within the storage directory into fullpath.
| FileName | File name only, without any prefix. |
|
overridevirtual |
Change the old JSON-Array structure into new-line (
) separated JSON. Telemetry will be extracted from the old cache into a Telemetry specific cache. DeviceID & refresh token will be extracted as well into a GeneralPurpose cache.
| OldCacheFilename | The targeted file that will be extracted |
| NewCacheFilenameForTelemetry | |
| NewCacheFilenameForGeneralPurpose |
Implements AccelByte::IAccelByteDataStorage.
|
protectedvirtual |
Convert the old cache format into new cache format.
| Input | The loaded old cache |
|
protected |
Read file from Source directory then write to destination directory, effectively copying.
| FileName | |
| DestinationAbsoluteDirPath | |
| SourceAbsoluteDirPath |
|
overridevirtual |
Delete an Item in the file.
| Key | The Key of the Item. |
| OnDone | This will be called when the operation done. |
| FileName | optional. The name of the file. Default will drop the default storage file. |
Implements AccelByte::IAccelByteDataStorage.
|
protectedvirtual |
Serialize an Array of Struct manually due to UE limitation Using Newline as delimiter.
| Pointer | to the structure that will be serialized |
|
overridevirtual |
Get an Item from the Key Value file.
| Key | The Key of the Item to Get. |
| OnDone | This will be called when the operation done. The result is Pair of a FString Key, and a FJsonObjectWrapper Value. |
| FileName | optional. The name of the file. Default will get an item from the default storage file. |
Implements AccelByte::IAccelByteDataStorage.
|
overridevirtual |
Get an Item from the Key Value file.
| Key | The Key of the Item to Get. |
| OnDone | This will be called when the operation done. The result is Pair of a FString Key, and a FString Value. |
| FileName | optional. The name of the file. Default will get an item from the default storage file. |
Implements AccelByte::IAccelByteDataStorage.
|
overridevirtual |
Get an Item from the Key Value file.
| Key | The Key of the Item to Get. |
| OnDone | This will be called when the operation done. The result is Pair of a FString Key, and an array of uint8 Value. |
| FileName | optional. The name of the file. Default will get an item from the default storage file. |
Implements AccelByte::IAccelByteDataStorage.
|
protectedvirtual |
Obtain the content of the specified file and return it.
| FileName | The name of the file, not the absolute path. |
|
protected |
Migrate AccelByte-related cache files from one directory to another directory. AccelByteGeneralCache & AccelByteTelemetryCache are the affected files.
| SourceDirectory | |
| DestinationDirectory |
|
protectedvirtual |
Migrate the value from the converted old cache into each new files.
| CacheContent | Cache that will be stored into new files. |
| NewTelemetryCacheFilename | |
| NewGenerelPurposeCacheFilename |
|
protectedvirtual |
Read file content and deserialize it.
| FileName | The name of the file, not the absolute path. |
|
protectedvirtual |
Deserialize string into an array string of FABBinaryFileStructure.
| TargetedString | The string that will be deserialized. |
|
overridevirtual |
Reset an existing Table in the Storage.
| Result | This will be called when the operation done. The result is bool. |
| FileName | optional. The name of the file. Default will drop the default storage file. |
Implements AccelByte::IAccelByteDataStorage.
|
overridevirtual |
Insert Item to the Key Value file.
| Key | The Key of the Item. |
| Item | The Data to be inserted to the file. The Data would be a FJsonObjectWrapper. |
| OnDone | This will be called when the operation done. The result is bool. |
| FileName | optional. The name of the file. Default will insert an item to the default storage file. |
Implements AccelByte::IAccelByteDataStorage.
|
overridevirtual |
Insert Item to the Key Value file.
| Key | The Key of the Item. |
| Item | The Data to be inserted to the file. The Data would be a FString. |
| OnDone | This will be called when the operation done. The result is bool. |
| FileName | optional. The name of the file. Default will insert an item to the default storage file. |
Implements AccelByte::IAccelByteDataStorage.
|
overridevirtual |
Insert Item to the Key Value file.
| Key | The Key of the Item. |
| Item | The Data to be inserted to the file. The Data would be an array of uint8. |
| OnDone | This will be called when the operation done. The result is bool. |
| FileName | optional. The name of the file. Default will insert an item to the default storage file. |
Implements AccelByte::IAccelByteDataStorage.
|
overridevirtual |
Insert Item to a file by overwrite operation.
| Key | The Key of the Item. |
| Item | The Data to be inserted to the Table. The Data would be a FString. |
| OnDone | This will be called when the operation done. The result is bool. |
| Filename | optional. The name of the table. Default will insert an item to the default KeyValue table. |
Implements AccelByte::IAccelByteDataStorage.
|
protectedvirtual |
Load the targeted file, modify the specified key, and then save it again.
| FileName | The name of the file, not the absolute path. |
| Key | The key to store the specified value. |
| Value | The array of byte that will be written based on the key. |