Remove UHTLite for now. Can be resurrected if need be.

#rb none
#rnx

#ROBOMERGE-OWNER: ben.marsh
#ROBOMERGE-AUTHOR: ben.marsh
#ROBOMERGE-SOURCE: CL 15489112 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
#ROBOMERGE-CONFLICT from-shelf

[CL 15489152 by ben marsh in ue5-main branch]
This commit is contained in:
ben marsh
2021-02-22 10:18:46 -04:00
parent 237655f8a3
commit fa683cebc6
54 changed files with 0 additions and 27906 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,210 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Containers/UnrealString.h"
class FToken;
/////////////////////////////////////////////////////
// FBaseParser
enum class ESymbolParseOption
{
Normal,
CloseTemplateBracket
};
// A specifier with optional value
struct FPropertySpecifier
{
public:
explicit FPropertySpecifier(FString&& InKey)
: Key(MoveTemp(InKey))
{
}
explicit FPropertySpecifier(const FString& InKey)
: Key(InKey)
{
}
FString Key;
TArray<FString> Values;
// UHTLite NOTE: Not required for code-gen. Will be refactored later.
/*
FString ConvertToString() const;
*/
};
//
// Base class of header parsers.
//
class FBaseParser
{
protected:
FBaseParser();
public:
// Input text.
const TCHAR* Input;
// Length of input text.
int32 InputLen;
// Current position in text.
int32 InputPos;
// Current line in text.
int32 InputLine;
// Position previous to last GetChar() call.
int32 PrevPos;
// Line previous to last GetChar() call.
int32 PrevLine;
// Previous comment parsed by GetChar() call.
FString PrevComment;
// Number of statements parsed.
int32 StatementsParsed;
// Total number of lines parsed.
int32 LinesParsed;
void ResetParser(const TCHAR* SourceBuffer, int32 StartingLineNumber = 1);
// Low-level parsing functions.
TCHAR GetChar( bool Literal = false );
TCHAR PeekChar();
TCHAR GetLeadingChar();
void UngetChar();
/**
* Tests if a character is an end-of-line character.
*
* @param c The character to test.
*
* @return true if c is an end-of-line character, false otherwise.
*/
static bool IsEOL( TCHAR c );
/**
* Tests if a character is a whitespace character.
*
* @param c The character to test.
*
* @return true if c is an whitespace character, false otherwise.
*/
static bool IsWhitespace( TCHAR c );
/**
* Gets the next token from the input stream, advancing the variables which keep track of the current input position and line.
*
* @param Token receives the value of the parsed text; if Token is pre-initialized, special logic is performed
* to attempt to evaluated Token in the context of that type. Useful for distinguishing between ambigous symbols
* like enum tags.
* @param NoConsts specify true to indicate that tokens representing literal const values are not allowed.
* @param ParseTemplateClosingBracket specify true to treat >> as two template closing brackets instead of shift operator.
*
* @return true if a token was successfully processed, false otherwise.
*/
bool GetToken( FToken& Token, bool bNoConsts = false, ESymbolParseOption bParseTemplateClosingBracket = ESymbolParseOption::Normal );
/**
* Put all text from the current position up to either EOL or the StopToken
* into Token. Advances the compiler's current position.
*
* @param Token [out] will contain the text that was parsed
* @param StopChar stop processing when this character is reached
*
* @return true if a token was parsed
*/
bool GetRawToken( FToken& Token, TCHAR StopChar = TCHAR('\n') );
// Doesn't quit if StopChar is found inside a double-quoted string, but does not support quote escapes
bool GetRawTokenRespectingQuotes( FToken& Token, TCHAR StopChar = TCHAR('\n') );
void UngetToken( const FToken& Token );
bool GetIdentifier( FToken& Token, bool bNoConsts = false );
// UHTLite NOTE: Not required for code-gen. Will be refactored later.
/*
bool GetSymbol( FToken& Token );
*/
/**
* Get an int constant
* @return true on success, otherwise false.
*/
bool GetConstInt(int32& Result, const TCHAR* Tag = NULL);
// UHTLite NOTE: Not required for code-gen. Will be refactored later.
/*
bool GetConstInt64(int64& Result, const TCHAR* Tag = NULL);
*/
// Matching predefined text.
// UHTLite NOTE: Not required for code-gen. Will be refactored later.
/*
bool MatchIdentifierByName( FName Match );
*/
bool MatchIdentifier( const TCHAR* Match, ESearchCase::Type SearchCase);
bool MatchConstInt( const TCHAR* Match );
bool MatchAnyConstInt();
// UHTLite NOTE: Not required for code-gen. Will be refactored later.
/*
bool PeekIdentifierByName( FName Match );
*/
bool PeekIdentifier( const TCHAR* Match, ESearchCase::Type SearchCase);
bool MatchSymbol( const TCHAR Match, ESymbolParseOption bParseTemplateClosingBracket = ESymbolParseOption::Normal );
bool MatchSymbol(const TCHAR* Match, ESymbolParseOption bParseTemplateClosingBracket = ESymbolParseOption::Normal);
void MatchSemi();
bool PeekSymbol( const TCHAR Match );
// Requiring predefined text.
void RequireIdentifier( const TCHAR* Match, ESearchCase::Type SearchCase, const TCHAR* Tag );
void RequireSymbol( const TCHAR Match, const TCHAR* Tag, ESymbolParseOption bParseTemplateClosingBracket = ESymbolParseOption::Normal );
void RequireSymbol(const TCHAR Match, TFunctionRef<FString()> TagGetter, ESymbolParseOption bParseTemplateClosingBracket = ESymbolParseOption::Normal);
// UHTLite NOTE: Not required for code-gen. Will be refactored later.
/*
void RequireConstInt( const TCHAR* Match, const TCHAR* Tag );
*/
void RequireAnyConstInt( const TCHAR* Tag );
/** Clears out the stored comment. */
void ClearComment();
// Reads a new-style value
//@TODO: UCREMOVAL: Needs a better name
FString ReadNewStyleValue(const TCHAR* TypeOfSpecifier);
// Reads ['(' Value [',' Value]* ')'] and places each value into the Items array
bool ReadOptionalCommaSeparatedListInParens(TArray<FString>& Items, const TCHAR* TypeOfSpecifier);
//////////////
// Complicated* parsing code that needs to be shared between the preparser and the parser
// (* i.e., doesn't really belong in the base parser)
// Expecting Name | (MODULE_API Name)
// Places Name into DeclaredName
// Places MODULE_API (where MODULE varies) into RequiredAPIMacroIfPresent
// FailureMessage is printed out if the expectation is broken.
void ParseNameWithPotentialAPIMacroPrefix(FString& DeclaredName, FString& RequiredAPIMacroIfPresent, const TCHAR* FailureMessage);
// Reads a set of specifiers (with optional values) inside the () of a new-style metadata macro like UPROPERTY or UFUNCTION
void ReadSpecifierSetInsideMacro(TArray<FPropertySpecifier>& SpecifiersFound, const TCHAR* TypeOfSpecifier, TMap<FName, FString>& MetaData);
// Validates and inserts one key-value pair into the meta data map
static void InsertMetaDataPair(TMap<FName, FString>& MetaData, FString InKey, FString InValue);
// Validates and inserts one key-value pair into the meta data map
static void InsertMetaDataPair(TMap<FName, FString>& MetaData, FName InKey, FString InValue);
//////////////
};

