Files
UnrealEngineUWP/Engine/Source/Editor/TurnkeySupport/Private/TurnkeyWrapper.cpp
bryan sefcik 8cc129f2b6 IWYU Pass 1 - Engine/Source/Editor/...
#jira
#preflight 6306736ac85b7fef22be7751

[CL 21558583 by bryan sefcik in ue5-main branch]
2022-08-24 22:45:13 -04:00

61 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "Containers/Array.h"
#include "Containers/UnrealString.h"
#include "HAL/Platform.h"
#include "Logging/LogCategory.h"
#include "Logging/LogMacros.h"
#include "Trace/Detail/Channel.h"
#include "TurnkeySupport.h"
#include "UObject/NameTypes.h"
FString ConvertToDDPIPlatform(const FString& Platform)
{
FString New = Platform.Replace(TEXT("Editor"), TEXT("")).Replace(TEXT("Client"), TEXT("")).Replace(TEXT("Server"), TEXT(""));
if (New == TEXT("Win64"))
{
New = TEXT("Windows");
}
return New;
}
FName ConvertToDDPIPlatform(const FName& Platform)
{
return FName(*ConvertToDDPIPlatform(Platform.ToString()));
}
FString ConvertToUATPlatform(const FString& Platform)
{
FString New = ConvertToDDPIPlatform(Platform);
if (New == TEXT("Windows"))
{
New = TEXT("Win64");
}
return New;
}
FString ConvertToUATDeviceId(const FString& DeviceId)
{
TArray<FString> PlatformAndDevice;
int32 NumElems = DeviceId.ParseIntoArray(PlatformAndDevice, TEXT("@"), true);
if(NumElems < 2)
{
UE_LOG(LogTurnkeySupport, Fatal, TEXT("Badly formatted deviceId: %s"), *DeviceId);
}
return FString::Printf(TEXT("%s@%s"), *ConvertToUATPlatform(PlatformAndDevice[0]), *PlatformAndDevice[1]);
}
FString ConvertToDDPIDeviceId(const FString& DeviceId)
{
TArray<FString> PlatformAndDevice;
int32 NumElems = DeviceId.ParseIntoArray(PlatformAndDevice, TEXT("@"), true);
if(NumElems < 2)
{
UE_LOG(LogTurnkeySupport, Fatal, TEXT("Badly formatted deviceId: %s"), *DeviceId);
}
return FString::Printf(TEXT("%s@%s"), *ConvertToDDPIPlatform(PlatformAndDevice[0]), *PlatformAndDevice[1]);
}