UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
BuildPatchDelta.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
5#include "CoreMinimal.h"
6#include "HAL/Platform.h"
8
9namespace BuildPatchServices
10{
14 enum class EDeltaPolicy : uint32
15 {
16 // Try to fetch, but continue without if request fail.
17 TryFetchContinueWithout = 0,
18
19 // Expect the delta to exist, hard fail the installation if it could not be retrieved.
20 Expect,
21
22 // Expect the delta to not exist, skipping any attempt to use one.
23 Skip,
24
25 InvalidOrMax
26 };
27
34 BUILDPATCHSERVICES_API FString GetChunkDeltaFilename(const IBuildManifestRef& SourceManifest, const IBuildManifestRef& DestinationManifest);
35
37}
38
39static_assert((uint32)BuildPatchServices::EDeltaPolicy::InvalidOrMax == 3, "Please add support for the extra values to the Lex functions below.");
40
41inline const TCHAR* LexToString(BuildPatchServices::EDeltaPolicy DeltaPolicy)
42{
43#define CASE_ENUM_TO_STR(Value) case BuildPatchServices::EDeltaPolicy::Value: return TEXT(#Value)
44 switch (DeltaPolicy)
45 {
46 CASE_ENUM_TO_STR(TryFetchContinueWithout);
47 CASE_ENUM_TO_STR(Expect);
49 default: return TEXT("InvalidOrMax");
50 }
51#undef CASE_ENUM_TO_STR
52}
53
54inline void LexFromString(BuildPatchServices::EDeltaPolicy& DeltaPolicy, const TCHAR* Buffer)
55{
56#define RETURN_IF_EQUAL(Value) if (FCString::Stricmp(Buffer, TEXT(#Value)) == 0) { DeltaPolicy = BuildPatchServices::EDeltaPolicy::Value; return; }
57 const TCHAR* const Prefix = TEXT("EDeltaPolicy::");
58 const SIZE_T PrefixLen = FCString::Strlen(Prefix);
59 if (FCString::Strnicmp(Buffer, Prefix, PrefixLen) == 0)
60 {
62 }
63 RETURN_IF_EQUAL(TryFetchContinueWithout);
64 RETURN_IF_EQUAL(Expect);
66 // Did not match
67 DeltaPolicy = BuildPatchServices::EDeltaPolicy::InvalidOrMax;
68#undef RETURN_IF_EQUAL
69}
const TCHAR * LexToString(BuildPatchServices::EDeltaPolicy DeltaPolicy)
Definition BuildPatchDelta.h:41
#define CASE_ENUM_TO_STR(Value)
#define RETURN_IF_EQUAL(Value)
void LexFromString(BuildPatchServices::EDeltaPolicy &DeltaPolicy, const TCHAR *Buffer)
Definition BuildPatchDelta.h:54
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::SIZE_T SIZE_T
An unsigned integer the same size as a pointer, the same as UPTRINT.
Definition Platform.h:1150
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32_t uint32
Definition binka_ue_file_header.h:6
EDeltaPolicy
Definition BuildPatchDelta.h:15
Definition BuildPatchFileConstructor.h:28
BUILDPATCHSERVICES_API FString GetChunkDeltaFilename(const IBuildManifestRef &SourceManifest, const IBuildManifestRef &DestinationManifest)
BUILDPATCHSERVICES_API IBuildManifestPtr MergeDeltaManifest(const IBuildManifestRef &Manifest, const IBuildManifestRef &Delta)
static int32 Strlen(const CharType *String)
Definition CString.h:1047
static UE_FORCEINLINE_HINT int32 Strnicmp(const CharType *String1, const CharType *String2, SIZE_T Count)
Definition CString.h:1036