UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
BuildPatchInstall.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "Containers/Set.h"
6#include "CoreMinimal.h"
7#include "HAL/Platform.h"
9
10namespace BuildPatchServices
11{
15 enum class EInstallMode : uint32
16 {
17 // Construct all required files, but only stage them ready to be completed later.
18 StageFiles = 0,
19
20 // Full installation, allowing immediate changes to be made to existing files. The installation is unusable until complete.
21 DestructiveInstall,
22
23 // Full installation, staging all required files before moving them all into place in a final step. The installation is still usable if canceled before the moving staging begins.
24 NonDestructiveInstall,
25
26 // Execute the prerequisite installer only, downloading it first if necessary. If the specified manifest has no prerequisites, this will result in an error.
27 PrereqOnly,
28
29 InvalidOrMax
30 };
31
32 BUILDPATCHSERVICES_API uint64 CalculateRequiredDiskSpace(const IBuildManifestPtr& CurrentManifest, const IBuildManifestRef& BuildManifest, const EInstallMode& InstallMode, const TSet<FString>& InstallTags);
33}
34
35static_assert((uint32)BuildPatchServices::EInstallMode::InvalidOrMax == 4, "Please add support for the extra values to the Lex functions below.");
36
37inline const TCHAR* LexToString(BuildPatchServices::EInstallMode InstallMode)
38{
39#define CASE_ENUM_TO_STR(Value) case BuildPatchServices::EInstallMode::Value: return TEXT(#Value)
40 switch (InstallMode)
41 {
42 CASE_ENUM_TO_STR(StageFiles);
43 CASE_ENUM_TO_STR(DestructiveInstall);
44 CASE_ENUM_TO_STR(NonDestructiveInstall);
45 CASE_ENUM_TO_STR(PrereqOnly);
46 default: return TEXT("InvalidOrMax");
47 }
48#undef CASE_ENUM_TO_STR
49}
50
51inline void LexFromString(BuildPatchServices::EInstallMode& InstallMode, const TCHAR* Buffer)
52{
53#define RETURN_IF_EQUAL(Value) if (FCString::Stricmp(Buffer, TEXT(#Value)) == 0) { InstallMode = BuildPatchServices::EInstallMode::Value; return; }
54 const TCHAR* const Prefix = TEXT("EInstallMode::");
55 const SIZE_T PrefixLen = FCString::Strlen(Prefix);
56 if (FCString::Strnicmp(Buffer, Prefix, PrefixLen) == 0)
57 {
59 }
60 RETURN_IF_EQUAL(StageFiles);
61 RETURN_IF_EQUAL(DestructiveInstall);
62 RETURN_IF_EQUAL(NonDestructiveInstall);
63 RETURN_IF_EQUAL(PrereqOnly);
64 // Did not match
65 InstallMode = BuildPatchServices::EInstallMode::InvalidOrMax;
66#undef RETURN_IF_EQUAL
67}
const TCHAR * LexToString(BuildPatchServices::EInstallMode InstallMode)
Definition BuildPatchInstall.h:37
#define CASE_ENUM_TO_STR(Value)
#define RETURN_IF_EQUAL(Value)
void LexFromString(BuildPatchServices::EInstallMode &InstallMode, const TCHAR *Buffer)
Definition BuildPatchInstall.h:51
#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
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
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
EInstallMode
Definition BuildPatchInstall.h:16
Definition BuildPatchFileConstructor.h:28
BUILDPATCHSERVICES_API uint64 CalculateRequiredDiskSpace(const IBuildManifestPtr &CurrentManifest, const IBuildManifestRef &BuildManifest, const EInstallMode &InstallMode, const TSet< FString > &InstallTags)
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