View File

@@ -1,72 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/NameTypes.h"
#include "Containers/Map.h"
#include "UObject/Class.h"
class FClass;
class FClasses;
struct FPropertySpecifier;
/** Structure that holds class meta data generated from its UCLASS declaration */
class FClassDeclarationMetaData
{
public:
FClassDeclarationMetaData();
EClassFlags ClassFlags;
TMap<FName, FString> MetaData;
FString ClassWithin;
FString ConfigName;
TArray<FString> HideCategories;
TArray<FString> ShowSubCatgories;
TArray<FString> HideFunctions;
TArray<FString> AutoExpandCategories;
TArray<FString> AutoCollapseCategories;
TArray<FString> DependsOn;
TArray<FString> ClassGroupNames;
TArray<FString> SparseClassDataTypes;
/**
* Parse Class's properties to generate its declaration data.
*
* @param InClassSpecifiers Class properties collected from its UCLASS macro
* @param InRequiredAPIMacroIfPresent *_API macro if present (empty otherwise)
* @param OutClassData Parsed class meta data
*/
void ParseClassProperties(TArray<FPropertySpecifier>&& InClassSpecifiers, const FString& InRequiredAPIMacroIfPresent);
/**
* Merges all category properties with the class which at this point only has its parent propagated categories
*
* @param Class Class to merge categories for
*/
void MergeClassCategories(FClass* Class);
/**
* Merges all class flags and validates them
*
* @param DeclaredClassName Name this class was declared with (for validation)
* @param PreviousClassFlags Class flags before resetting the class (for validation)
* @param Class Class to merge flags for
* @param AllClasses All known classes
*/
void MergeAndValidateClassFlags(const FString& DeclaredClassName, uint32 PreviousClassFlags, FClass* Class, const FClasses& AllClasses) const;
private:
/** Merges all 'show' categories */
void MergeShowCategories();
/** Sets and validates 'within' property */
void SetAndValidateWithinClass(FClass* Class, const FClasses& AllClasses) const;
/** Sets and validates 'ConfigName' property */
void SetAndValidateConfigName(FClass* Class) const;
TArray<FString> ShowCategories;
TArray<FString> ShowFunctions;
TArray<FString> DontAutoCollapseCategories;
mutable bool WantsToBePlaceable;
};

View File

@@ -1,31 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "ClassMaps.h"
#include "UnrealHeaderTool.h"
#include "UnrealTypeDefinitionInfo.h"
void FClassDeclarations::AddIfMissing(FName Name, TUniqueFunction<TSharedRef<FClassDeclarationMetaData>()>&& DeclConstructFunc)
{
FRWScopeLock Lock(ClassDeclLock, SLT_Write);
if (!ClassDeclarations.Contains(Name))
{
TSharedRef<FClassDeclarationMetaData> ClassDecl = DeclConstructFunc();
ClassDeclarations.Add(Name, MoveTemp(ClassDecl));
}
}
FClassDeclarationMetaData* FClassDeclarations::Find(FName Name) const
{
FRWScopeLock Lock(ClassDeclLock, SLT_ReadOnly);
if (const TSharedRef<FClassDeclarationMetaData>* ClassDecl = ClassDeclarations.Find(Name))
{
return &ClassDecl->Get();
}
return nullptr;
}
FClassDeclarationMetaData& FClassDeclarations::FindChecked(FName Name) const
{
FRWScopeLock Lock(ClassDeclLock, SLT_ReadOnly);
return ClassDeclarations.FindChecked(Name).Get();
}

View File

