Files
UnrealEngineUWP/Engine/Source/Programs/UnrealHeaderTool/Private/Specifiers/SpecifierArrays.cpp
marc audy 80986e13a9 UHT Additional cleanup
* Remove FNameLookupCPP struct and interface name maps. Overhead of managing/locking maps provides no benefit to the very simple Printf that it is ultimately doing.
* Remove unused FNameLookupCPP source file
* Remove GClassStrippedHeaderTextMap and GClassHeaderNameWithNoPathMap as they are unused
* No longer add Enum hashes to global table as they are not read.
* CheckedMetadataSpecifiers now stored as a FName keyed TMap as the incoming values are names not strings, so no need to convert name to string
#jira
#rnx
#rb


#ROBOMERGE-OWNER: marc.audy
#ROBOMERGE-AUTHOR: marc.audy
#ROBOMERGE-SOURCE: CL 10879228 via CL 10879328 via CL 10879344
#ROBOMERGE-BOT: (v626-10872990)

[CL 10880488 by marc audy in Main branch]
2020-01-06 12:52:50 -05:00

79 lines
2.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "CoreMinimal.h"
#include "UnrealHeaderTool.h"
#include "Misc/AssertionMacros.h"
#include "Misc/CString.h"
#include "CheckedMetadataSpecifiers.h"
#include "ClassMetadataSpecifiers.h"
#include "FunctionSpecifiers.h"
#include "InterfaceSpecifiers.h"
#include "StructSpecifiers.h"
#include "VariableSpecifiers.h"
#include "Algo/IsSorted.h"
const TCHAR* GFunctionSpecifierStrings[(int32)EFunctionSpecifier::Max] =
{
#define FUNCTION_SPECIFIER(SpecifierName) TEXT(#SpecifierName),
#include "FunctionSpecifiers.def"
#undef FUNCTION_SPECIFIER
};
const TCHAR* GStructSpecifierStrings[(int32)EStructSpecifier::Max] =
{
#define STRUCT_SPECIFIER(SpecifierName) TEXT(#SpecifierName),
#include "StructSpecifiers.def"
#undef STRUCT_SPECIFIER
};
const TCHAR* GInterfaceSpecifierStrings[(int32)EInterfaceSpecifier::Max] =
{
#define INTERFACE_SPECIFIER(SpecifierName) TEXT(#SpecifierName),
#include "InterfaceSpecifiers.def"
#undef INTERFACE_SPECIFIER
};
const TCHAR* GVariableSpecifierStrings[(int32)EVariableSpecifier::Max] =
{
#define VARIABLE_SPECIFIER(SpecifierName) TEXT(#SpecifierName),
#include "VariableSpecifiers.def"
#undef VARIABLE_SPECIFIER
};
const TMap<FName, ECheckedMetadataSpecifier> GCheckedMetadataSpecifiers(
{
#define CHECKED_METADATA_SPECIFIER(SpecifierName) { FName(#SpecifierName), ECheckedMetadataSpecifier::SpecifierName },
#include "CheckedMetadataSpecifiers.def"
#undef CHECKED_METADATA_SPECIFIER
});
const TCHAR* GClassMetadataSpecifierStrings[(int32)EClassMetadataSpecifier::Max] =
{
#define CLASS_METADATA_SPECIFIER(SpecifierName) TEXT(#SpecifierName),
#include "ClassMetadataSpecifiers.def"
#undef CLASS_METADATA_SPECIFIER
};
ECheckedMetadataSpecifier GetCheckedMetadataSpecifier(FName Key)
{
if (const ECheckedMetadataSpecifier* Specifier = GCheckedMetadataSpecifiers.Find(Key))
{
return *Specifier;
}
return ECheckedMetadataSpecifier::Max;
}
struct FCStringsLessThanCaseInsensitive
{
FORCEINLINE bool operator()(const TCHAR* Lhs, const TCHAR* Rhs)
{
return FCString::Stricmp(Lhs, Rhs) < 0;
}
};
const bool GIsGFunctionSpecifierStringsSorted = ensure(Algo::IsSorted(GFunctionSpecifierStrings, FCStringsLessThanCaseInsensitive()));
const bool GIsGStructSpecifierStringsSorted = ensure(Algo::IsSorted(GStructSpecifierStrings, FCStringsLessThanCaseInsensitive()));
const bool GIsGInterfaceSpecifierStringsSorted = ensure(Algo::IsSorted(GInterfaceSpecifierStrings, FCStringsLessThanCaseInsensitive()));
const bool GIsGVariableSpecifierStringsSorted = ensure(Algo::IsSorted(GVariableSpecifierStrings, FCStringsLessThanCaseInsensitive()));
const bool GIsGClassMetadataSpecifierStringsSorted = ensure(Algo::IsSorted(GClassMetadataSpecifierStrings, FCStringsLessThanCaseInsensitive()));