UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Platform.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "CoreMinimal.h"
6
7namespace BuildPatchServices
8{
16 {
17 public:
18 virtual ~IPlatform() {}
19
28 virtual bool ExecElevatedProcess(const TCHAR* URL, const TCHAR* Params, int32* OutReturnCode) = 0;
29
34 virtual void Sleep(float Seconds) = 0;
35
39 virtual uint32 GetLastError() = 0;
40 };
41
42 template <typename FPlatformProcessImpl, typename FPlatformMiscImpl>
44 : public IPlatform
45 {
46 public:
47
48 // IPlatform interface begin.
49 virtual bool ExecElevatedProcess(const TCHAR* URL, const TCHAR* Params, int32* OutReturnCode) override
50 {
51 return FPlatformProcessImpl::ExecElevatedProcess(URL, Params, OutReturnCode);
52 }
53
54 virtual void Sleep(float Seconds) override
55 {
56 FPlatformProcessImpl::SleepNoStats(Seconds);
57 }
58
59 virtual uint32 GetLastError() override
60 {
61 return FPlatformMiscImpl::GetLastError();
62 }
63 // IPlatform interface end.
64 };
65
66 // A typedef for the standard use platform type instantiation.
68
73 {
74 public:
79 static IPlatform* Create()
80 {
81 return new FPlatform();
82 }
83 };
84}
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
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
Definition Platform.h:73
static IPlatform * Create()
Definition Platform.h:79
Definition Platform.h:16
virtual void Sleep(float Seconds)=0
virtual uint32 GetLastError()=0
virtual ~IPlatform()
Definition Platform.h:18
virtual bool ExecElevatedProcess(const TCHAR *URL, const TCHAR *Params, int32 *OutReturnCode)=0
Definition Platform.h:45
virtual void Sleep(float Seconds) override
Definition Platform.h:54
virtual uint32 GetLastError() override
Definition Platform.h:59
virtual bool ExecElevatedProcess(const TCHAR *URL, const TCHAR *Params, int32 *OutReturnCode) override
Definition Platform.h:49
TPlatform< FPlatformProcess, FPlatformMisc > FPlatform
Definition Platform.h:67
Definition BuildPatchFileConstructor.h:28