UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FBuildPatchUtils Struct Reference

#include <BuildPatchUtil.h>

Static Public Member Functions

static FString GetChunkNewFilename (BuildPatchServices::EFeatureLevel FeatureLevel, const FGuid &ChunkGUID, const uint64 &ChunkHash)
 
static FString GetFileNewFilename (BuildPatchServices::EFeatureLevel FeatureLevel, const FGuid &FileGUID, const FSHAHash &FileHash)
 
static FString GetFileNewFilename (BuildPatchServices::EFeatureLevel FeatureLevel, const FGuid &FileGUID, const uint64 &FilePartHash)
 
static void GetChunkDetailFromNewFilename (const FString &ChunkNewFilename, FGuid &ChunkGUID, uint64 &ChunkHash)
 
static void GetFileDetailFromNewFilename (const FString &FileNewFilename, FGuid &FileGUID, FSHAHash &FileHash)
 
static FString GetChunkOldFilename (const FGuid &ChunkGUID)
 
static FString GetFileOldFilename (const FGuid &FileGUID)
 
static FString GetDataTypeOldFilename (EBuildPatchDataType DataType, const FGuid &Guid)
 
static FString GetDataFilename (const FBuildPatchAppManifestRef &Manifest, const FGuid &DataGUID)
 
static FString GetDataFilename (const FBuildPatchAppManifest &Manifest, const FGuid &DataGUID)
 
static bool GetGUIDFromFilename (const FString &DataFilename, FGuid &DataGUID)
 
static FString GenerateNewBuildId ()
 
static FString GetBackwardsCompatibleBuildId (const BuildPatchServices::FManifestMeta &ManifestMeta)
 
static FString GetChunkDeltaDirectory (const FBuildPatchAppManifest &DestinationManifest)
 
static FString GetChunkDeltaFilename (const FBuildPatchAppManifest &SourceManifest, const FBuildPatchAppManifest &DestinationManifest)
 
static uint8 VerifyFile (BuildPatchServices::IFileSystem *FileSystem, const FString &FileToVerify, const FSHAHash &Hash1, const FSHAHash &Hash2, FBuildPatchFloatDelegate ProgressDelegate, FBuildPatchBoolRetDelegate ShouldPauseDelegate, FBuildPatchBoolRetDelegate ShouldAbortDelegate)
 
static uint8 VerifyFile (BuildPatchServices::IFileSystem *FileSystem, const FString &FileToVerify, const FSHAHash &Hash1, const FSHAHash &Hash2)
 
static uint64 CalculateDiskSpaceRequirementsWithDeleteDuringInstall (const TArray< FString > &InFilesToConstruct, int32 InCompletedFileCount, BuildPatchServices::IBuildManifestSet *InManifestSet, const TArray< uint64 > &InChunkDbSizesAtPosition, uint64 InTotalChunkDbSize)
 

Detailed Description

Some utility functions

Member Function Documentation

◆ CalculateDiskSpaceRequirementsWithDeleteDuringInstall()

uint64 FBuildPatchUtils::CalculateDiskSpaceRequirementsWithDeleteDuringInstall ( const TArray< FString > &  InFilesToConstruct,
int32  InCompletedFileCount,
BuildPatchServices::IBuildManifestSet InManifestSet,
const TArray< uint64 > &  InChunkDbSizesAtPosition,
uint64  InTotalChunkDbSize 
)
static

◆ GenerateNewBuildId()

FString FBuildPatchUtils::GenerateNewBuildId ( )
static

Generates a new BuildId for a manifest. This should be used only when creating new builds, and thus saving out brand new manifests rather than copies of manifests.

Returns
the generated id.

◆ GetBackwardsCompatibleBuildId()

FString FBuildPatchUtils::GetBackwardsCompatibleBuildId ( const BuildPatchServices::FManifestMeta ManifestMeta)
static

Creates a deterministic BuildId for use with a manifest that is at EFeatureLevel::UsesRuntimeGeneratedBuildId or older. The id is created based on the meta data, which itself should be unique per build created.

Parameters
ManifestMetaThe meta for the old manifest.
Returns
the id for this manifest.

◆ GetChunkDeltaDirectory()

FString FBuildPatchUtils::GetChunkDeltaDirectory ( const FBuildPatchAppManifest DestinationManifest)
static

Based on the destination manifest, get the directory that will contains the deltas for getting to it from other builds.

Parameters
DestinationManifestThe destination manifest.
Returns
the CloudDir relative delta directory.

◆ GetChunkDeltaFilename()

FString FBuildPatchUtils::GetChunkDeltaFilename ( const FBuildPatchAppManifest SourceManifest,
const FBuildPatchAppManifest DestinationManifest 
)
static

Based on the source and destination manifests, get the filename for the delta that optimises patching from source to destination.

Parameters
SourceManifestThe source manifest.
DestinationManifestThe destination manifest.
Returns
the CloudDir relative delta filename.

◆ GetChunkDetailFromNewFilename()

void FBuildPatchUtils::GetChunkDetailFromNewFilename ( const FString &  ChunkNewFilename,
FGuid ChunkGUID,
uint64 ChunkHash 
)
static

Gets the chunk GUID and Hash, from the filename, which is the new format.

Parameters
ChunkNewFilenameIN The chunk filename that would have been generated from GetChunkNewFilename
ChunkGuidOUT The chunk Guid
ChunkHashOUT The chunk rolling hash value

◆ GetChunkNewFilename()

