2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-04-23 18:42:01 -04:00
|
|
|
|
|
|
|
|
#include "UnrealHeaderTool.h"
|
2014-08-15 16:12:22 -04:00
|
|
|
#include "ParserClass.h"
|
2014-06-02 07:02:29 -04:00
|
|
|
#include "Classes.h"
|
2014-04-23 18:42:01 -04:00
|
|
|
#include "ClassMaps.h"
|
|
|
|
|
|
|
|
|
|
FString FClass::GetNameWithPrefix(EEnforceInterfacePrefix::Type EnforceInterfacePrefix) const
|
|
|
|
|
{
|
|
|
|
|
const TCHAR* Prefix = 0;
|
|
|
|
|
|
|
|
|
|
if (HasAnyClassFlags(CLASS_Interface))
|
|
|
|
|
{
|
|
|
|
|
// Grab the expected prefix for interfaces (U on the first one, I on the second one)
|
|
|
|
|
switch (EnforceInterfacePrefix)
|
|
|
|
|
{
|
|
|
|
|
case EEnforceInterfacePrefix::None:
|
|
|
|
|
// For old-style files: "I" for interfaces, unless it's the actual "Interface" class, which gets "U"
|
|
|
|
|
if (GetFName() == NAME_Interface)
|
|
|
|
|
{
|
|
|
|
|
Prefix = TEXT("U");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Prefix = TEXT("I");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case EEnforceInterfacePrefix::I:
|
|
|
|
|
Prefix = TEXT("I");
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case EEnforceInterfacePrefix::U:
|
|
|
|
|
Prefix = TEXT("U");
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
check(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Get the expected class name with prefix
|
|
|
|
|
Prefix = GetPrefixCPP();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return FString::Printf(TEXT("%s%s"), Prefix, *GetName());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FClass* FClass::GetSuperClass() const
|
|
|
|
|
{
|
|
|
|
|
return static_cast<FClass*>(static_cast<const UClass*>(this)->GetSuperClass());
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-02 07:02:29 -04:00
|
|
|
FClass* FClass::GetClassWithin() const
|
|
|
|
|
{
|
|
|
|
|
return (FClass*)ClassWithin;
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-23 18:42:01 -04:00
|
|
|
TArray<FClass*> FClass::GetInterfaceTypes() const
|
|
|
|
|
{
|
|
|
|
|
TArray<FClass*> Result;
|
|
|
|
|
for (auto& i : Interfaces)
|
|
|
|
|
{
|
|
|
|
|
Result.Add((FClass*)i.Class);
|
|
|
|
|
}
|
|
|
|
|
return Result;
|
|
|
|
|
}
|
2014-07-11 15:13:57 -04:00
|
|
|
|
|
|
|
|
void FClass::GetHideCategories(TArray<FString>& OutHideCategories) const
|
|
|
|
|
{
|
|
|
|
|
static const FName NAME_HideCategories(TEXT("HideCategories"));
|
|
|
|
|
if (HasMetaData(NAME_HideCategories))
|
|
|
|
|
{
|
|
|
|
|
const FString& HideCategories = GetMetaData(NAME_HideCategories);
|
2015-03-02 15:51:37 -05:00
|
|
|
HideCategories.ParseIntoArray(OutHideCategories, TEXT(" "), true);
|
2014-07-11 15:13:57 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FClass::GetShowCategories(TArray<FString>& OutShowCategories) const
|
|
|
|
|
{
|
|
|
|
|
static const FName NAME_ShowCategories(TEXT("ShowCategories"));
|
|
|
|
|
if (HasMetaData(NAME_ShowCategories))
|
|
|
|
|
{
|
|
|
|
|
const FString& ShowCategories = GetMetaData(NAME_ShowCategories);
|
2015-03-02 15:51:37 -05:00
|
|
|
ShowCategories.ParseIntoArray(OutShowCategories, TEXT(" "), true);
|
2014-07-11 15:13:57 -04:00
|
|
|
}
|
|
|
|
|
}
|