@@ -1,152 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/Stack.h"
#include "UObject/ErrorException.h"
#include "UnderlyingEnumType.h"
#include "UnrealSourceFile.h"
class UField;
class UClass;
class FProperty;
class UPackage;
class UEnum;
class FClassDeclarationMetaData;
class FArchive;
struct FManifestModule;
class FUnrealSourceFile;
class FUnrealTypeDefinitionInfo;
enum class ESerializerArchiveType
{
None,
Archive,
StructuredArchiveRecord
};
struct FArchiveTypeDefinePair
{
ESerializerArchiveType ArchiveType;
FString EnclosingDefine;
};
// Wrapper class around TypeDefinition map so we can maintain a parallel by name map
struct FTypeDefinitionInfoMap
{
void Add(UField* Field, TSharedRef<FUnrealTypeDefinitionInfo>&& Definition)
{
DefinitionsByField.Add(Field, Definition);
DefinitionsByName.Add(Field->GetFName(), MoveTemp(Definition));
}
bool Contains(const UField* Field) const
{
return DefinitionsByField.Contains(Field);
}
const TSharedRef<FUnrealTypeDefinitionInfo>* Find(const UField* Field) const
{
return DefinitionsByField.Find(Field);
}
const TSharedRef<FUnrealTypeDefinitionInfo>* FindByName(const FName Name) const
{
return DefinitionsByName.Find(Name);
}
const TSharedRef<FUnrealTypeDefinitionInfo>& operator[](const UField* Field) const
{
return DefinitionsByField[Field];
}
private:
TMap<UField*, TSharedRef<FUnrealTypeDefinitionInfo>> DefinitionsByField;
TMap<FName, TSharedRef<FUnrealTypeDefinitionInfo>> DefinitionsByName;
};
// Wrapper class around ClassDeclarations map so we can control access in a threadsafe manner
struct FClassDeclarations
{
void AddIfMissing(FName Name, TUniqueFunction<TSharedRef<FClassDeclarationMetaData>()>&& DeclConstructFunc);
FClassDeclarationMetaData* Find(FName Name) const;
FClassDeclarationMetaData& FindChecked(FName Name) const;
private:
TMap<FName, TSharedRef<FClassDeclarationMetaData>> ClassDeclarations;
mutable FRWLock ClassDeclLock;
};
// Wrapper class around SourceFiles map so we can quickly get a list of source files for a given package
struct FUnrealSourceFiles
{
void Add(FString&& Filename, TSharedRef<FUnrealSourceFile> SourceFile)
{
TSharedRef<FUnrealSourceFile>& Value = SourceFilesByString.FindOrAdd(MoveTemp(Filename), SourceFile);
if (Value != SourceFile)
{
FError::Throwf(TEXT("Duplicate filename found with different path '%s'."), *Value.Get().GetFilename());
}
SourceFilesByPackage.FindOrAdd(SourceFile->GetPackage()).Add(&SourceFile.Get());
}
const TSharedRef<FUnrealSourceFile>* Find(const FString& Id) const { return SourceFilesByString.Find(Id); }
const TArray<FUnrealSourceFile*>* FindFilesForPackage(const UPackage* Package) const { return SourceFilesByPackage.Find(Package); }
private:
// A map of all source files indexed by string.
TMap<FString, TSharedRef<FUnrealSourceFile>> SourceFilesByString;
// The list of source files per package. Stored as raw pointer since SourceFilesByString holds shared ref.
TMap<UPackage*, TArray<FUnrealSourceFile*>> SourceFilesByPackage;
};
// Wrapper class around PublicSourceFile set so we can quickly get a list of source files for a given package
struct FPublicSourceFileSet
{
void Add(FUnrealSourceFile* SourceFile)
{
SourceFileSet.Add(SourceFile);
SourceFilesByPackage.FindOrAdd(SourceFile->GetPackage()).Add(SourceFile);
}
bool Contains(FUnrealSourceFile* SourceFile) const { return SourceFileSet.Contains(SourceFile); }
const TArray<FUnrealSourceFile*>* FindFilesForPackage(const UPackage* Package) const { return SourceFilesByPackage.Find(Package); }
private:
// The set of all public source files. Stored as raw pointer since FUnrealSourceFiles::SourceFilesByString holds shared ref.
TSet<FUnrealSourceFile*> SourceFileSet;
// The list of public source files per package. Stored as raw pointer since FUnrealSourceFiles::SourceFilesByString holds shared ref.
TMap<UPackage*, TArray<FUnrealSourceFile*>> SourceFilesByPackage;
};
/** Types access specifiers. */
enum EAccessSpecifier
{
ACCESS_NotAnAccessSpecifier = 0,
ACCESS_Public,
ACCESS_Private,
ACCESS_Protected,
ACCESS_Num,
};
inline FArchive& operator<<(FArchive& Ar, EAccessSpecifier& ObjectType)
{
if (Ar.IsLoading())
{
int32 Value;
Ar << Value;
ObjectType = EAccessSpecifier(Value);
}
else if (Ar.IsSaving())
{
int32 Value = (int32)ObjectType;
Ar << Value;
}
return Ar;
}

View File

