Files
UnrealEngineUWP/Engine/Source/Programs/UnrealHeaderTool/Private/IScriptGeneratorPluginInterface.cpp
Tim Smith 6dbd708a7b Removed the usage of FError::Throwf and the need for HeaderParser to set a logging context.
#rb self
#rnx
#preflight 60ae3f7f6905a60001243752

[CL 16468733 by Tim Smith in ue5-main branch]
2021-05-26 09:54:27 -04:00

77 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "IScriptGeneratorPluginInterface.h"
#include "Exceptions.h"
#include "UnrealHeaderTool.h"
#include "Algo/FindSortedStringCaseInsensitive.h"
extern FString GManifestFilename; // This is a bit of a hack...
EBuildModuleType::Type EBuildModuleType::Parse(const TCHAR* Value)
{
static const TCHAR* AlphabetizedTypes[] = {
TEXT("EngineDeveloper"),
TEXT("EngineEditor"),
TEXT("EngineRuntime"),
TEXT("EngineThirdParty"),
TEXT("EngineUncooked"),
TEXT("GameDeveloper"),
TEXT("GameEditor"),
TEXT("GameRuntime"),
TEXT("GameThirdParty"),
TEXT("GameUncooked"),
TEXT("Program")
};
int32 TypeIndex = Algo::FindSortedStringCaseInsensitive(Value, AlphabetizedTypes);
if (TypeIndex < 0)
{
FUHTException::Throwf(FString(GManifestFilename), 1, TEXT("Unrecognized EBuildModuleType name: %s"), Value);
}
static EBuildModuleType::Type AlphabetizedValues[] = {
EngineDeveloper,
EngineEditor,
EngineRuntime,
EngineThirdParty,
EngineUncooked,
GameDeveloper,
GameEditor,
GameRuntime,
GameThirdParty,
GameUncooked,
Program
};
return AlphabetizedValues[TypeIndex];
}
EPackageOverrideType::Type EPackageOverrideType::Parse(const TCHAR* Value)
{
static const TCHAR* AlphabetizedTypes[] = {
TEXT("EditorOnly"),
TEXT("EngineDeveloper"),
TEXT("EngineUncookedOnly"),
TEXT("GameDeveloper"),
TEXT("GameUncookedOnly"),
TEXT("None"),
};
int32 TypeIndex = Algo::FindSortedStringCaseInsensitive(Value, AlphabetizedTypes);
if (TypeIndex < 0)
{
FUHTException::Throwf(FString(GManifestFilename), 1, TEXT("Unrecognized EPackageOverrideType name: %s"), Value);
}
static EPackageOverrideType::Type AlphabetizedValues[] = {
EditorOnly,
EngineDeveloper,
EngineUncookedOnly,
GameDeveloper,
GameUncookedOnly,
None
};
return AlphabetizedValues[TypeIndex];
}