Navigation
API > API/Runtime > API/Runtime/BackgroundHTTPFileHash
Helper that handles generating unique hashed file paths to use store to store BackgroundHTTP work once completed. Can be saved and loaded to/from disk to handle persistence across session when background work is compelted without any usefull program state. NOTE: This is in it's own separate module as some platforms (IOS, etc.) need to include this functionality in ApplicationCore and thus fully adding a dependency to those modules on BackgroundHTTP would not work
| Name | FBackgroundHttpFileHashHelper |
| Type | class |
| Header File | /Engine/Source/Runtime/Online/BackgroundHTTPFileHash/Public/BackgroundHttpFileHashHelper.h |
| Include Path | #include "BackgroundHttpFileHashHelper.h" |
Syntax
class FBackgroundHttpFileHashHelper
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FBackgroundHttpFileHashHelper() |
BackgroundHttpFileHashHelper.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bHasLoadedURLData | std::atomic< bool > | Used to make sure that we have called LoadData before any operations that depend on it. | BackgroundHttpFileHashHelper.h | |
| bIsDirty | std::atomic< bool > | Tracks if we have changed data since our last call to SaveData() | BackgroundHttpFileHashHelper.h | |
| URLFileMappings | TMap< FString, FURLTempFileMapping > | Stores our FURLTempFileMapping mapped to a Hashed filename. | BackgroundHttpFileHashHelper.h | |
| URLFileMappingsLock | FRWLock | Access lock for URLFileMappings. | BackgroundHttpFileHashHelper.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void DeleteURLMappingsWithoutTempFiles() |
Deletes any URLMapping that doesn't have a corresponding Temp file actually on disk. | BackgroundHttpFileHashHelper.h | |
bool FindMappedURLForTempFilename
(
const FString& TempFilename, |
Looks for a URL mapped to the supplied TempFilename. Nullptr returned if one isn't found. | BackgroundHttpFileHashHelper.h | |
const FString * FindMappedURLForTempFilename
(
const FString& TempFilename |
BackgroundHttpFileHashHelper.h | ||
| Looks for a temp filename mapping for the given URL. If one isn't found a new one is generated and returned. | BackgroundHttpFileHashHelper.h | ||
const FString * FindTempFilenameMappingForURL
(
const FString& URL |
BackgroundHttpFileHashHelper.h | ||
bool FindTempFilenameMappingForURL
(
const FString& URL, |
Looks for a temp filename mapping for the given URL. If one isn't found returns nullptr and does NOT generate one. | BackgroundHttpFileHashHelper.h | |
bool InitFromString
(
const FString& StringIn |
Sets the values of this FBackgroundHttpFileHashHelper from the string representation Returns if the parse was successful or not | BackgroundHttpFileHashHelper.h | |
void LoadData() |
Handles loading URL Mapping data from disk. No operation if data has previously been loaded. | BackgroundHttpFileHashHelper.h | |
void RemoveURLMapping
(
const FString& URL |
Removes URL mapping. | BackgroundHttpFileHashHelper.h | |
void SaveData() |
Handles saving URL Mapping data to disk. No operation if data isn't dirty. | BackgroundHttpFileHashHelper.h | |
FString ToString() |
Creates an FString representation of this FBackgroundHttpFileHashHelper's URL mappings. Used for serializing to/from disk. | BackgroundHttpFileHashHelper.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Creates a hashed Filename with a modifier for the given collision count. | BackgroundHttpFileHashHelper.h | ||
| Helper function that returns a full path representation of hte given TempFilename. | BackgroundHttpFileHashHelper.h | ||
static const FString & GetTempFileExtension() |
Helper function that returns the file extension used by our BackgroundHTTP temp files. | BackgroundHttpFileHashHelper.h | |
static const FString & GetTemporaryRootPath() |
Get our base directory used to store Temp files. | BackgroundHttpFileHashHelper.h | |
static const FString & GetURLMappingFilePathNoLock() |
Helper function that just returns the filepath we use to save/load our URL mapping data. | BackgroundHttpFileHashHelper.h |