@@ -1,221 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "Classes.h"
#include "UnrealHeaderTool.h"
#include "UObject/ErrorException.h"
#include "UObject/Package.h"
#include "Templates/Casts.h"
#include "UObject/ObjectRedirector.h"
#include "StringUtils.h"
namespace
{
/**
* Returns True if the given class name includes a valid Unreal prefix and matches based on the given class.
*
* @param InNameToCheck - Name w/ potential prefix to check
* @param OriginalClass - Class to check against
*/
bool ClassNameHasValidPrefix(const FString& InNameToCheck, const FClass* OriginalClass)
{
bool bIsLabledDeprecated;
GetClassPrefix( InNameToCheck, bIsLabledDeprecated );
// If the class is labeled deprecated, don't try to resolve it during header generation, valid results can't be guaranteed.
if (bIsLabledDeprecated)
{
return true;
}
const FString OriginalClassName = OriginalClass->GetNameWithPrefix();
bool bNamesMatch = (InNameToCheck == OriginalClassName);
if (!bNamesMatch)
{
//@TODO: UCREMOVAL: I/U interface hack - Ignoring prefixing for this call
if (OriginalClass->HasAnyClassFlags(CLASS_Interface))
{
bNamesMatch = InNameToCheck.Mid(1) == OriginalClassName.Mid(1);
}
}
return bNamesMatch;
}
}
FClasses::FClasses(const TArray<UClass*>* Classes)
: UObjectClass((FClass*)UObject::StaticClass())
, ClassTree(UObjectClass)
{
if (Classes)
{
for (UClass* Class : *Classes)
{
ClassTree.AddClass(Class);
}
}
}
FClass* FClasses::GetRootClass() const
{
return UObjectClass;
}
bool FClasses::IsDependentOn(const FClass* Suspect, const FClass* Source) const
{
check(Suspect != Source);
TSet<const FClass*> VisitedDpendencies;
return IsDependentOn(Suspect, Source, VisitedDpendencies);
}
bool FClasses::IsDependentOn(const FClass* Suspect, const FClass* Source, TSet<const FClass*>& VisitedDpendencies) const
{
// Children are all implicitly dependent on their parent, that is, children require their parent
// to be compiled first therefore if the source is a parent of the suspect, the suspect is
// dependent on the source.
if (Suspect->IsChildOf(Source))
{
return true;
}
// Prevent circular #includes from causing infinite recursion
// Note that although it may mean there's a circular dependency somewhere, it does not
// necessarily mean it's the one we're looking for
if (VisitedDpendencies.Contains(Suspect))
{
return false;
}
else
{
VisitedDpendencies.Add(Suspect);
}
return false;
}
FClass* FClasses::FindClass(const TCHAR* ClassName) const
{
check(ClassName);
UObject* ClassPackage = ANY_PACKAGE;
if (UClass* Result = FindObject<UClass>(ClassPackage, ClassName))
{
return (FClass*)Result;
}
if (UObjectRedirector* RenamedClassRedirector = FindObject<UObjectRedirector>(ClassPackage, ClassName))
{
return (FClass*)CastChecked<UClass>(RenamedClassRedirector->DestinationObject);
}
return nullptr;
}
TArray<FClass*> FClasses::GetDerivedClasses(FClass* Parent) const
{
const FClassTree* ClassLeaf = ClassTree.FindNode(Parent);
TArray<const FClassTree*> ChildLeaves;
ClassLeaf->GetChildClasses(ChildLeaves);
TArray<FClass*> Result;
Result.Reserve(ChildLeaves.Num());
for (const FClassTree* Node : ChildLeaves)
{
Result.Add((FClass*)Node->GetClass());
}
return Result;
}
FClass* FClasses::FindAnyClass(const TCHAR* ClassName) const
{
check(ClassName);
return (FClass*)FindObject<UClass>(ANY_PACKAGE, ClassName);
}
FClass* FClasses::FindScriptClassOrThrow(const FString& InClassName) const
{
FString ErrorMsg;
if (FClass* Result = FindScriptClass(InClassName, &ErrorMsg))
{
return Result;
}
FError::Throwf(*ErrorMsg);
// Unreachable, but compiler will warn otherwise because FError::Throwf isn't declared noreturn
return 0;
}
FClass* FClasses::FindScriptClass(const FString& InClassName, FString* OutErrorMsg) const
{
// Strip the class name of its prefix and then do a search for the class
FString ClassNameStripped = GetClassNameWithPrefixRemoved(InClassName);
if (FClass* FoundClass = FindClass(*ClassNameStripped))
{
// If the class was found with the stripped class name, verify that the correct prefix was used and throw an error otherwise
if (!ClassNameHasValidPrefix(InClassName, FoundClass))
{
if (OutErrorMsg)
{
*OutErrorMsg = FString::Printf(TEXT("Class '%s' has an incorrect prefix, expecting '%s'"), *InClassName, *FoundClass->GetNameWithPrefix());
}
return nullptr;
}
return (FClass*)FoundClass;
}
// Couldn't find the class with a class name stripped of prefix (or a prefix was not found)
// See if the prefix was forgotten by trying to find the class with the given identifier
if (FClass* FoundClass = FindClass(*InClassName))
{
// If the class was found with the given identifier, the user forgot to use the correct Unreal prefix
if (OutErrorMsg)
{
*OutErrorMsg = FString::Printf(TEXT("Class '%s' is missing a prefix, expecting '%s'"), *InClassName, *FoundClass->GetNameWithPrefix());
}
}
else
{
// If the class was still not found, it wasn't a valid identifier
if (OutErrorMsg)
{
*OutErrorMsg = FString::Printf(TEXT("Class '%s' not found."), *InClassName);
}
}
return nullptr;
}
TArray<FClass*> FClasses::GetClassesInPackage(const UPackage* InPackage) const
{
TArray<FClass*> Result;
Result.Add(UObjectClass);
// This cast is evil, but it'll work until we get TArray covariance. ;-)
ClassTree.GetChildClasses((TArray<UClass*>&)Result, [=](const UClass* Class) { return InPackage == ANY_PACKAGE || Class->GetOuter() == InPackage; }, true);
return Result;
}
#if WIP_UHT_REFACTOR
void FClasses::ChangeParentClass(FClass* Class)
{
ClassTree.ChangeParentClass(Class);
}
bool FClasses::ContainsClass(const FClass* Class) const
{
return !!ClassTree.FindNode(const_cast<FClass*>(Class));
}
void FClasses::Validate()
{
ClassTree.Validate();
}
#endif

View File

