Files
UnrealEngineUWP/Engine/Source/Programs/UnrealHeaderTool/Private/UHTMakefile/FileScopeArchiveProxy.cpp
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

56 lines
1.8 KiB
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#include "FileScopeArchiveProxy.h"
#include "UnrealHeaderTool.h"
#include "Scope.h"
#include "UHTMakefile.h"
FArchive& operator<<(FArchive& Ar, FFileScopeArchiveProxy& FileScopeArchiveProxy)
{
Ar << static_cast<FScopeArchiveProxy&>(FileScopeArchiveProxy);
Ar << FileScopeArchiveProxy.SourceFileIndex;
Ar << FileScopeArchiveProxy.Name;
Ar << FileScopeArchiveProxy.IncludedScopesIndexes;
return Ar;
}
FFileScopeArchiveProxy::FFileScopeArchiveProxy(const FUHTMakefile& UHTMakefile, const FFileScope* FileScope)
: FScopeArchiveProxy(UHTMakefile, FileScope)
{
SourceFileIndex = UHTMakefile.GetUnrealSourceFileIndex(FileScope->GetSourceFile());
Name = FNameArchiveProxy(UHTMakefile, FileScope->GetName());
IncludedScopesIndexes.Empty(FileScope->GetIncludedScopes().Num());
for (const FFileScope* IncludedScope : FileScope->GetIncludedScopes())
{
IncludedScopesIndexes.Add(UHTMakefile.GetFileScopeIndex(IncludedScope));
}
}
void FFileScopeArchiveProxy::AddReferencedNames(const FFileScope* FileScope, FUHTMakefile& UHTMakefile)
{
FScopeArchiveProxy::AddReferencedNames(FileScope, UHTMakefile);
UHTMakefile.AddName(FileScope->Name);
}
FFileScope* FFileScopeArchiveProxy::CreateFileScope(const FUHTMakefile& UHTMakefile) const
{
return new FFileScope(Name.CreateName(UHTMakefile), nullptr);
}
void FFileScopeArchiveProxy::PostConstruct(FFileScope* FileScope) const
{
}
void FFileScopeArchiveProxy::Resolve(FFileScope* FileScope, const FUHTMakefile& UHTMakefile) const
{
FScopeArchiveProxy::Resolve(FileScope, UHTMakefile);
FileScope->SetSourceFile(UHTMakefile.GetUnrealSourceFileByIndex(SourceFileIndex));
for (int32 Index : IncludedScopesIndexes)
{
FileScope->IncludeScope(UHTMakefile.GetFileScopeByIndex(Index));
}
}