FString FBuildPatchUtils::GetChunkNewFilename ( BuildPatchServices::EFeatureLevel  FeatureLevel,
const FGuid ChunkGUID,
const uint64 ChunkHash 
)
static

Gets the the relative cloud filename for a chunk generated from it's GUID and Hash, which is the new format.

Parameters
FeatureLevelThe manifest version that references this chunk.
ChunkGuidThe chunk Guid.
ChunkHashThe chunk rolling hash value.
Returns
the chunk path.

◆ GetChunkOldFilename()

FString FBuildPatchUtils::GetChunkOldFilename ( const FGuid ChunkGUID)
static

Gets the the relative cloud filename for a chunk generated from it's GUID

Parameters
ChunkGuidThe chunk Guid
Returns
the chunk path

◆ GetDataFilename() [1/2]

FString FBuildPatchUtils::GetDataFilename ( const FBuildPatchAppManifest Manifest,
const FGuid DataGUID 
)
static

◆ GetDataFilename() [2/2]

FString FBuildPatchUtils::GetDataFilename ( const FBuildPatchAppManifestRef Manifest,
const FGuid DataGUID 
)
static

Gets the relative cloud filename for any data part. Wraps the choice between all of the above

Parameters
ManifestThe manifest referencing this data
DataGUIDThe data Guid
Returns
the data part path

◆ GetDataTypeOldFilename()

FString FBuildPatchUtils::GetDataTypeOldFilename ( EBuildPatchDataType  DataType,
const FGuid Guid 
)
static

Gets the filename for a specific data part type from it's GUID

Parameters
DataTypeThe type of data
DataGUIDThe data Guid
Returns
the data part path

◆ GetFileDetailFromNewFilename()

void FBuildPatchUtils::GetFileDetailFromNewFilename ( const FString &  FileNewFilename,
FGuid FileGUID,
FSHAHash FileHash 
)
static

Gets the file chunk GUID and file hash, from the filename, which is the new format.

Parameters
FileNewFilenameIN The file chunk filename that would have been generated from GetChunkNewFilename
FileGUIDOUT The file chunk Guid
FileHashOUT The file chunk rolling hash value

◆ GetFileNewFilename() [1/2]

static FString FBuildPatchUtils::GetFileNewFilename ( BuildPatchServices::EFeatureLevel  FeatureLevel,
const FGuid FileGUID,
const FSHAHash FileHash 
)
static

Gets the the relative cloud filename for a file chunk generated from it's GUID and Hash, which is the new format.

Parameters
FeatureLevelThe manifest version that references this file.
FileGUIDThe file chunk Guid.
FileHashThe file hash value.
Returns
the file chunk path.

◆ GetFileNewFilename() [2/2]

static FString FBuildPatchUtils::GetFileNewFilename ( BuildPatchServices::EFeatureLevel  FeatureLevel,
const FGuid FileGUID,
const uint64 FilePartHash 
)
static

◆ GetFileOldFilename()

FString FBuildPatchUtils::GetFileOldFilename ( const FGuid FileGUID)
static

Gets the the relative cloud filename for a file data part generated from it's GUID

Parameters
FileGUIDThe file part Guid
Returns
The file data path

◆ GetGUIDFromFilename()

bool FBuildPatchUtils::GetGUIDFromFilename ( const FString &  DataFilename,
FGuid DataGUID 
)
static

Gets the GUID for a data file according to it's filename (new or old)

Parameters
DataFilenameIN The data filename, or URL
DataGUIDOUT Receives the GUID of the data
Returns
True if successful, false otherwise

◆ VerifyFile() [1/2]

uint8 FBuildPatchUtils::VerifyFile ( BuildPatchServices::IFileSystem FileSystem,
const FString &  FileToVerify,
const FSHAHash Hash1,
const FSHAHash Hash2 
)
static

Checks a file against SHA1 hashes. The function takes two so that it can return no match, match with Hash1, or match with Hash2, that way we can check the file for being the same as an old manifest or new manifest NOTE: This function is blocking and will not return until finished. Don't run on main thread. This allows the above function to be easily called without delegates

Parameters
FileSystemIN Interface to disk access.
FileToVerifyIN The file to analyze.
Hash1IN A Hash to match against the file
Hash2IN A second Hash to match against the file
Returns
0 if no match, 1 for match with Hash1, and 2 for match with Hash2

◆ VerifyFile() [2/2]

uint8 FBuildPatchUtils::VerifyFile ( BuildPatchServices::IFileSystem FileSystem,
const FString &  FileToVerify,
const FSHAHash Hash1,
const FSHAHash Hash2,
FBuildPatchFloatDelegate  ProgressDelegate,
FBuildPatchBoolRetDelegate  ShouldPauseDelegate,
FBuildPatchBoolRetDelegate  ShouldAbortDelegate 
)
static

Checks a file against SHA1 hashes. The function takes two so that it can return no match, match with Hash1, or match with Hash2, that way we can check the file for being the same as an old manifest or new manifest NOTE: This function is blocking and will not return until finished. Don't run on main thread.

Parameters
FileSystemIN Interface to disk access.
FileToVerifyIN The file to analyze.
Hash1IN A Hash to match against the file
Hash2IN A second Hash to match against the file
ProgressDelegateIN Delegate to receive progress updates in the form of a float range 0.0f to 1.0f
ShouldPauseDelegateIN Delegate that returns a bool, which if true will pause the process
ShouldAbortDelegateIN Delegate that returns a bool, which if true will abort the process
Returns
0 if no match, 1 for match with Hash1, and 2 for match with Hash2

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