@@ -1,110 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "ParserClass.h"
#include "UObject/ClassTree.h"
#define WIP_UHT_REFACTOR 1
class UPackage;
class FString;
class FClass;
class FClasses
{
public:
explicit FClasses(const TArray<UClass*>* Classes);
/**
* Returns the root class (i.e. UObject)
*
* @return The root class.
*/
FClass* GetRootClass() const;
/**
* Determines whether the class hierarchy rooted at Suspect is
* dependent on the hierarchy rooted at Source.
*
* @param Suspect Root of hierarchy for suspect class
* @param Source Root of hierarchy for source class
* @return true if the hierarchy rooted at Suspect is dependent on the one rooted at Source, false otherwise
*/
bool IsDependentOn(const FClass* Suspect, const FClass* Source) const;
FClass* FindClass(const TCHAR* ClassName) const;
TArray<FClass*> GetDerivedClasses(FClass* Parent) const;
FClass* FindAnyClass(const TCHAR* ClassName) const;
/**
* Attempts to find a script class based on the given name. Will attempt to strip
* the prefix of the given name while searching. Throws an exception with the script error
* if the class could not be found.
*
* @param InClassName Name w/ Unreal prefix to use when searching for a class
* @return The found class.
*/
FClass* FindScriptClassOrThrow(const FString& InClassName) const;
/**
* Attempts to find a script class based on the given name. Will attempt to strip
* the prefix of the given name while searching. Optionally returns script errors when appropriate.
*
* @param InClassName Name w/ Unreal prefix to use when searching for a class
* @param OutErrorMsg Error message (if any) giving the caller flexibility in how they present an error
* @return The found class, or NULL if the class was not found.
*/
FClass* FindScriptClass(const FString& InClassName, FString* OutErrorMsg = nullptr) const;
/**
* Returns an array of classes for the given package.
*
* @param InPackage The package to return the classes from.
* @return The classes in the specified package.
*/
TArray<FClass*> GetClassesInPackage(const UPackage* InPackage = ANY_PACKAGE) const;
// Anything in here should eventually be removed when this class encapsulates its own data structure, rather than being 'poked' by the outside
#if WIP_UHT_REFACTOR
/**
* Move a class node in the hierarchy tree after a class has changed its SuperClass
*
* @param SearchClass the class that has changed parents
* @param InNewParentClass if non-null force reparenting to this instead of the SuperClass
*
* @return true if SearchClass was successfully moved to the new location
*/
void ChangeParentClass(FClass* Class);
bool ContainsClass(const FClass* Class) const;
/**
* Validates the state of the tree (shouldn't be needed once this class has well-defined invariants).
*/
void Validate();
FORCEINLINE FClassTree& GetClassTree()
{
return ClassTree;
}
#endif
private:
FClass* UObjectClass;
FClassTree ClassTree;
/**
* Determines whether the class hierarchy rooted at Suspect is dependent on the hierarchy rooted at Source.
* Used by the public overload of IsDependentOn to recursively track dependencies and handle circular references
*/
bool IsDependentOn(const FClass* Suspect, const FClass* Source, TSet<const FClass*>& VisitedDpendencies) const;
friend auto begin(const FClasses& Classes) -> decltype(begin(TObjectRange<FClass>())) { return begin(TObjectRange<FClass>()); }
friend auto end (const FClasses& Classes) -> decltype(end (TObjectRange<FClass>())) { return end (TObjectRange<FClass>()); }
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,45 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "FileLineException.h"
#include "UnrealHeaderTool.h"
void VARARGS FFileLineException::ThrowfImpl(FString&& InFilename, int32 InLine, const TCHAR* Fmt, ...)
{
int32 BufferSize = 512;
TCHAR StartingBuffer[512];
TCHAR* Buffer = StartingBuffer;
int32 Result = -1;
// First try to print to a stack allocated location
GET_VARARGS_RESULT( Buffer, BufferSize, BufferSize-1, Fmt, Fmt, Result );
// If that fails, start allocating regular memory
if( Result == -1 )
{
Buffer = nullptr;
while(Result == -1)
{
BufferSize *= 2;
Buffer = (TCHAR*) FMemory::Realloc( Buffer, BufferSize * sizeof(TCHAR) );
GET_VARARGS_RESULT( Buffer, BufferSize, BufferSize-1, Fmt, Fmt, Result );
}
}
Buffer[Result] = 0;
FString ResultString(Buffer);
if( BufferSize != 512 )
{
FMemory::Free( Buffer );
}
throw FFileLineException(MoveTemp(ResultString), MoveTemp(InFilename), InLine);
}
FFileLineException::FFileLineException(FString&& InMessage, FString&& InFilename, int32 InLine)
: Message (MoveTemp(InMessage))
, Filename(MoveTemp(InFilename))
, Line (InLine)
{
}

View File

@@ -1,27 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Containers/UnrealString.h"
#include "Templates/IsValidVariadicFunctionArg.h"
struct FFileLineException
{
FString Message;
FString Filename;
int32 Line;
template <typename... Types>
UE_NORETURN static void VARARGS Throwf(FString&& Filename, int32 Line, const TCHAR* Fmt, Types... Args)
{
static_assert(TAnd<TIsValidVariadicFunctionArg<Types>...>::Value, "Invalid argument(s) passed to FError::Throwf");
ThrowfImpl(MoveTemp(Filename), Line, Fmt, Args...);
}
private:
UE_NORETURN static void VARARGS ThrowfImpl(FString&& Filename, int32 Line, const TCHAR* Fmt, ...);
FFileLineException(FString&& InMessage, FString&& InFilename, int32 InLine);
};

View File

@@ -1,56 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Containers/UnrealString.h"
class FArchive;
class FString;
//
// This MUST be kept in sync with EGeneratedBodyVersion in UBT defined in ExternalExecution.cs
// and with ToGeneratedBodyVersion function below
//
enum class EGeneratedCodeVersion : uint8
{
None,
V1,
V2,
VLatest = V2
};
inline FArchive& operator<<(FArchive& Ar, EGeneratedCodeVersion& Type)
{
if (Ar.IsLoading())
{
uint8 Value;
Ar << Value;
Type = (EGeneratedCodeVersion)Value;
}
else if (Ar.IsSaving())
{
uint8 Value = (uint8)Type;
Ar << Value;
}
return Ar;
}
inline EGeneratedCodeVersion ToGeneratedCodeVersion(const FString& InString)
{
if (InString.Compare(TEXT("V1")) == 0)
{
return EGeneratedCodeVersion::V1;
}
if (InString.Compare(TEXT("V2")) == 0)
{
return EGeneratedCodeVersion::V2;
}
if (InString.Compare(TEXT("VLatest")) == 0)
{
return EGeneratedCodeVersion::VLatest;
}
return EGeneratedCodeVersion::None;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,52 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "HeaderProvider.h"
#include "UnrealHeaderTool.h"
#include "UnrealTypeDefinitionInfo.h"
#include "ClassMaps.h"
FHeaderProvider::FHeaderProvider(EHeaderProviderSourceType InType, FString&& InId)//, bool bInAutoInclude/* = false*/)
: Type(InType)
, Id(MoveTemp(InId))
, Cache(nullptr)
{
}
FUnrealSourceFile* FHeaderProvider::Resolve(const FUnrealSourceFiles& UnrealSourceFilesMap, const FTypeDefinitionInfoMap& TypeDefinitionInfoMap)
{
if (Type != EHeaderProviderSourceType::Resolved)
{
if (Type == EHeaderProviderSourceType::ClassName)
{
FName IdName(*Id, FNAME_Find);
if (const TSharedRef<FUnrealTypeDefinitionInfo>* Source = TypeDefinitionInfoMap.FindByName(IdName))
{
Cache = &(*Source)->GetUnrealSourceFile();
}
}
else if (const TSharedRef<FUnrealSourceFile>* Source = UnrealSourceFilesMap.Find(Id))
{
Cache = &Source->Get();
}
Type = EHeaderProviderSourceType::Resolved;
}
return Cache;
}
FString FHeaderProvider::ToString() const
{
return FString::Printf(TEXT("%s %s"), Type == EHeaderProviderSourceType::ClassName ? TEXT("class") : TEXT("file"), *Id);
}
const FString& FHeaderProvider::GetId() const
{
return Id;
}
bool operator==(const FHeaderProvider& A, const FHeaderProvider& B)
{
return A.Type == B.Type && A.Id == B.Id;
}

View File

@@ -1,35 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Containers/UnrealString.h"
class FUnrealSourceFile;
enum class EHeaderProviderSourceType
{
ClassName,
FileName,
Resolved
};
class FHeaderProvider
{
friend bool operator==(const FHeaderProvider& A, const FHeaderProvider& B);
public:
FHeaderProvider(EHeaderProviderSourceType Type, FString&& Id);
FUnrealSourceFile* Resolve(const struct FUnrealSourceFiles& UnrealSourceFilesMap, const struct FTypeDefinitionInfoMap& TypeDefinitionInfoMap);
FString ToString() const;
const FString& GetId() const;
private:
EHeaderProviderSourceType Type;
FString Id;
FUnrealSourceFile* Cache;
};
bool operator==(const FHeaderProvider& A, const FHeaderProvider& B);

View File

@@ -1,74 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "IScriptGeneratorPluginInterface.h"
#include "UnrealHeaderTool.h"
#include "UObject/ErrorException.h"
#include "Algo/FindSortedStringCaseInsensitive.h"
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)
{
FError::Throwf(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)
{
FError::Throwf(TEXT("Unrecognized EPackageOverrideType name: %s"), Value);
}
static EPackageOverrideType::Type AlphabetizedValues[] = {
EditorOnly,
EngineDeveloper,
EngineUncookedOnly,
GameDeveloper,
GameUncookedOnly,
None
};
return AlphabetizedValues[TypeIndex];
}

View File

@@ -1,255 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "Manifest.h"
#include "UnrealHeaderTool.h"
#include "Misc/DateTime.h"
#include "Logging/LogMacros.h"
#include "HAL/FileManager.h"
#include "Misc/FileHelper.h"
#include "Misc/Paths.h"
#include "UObject/ErrorException.h"
#include "Misc/PackageName.h"
#include "UnrealHeaderToolGlobals.h"
#include "Serialization/JsonTypes.h"
#include "Serialization/JsonSerializer.h"
namespace
{
template <typename T> struct TJsonFieldType;
template <> struct TJsonFieldType<double> { static const EJson Value = EJson::Number; };
template <> struct TJsonFieldType<FString> { static const EJson Value = EJson::String; };
template <> struct TJsonFieldType<bool> { static const EJson Value = EJson::Boolean; };
template <> struct TJsonFieldType<TArray<TSharedPtr<FJsonValue>>> { static const EJson Value = EJson::Array; };
template <> struct TJsonFieldType<TSharedPtr<FJsonObject>> { static const EJson Value = EJson::Object; };
template <typename T>
void GetJsonValue(T& OutVal, const TSharedPtr<FJsonValue>& JsonValue, const TCHAR* Outer)
{
if (JsonValue->Type != TJsonFieldType<T>::Value)
{
FError::Throwf(TEXT("'%s' is the wrong type"), Outer);
}
JsonValue->AsArgumentType(OutVal);
}
template <typename T>
void GetJsonFieldValue(T& OutVal, const TSharedPtr<FJsonObject>& JsonObject, const TCHAR* FieldName, const TCHAR* Outer)
{
TSharedPtr<FJsonValue>* JsonValue = JsonObject->Values.Find(FieldName);
if (!JsonValue)
{
FError::Throwf(TEXT("Unable to find field '%s' in '%s'"), FieldName, Outer);
}
if ((*JsonValue)->Type != TJsonFieldType<T>::Value)
{
FError::Throwf(TEXT("Field '%s' in '%s' is the wrong type"), Outer);
}
(*JsonValue)->AsArgumentType(OutVal);
}
void ProcessHeaderArray(FString* OutStringArray, const TArray<TSharedPtr<FJsonValue>>& InJsonArray, const TCHAR* Outer)
{
for (int32 Index = 0, Count = InJsonArray.Num(); Index != Count; ++Index)
{
GetJsonValue(*OutStringArray++, InJsonArray[Index], *FString::Printf(TEXT("%s[%d]"), Outer, Index));
}
}
}
FManifest FManifest::LoadFromFile(const FString& Filename)
{
FManifest Result;
FString FilenamePath = FPaths::GetPath(Filename);
FString Json;
if (!FFileHelper::LoadFileToString(Json, *Filename))
{
FError::Throwf(TEXT("Unable to load manifest: %s"), *Filename);
}
TSharedPtr<FJsonObject> RootObject = TSharedPtr<FJsonObject>();
TSharedRef<TJsonReader<TCHAR>> Reader = TJsonReaderFactory<TCHAR>::Create(Json);
if (!FJsonSerializer::Deserialize(Reader, RootObject))
{
FError::Throwf(TEXT("Manifest is malformed: %s"), *Filename);
}
TArray<TSharedPtr<FJsonValue>> ModulesArray;
GetJsonFieldValue(Result.IsGameTarget, RootObject, TEXT("IsGameTarget"), TEXT("{manifest root}"));
GetJsonFieldValue(Result.RootLocalPath, RootObject, TEXT("RootLocalPath"), TEXT("{manifest root}"));
Result.RootBuildPath = Result.RootLocalPath + FPlatformMisc::GetDefaultPathSeparator();
GetJsonFieldValue(Result.TargetName, RootObject, TEXT("TargetName"), TEXT("{manifest root}"));
GetJsonFieldValue(Result.ExternalDependenciesFile, RootObject, TEXT("ExternalDependenciesFile"), TEXT("{manifest root}"));
GetJsonFieldValue(ModulesArray, RootObject, TEXT("Modules"), TEXT("{manifest root}"));
UE_LOG(LogCompile, Log, TEXT("Loaded manifest: %s"), *Filename);
UE_LOG(LogCompile, Log, TEXT("Manifest.IsGameTarget=%s"), Result.IsGameTarget ? TEXT("True") : TEXT("False"));
UE_LOG(LogCompile, Log, TEXT("Manifest.RootLocalPath=%s"), *Result.RootLocalPath);
UE_LOG(LogCompile, Log, TEXT("Manifest.RootBuildPath=%s"), *Result.RootBuildPath);
UE_LOG(LogCompile, Log, TEXT("Manifest.TargetName=%s"), *Result.TargetName);
UE_LOG(LogCompile, Log, TEXT("Manifest.Modules=%d"), ModulesArray.Num());
Result.RootLocalPath = FPaths::ConvertRelativePathToFull(FilenamePath, Result.RootLocalPath);
Result.RootBuildPath = FPaths::ConvertRelativePathToFull(FilenamePath, Result.RootBuildPath);
// Ensure directories end with a slash, because this aids their use with FPaths::MakePathRelativeTo.
if (!Result.RootLocalPath.EndsWith(TEXT("/")))
{
Result.RootLocalPath += TEXT("/");
}
if (!Result.RootBuildPath.EndsWith(TEXT("/")))
{
Result.RootBuildPath += TEXT("/");
}
int32 ModuleIndex = 0;
for (const TSharedPtr<FJsonValue>& Module : ModulesArray)
{
const TSharedPtr<FJsonObject>& ModuleObj = Module->AsObject();
TArray<TSharedPtr<FJsonValue>> ClassesHeaders;
TArray<TSharedPtr<FJsonValue>> PublicHeaders;
TArray<TSharedPtr<FJsonValue>> PrivateHeaders;
Result.Modules.AddZeroed();
FManifestModule& KnownModule = Result.Modules.Last();
FString Outer = FString::Printf(TEXT("Modules[%d]"), ModuleIndex);
FString GeneratedCodeVersionString;
GetJsonFieldValue(KnownModule.Name, ModuleObj, TEXT("Name"), *Outer);
GetJsonFieldValue(KnownModule.BaseDirectory, ModuleObj, TEXT("BaseDirectory"), *Outer);
GetJsonFieldValue(KnownModule.IncludeBase, ModuleObj, TEXT("IncludeBase"), *Outer);
GetJsonFieldValue(KnownModule.GeneratedIncludeDirectory, ModuleObj, TEXT("OutputDirectory"), *Outer);
GetJsonFieldValue(KnownModule.SaveExportedHeaders, ModuleObj, TEXT("SaveExportedHeaders"), *Outer);
GetJsonFieldValue(ClassesHeaders, ModuleObj, TEXT("ClassesHeaders"), *Outer);
GetJsonFieldValue(PublicHeaders, ModuleObj, TEXT("PublicHeaders"), *Outer);
GetJsonFieldValue(PrivateHeaders, ModuleObj, TEXT("PrivateHeaders"), *Outer);
GetJsonFieldValue(KnownModule.GeneratedCPPFilenameBase, ModuleObj, TEXT("GeneratedCPPFilenameBase"), *Outer);
GetJsonFieldValue(GeneratedCodeVersionString, ModuleObj, TEXT("UHTGeneratedCodeVersion"), *Outer);
KnownModule.GeneratedCodeVersion = ToGeneratedCodeVersion(GeneratedCodeVersionString);
FString ModuleTypeText;
GetJsonFieldValue(ModuleTypeText, ModuleObj, TEXT("ModuleType"), *Outer);
KnownModule.ModuleType = EBuildModuleType::Parse(*ModuleTypeText);
FString OverrideModuleTypeText;
GetJsonFieldValue(OverrideModuleTypeText, ModuleObj, TEXT("OverrideModuleType"), *Outer);
KnownModule.OverrideModuleType = EPackageOverrideType::Parse(*OverrideModuleTypeText);
KnownModule.LongPackageName = FPackageName::ConvertToLongScriptPackageName(*KnownModule.Name);
// Convert relative paths
KnownModule.BaseDirectory = FPaths::ConvertRelativePathToFull(FilenamePath, KnownModule.BaseDirectory);
KnownModule.IncludeBase = FPaths::ConvertRelativePathToFull(FilenamePath, KnownModule.IncludeBase);
KnownModule.GeneratedIncludeDirectory = FPaths::ConvertRelativePathToFull(FilenamePath, KnownModule.GeneratedIncludeDirectory);
KnownModule.GeneratedCPPFilenameBase = FPaths::ConvertRelativePathToFull(FilenamePath, KnownModule.GeneratedCPPFilenameBase);
// Ensure directories end with a slash, because this aids their use with FPaths::MakePathRelativeTo.
if (!KnownModule.BaseDirectory .EndsWith(TEXT("/"))) { KnownModule.BaseDirectory .AppendChar(TEXT('/')); }
if (!KnownModule.IncludeBase .EndsWith(TEXT("/"))) { KnownModule.IncludeBase .AppendChar(TEXT('/')); }
if (!KnownModule.GeneratedIncludeDirectory.EndsWith(TEXT("/"))) { KnownModule.GeneratedIncludeDirectory.AppendChar(TEXT('/')); }
KnownModule.PublicUObjectClassesHeaders.AddZeroed(ClassesHeaders.Num());
KnownModule.PublicUObjectHeaders .AddZeroed(PublicHeaders .Num());
KnownModule.PrivateUObjectHeaders .AddZeroed(PrivateHeaders.Num());
ProcessHeaderArray(KnownModule.PublicUObjectClassesHeaders.GetData(), ClassesHeaders, *(Outer + TEXT(".ClassHeaders")));
ProcessHeaderArray(KnownModule.PublicUObjectHeaders .GetData(), PublicHeaders , *(Outer + TEXT(".PublicHeaders" )));
ProcessHeaderArray(KnownModule.PrivateUObjectHeaders .GetData(), PrivateHeaders, *(Outer + TEXT(".PrivateHeaders")));
// Sort the headers alphabetically. This is just to add determinism to the compilation dependency order, since we currently
// don't rely on explicit includes (but we do support 'dependson')
// @todo uht: Ideally, we should sort these by sensical order before passing them in -- or better yet, follow include statements ourselves in here.
KnownModule.PublicUObjectClassesHeaders.Sort();
KnownModule.PublicUObjectHeaders .Sort();
KnownModule.PrivateUObjectHeaders .Sort();
UE_LOG(LogCompile, Log, TEXT(" %s"), *KnownModule.Name);
UE_LOG(LogCompile, Log, TEXT(" .BaseDirectory=%s"), *KnownModule.BaseDirectory);
UE_LOG(LogCompile, Log, TEXT(" .IncludeBase=%s"), *KnownModule.IncludeBase);
UE_LOG(LogCompile, Log, TEXT(" .GeneratedIncludeDirectory=%s"), *KnownModule.GeneratedIncludeDirectory);
UE_LOG(LogCompile, Log, TEXT(" .SaveExportedHeaders=%s"), KnownModule.SaveExportedHeaders ? TEXT("True") : TEXT("False"));
UE_LOG(LogCompile, Log, TEXT(" .GeneratedCPPFilenameBase=%s"), *KnownModule.GeneratedCPPFilenameBase);
UE_LOG(LogCompile, Log, TEXT(" .ModuleType=%s"), *ModuleTypeText);
++ModuleIndex;
}
return Result;
}
bool FManifestModule::NeedsRegeneration() const
{
if (ShouldForceRegeneration())
{
return true;
}
FString Timestamp;
TCHAR TimestampText[] = TEXT("Timestamp");
Timestamp.Empty(GeneratedIncludeDirectory.Len() + UE_ARRAY_COUNT(TimestampText));
Timestamp += GeneratedIncludeDirectory;
Timestamp += TEXT("Timestamp");
if (!FPaths::FileExists(Timestamp))
{
// No timestamp, must regenerate.
return true;
}
FDateTime TimestampFileLastModify = IFileManager::Get().GetTimeStamp(*Timestamp);
for (const FString& Header : PublicUObjectClassesHeaders)
{
if (IFileManager::Get().GetTimeStamp(*Header) > TimestampFileLastModify)
{
UE_LOG(LogCompile, Log, TEXT("File %s is newer than last timestamp. Regenerating reflection data for module %s."), *Header, *Name);
return true;
}
}
for (const FString& Header : PublicUObjectHeaders)
{
if (IFileManager::Get().GetTimeStamp(*Header) > TimestampFileLastModify)
{
UE_LOG(LogCompile, Log, TEXT("File %s is newer than last timestamp. Regenerating reflection data for module %s."), *Header, *Name);
return true;
}
}
for (const FString& Header : PrivateUObjectHeaders)
{
if (IFileManager::Get().GetTimeStamp(*Header) > TimestampFileLastModify)
{
UE_LOG(LogCompile, Log, TEXT("File %s is newer than last timestamp. Regenerating reflection data for module %s."), *Header, *Name);
return true;
}
}
// No header is newer than timestamp, no need to regenerate.
return false;
}
bool FManifestModule::IsCompatibleWith(const FManifestModule& ManifestModule)
{
return ModuleType == ManifestModule.ModuleType
&& SaveExportedHeaders == ManifestModule.SaveExportedHeaders
&& GeneratedCodeVersion == ManifestModule.GeneratedCodeVersion
&& Name == ManifestModule.Name
&& LongPackageName == ManifestModule.LongPackageName
&& BaseDirectory == ManifestModule.BaseDirectory
&& IncludeBase == ManifestModule.IncludeBase
&& GeneratedIncludeDirectory == ManifestModule.GeneratedIncludeDirectory
&& PublicUObjectClassesHeaders == ManifestModule.PublicUObjectClassesHeaders
&& PublicUObjectHeaders == ManifestModule.PublicUObjectHeaders
&& PrivateUObjectHeaders == ManifestModule.PrivateUObjectHeaders
&& GeneratedCPPFilenameBase == ManifestModule.GeneratedCPPFilenameBase;
}

View File

@@ -1,122 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "GeneratedCodeVersion.h"
#include "IScriptGeneratorPluginInterface.h"
class FArchive;
struct FManifestModule
{
/** The name of the module */
FString Name;
/** Module type */
EBuildModuleType::Type ModuleType;
/** Overridden package settings to add additional flags that can help with organization */
EPackageOverrideType::Type OverrideModuleType;
/** Long package name for this module's UObject class */
FString LongPackageName;
/** Base directory of this module on disk */
FString BaseDirectory;
/** The directory to which #includes from this module should be relative */
FString IncludeBase;
/** Directory where generated include files should go */
FString GeneratedIncludeDirectory;
/** List of C++ public 'Classes' header files with UObjects in them (legacy) */
TArray<FString> PublicUObjectClassesHeaders;
/** List of C++ public header files with UObjects in them */
TArray<FString> PublicUObjectHeaders;
/** List of C++ private header files with UObjects in them */
TArray<FString> PrivateUObjectHeaders;
/** Base (i.e. extensionless) path+filename of where to write out the module's .generated.* files */
FString GeneratedCPPFilenameBase;
/** Whether or not to write out headers that have changed */
bool SaveExportedHeaders;
/** Version of generated code. */
EGeneratedCodeVersion GeneratedCodeVersion;
/** Returns true if module headers were modified since last code generation. */
bool NeedsRegeneration() const;
/** Returns true if modules are compatible. Used to determine if module data can be loaded from makefile. */
bool IsCompatibleWith(const FManifestModule& ManifestModule);
friend FArchive& operator<<(FArchive& Ar, FManifestModule& ManifestModule)
{
Ar << ManifestModule.Name;
Ar << ManifestModule.ModuleType;
Ar << ManifestModule.OverrideModuleType;
Ar << ManifestModule.LongPackageName;
Ar << ManifestModule.BaseDirectory;
Ar << ManifestModule.IncludeBase;
Ar << ManifestModule.GeneratedIncludeDirectory;
Ar << ManifestModule.PublicUObjectClassesHeaders;
Ar << ManifestModule.PublicUObjectHeaders;
Ar << ManifestModule.PrivateUObjectHeaders;
Ar << ManifestModule.GeneratedCPPFilenameBase;
Ar << ManifestModule.SaveExportedHeaders;
Ar << ManifestModule.GeneratedCodeVersion;
return Ar;
}
bool ShouldForceRegeneration() const
{
return bForceRegeneration;
}
void ForceRegeneration()
{
bForceRegeneration = true;
}
private:
bool bForceRegeneration;
};
struct FManifest
{
bool IsGameTarget;
FString RootLocalPath;
FString RootBuildPath;
FString TargetName;
FString ExternalDependenciesFile;
/** Ordered list of modules that define UObjects or UStructs, which we may need to generate
code for. The list is in module dependency order, such that most dependent modules appear first. */
TArray<FManifestModule> Modules;
/**
* Loads a *.uhtmanifest from the specified filename.
*
* @param Filename The filename of the manifest to load.
* @return The loaded module info.
*/
static FManifest LoadFromFile(const FString& Filename);
friend FArchive& operator<<(FArchive& Ar, FManifest& Manifest)
{
Ar << Manifest.IsGameTarget;
Ar << Manifest.RootLocalPath;
Ar << Manifest.RootBuildPath;
Ar << Manifest.TargetName;
Ar << Manifest.Modules;
return Ar;
}
};

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More