You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#preflight 6310bc97840bf1e5c376171e #rb pj.kack [CL 21759776 by carlmagnus nordin in ue5-main branch]
78 lines
2.2 KiB
C++
78 lines
2.2 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "IO/PackageId.h"
|
|
#include "IO/PackageStore.h"
|
|
#include "Misc/PackagePath.h"
|
|
|
|
struct FIoContainerHeader;
|
|
struct FFilePackageStoreEntry;
|
|
|
|
/*
|
|
* File/container based package store.
|
|
*/
|
|
class FFilePackageStoreBackend
|
|
: public IPackageStoreBackend
|
|
{
|
|
public:
|
|
FFilePackageStoreBackend();
|
|
virtual ~FFilePackageStoreBackend();
|
|
|
|
virtual void OnMounted(TSharedRef<const FPackageStoreBackendContext>) override
|
|
{
|
|
}
|
|
|
|
virtual void BeginRead() override;
|
|
virtual void EndRead() override;
|
|
virtual EPackageStoreEntryStatus GetPackageStoreEntry(FPackageId PackageId, FPackageStoreEntry& OutPackageStoreEntry) override;
|
|
virtual bool GetPackageRedirectInfo(FPackageId PackageId, FName& OutSourcePackageName, FPackageId& OutRedirectedToPackageId) override;
|
|
|
|
void Mount(const FIoContainerHeader* ContainerHeader, uint32 Order);
|
|
void Unmount(const FIoContainerHeader* ContainerHeader);
|
|
|
|
private:
|
|
struct FMountedContainer
|
|
{
|
|
const FIoContainerHeader* ContainerHeader;
|
|
uint32 Order;
|
|
uint32 Sequence;
|
|
};
|
|
|
|
#if WITH_EDITOR
|
|
struct FUncookedPackage
|
|
{
|
|
FName PackageName;
|
|
EPackageExtension HeaderExtension;
|
|
};
|
|
#endif //if WITH_EDITOR
|
|
|
|
void Update();
|
|
#if WITH_EDITOR
|
|
uint64 AddUncookedPackagesFromRoot(const FString& RootPath);
|
|
uint64 RemoveUncookedPackagesFromRoot(const TSet<FString>& RootPath);
|
|
#endif //if WITH_EDITOR
|
|
|
|
FRWLock EntriesLock;
|
|
FCriticalSection UpdateLock;
|
|
TArray<FMountedContainer> MountedContainers;
|
|
TAtomic<uint32> NextSequence{ 0 };
|
|
TMap<FPackageId, const FFilePackageStoreEntry*> StoreEntriesMap;
|
|
TMap<FPackageId, TTuple<FName, FPackageId>> RedirectsPackageMap;
|
|
TMap<FPackageId, FName> LocalizedPackages;
|
|
bool bNeedsContainerUpdate = false;
|
|
|
|
#if WITH_EDITOR
|
|
FDelegateHandle OnContentPathMountedDelegateHandle;
|
|
FDelegateHandle OnContentPathDismountedDelegateHandle;
|
|
FCriticalSection UncookedPackageRootsLock;
|
|
TSet<FString> PendingAddUncookedPackageRoots;
|
|
TSet<FString> PendingRemoveUncookedPackageRoots;
|
|
TMap<FPackageId, FUncookedPackage> UncookedPackagesMap;
|
|
TMap<FPackageId, const FFilePackageStoreEntry*> OptionalSegmentStoreEntriesMap;
|
|
bool bNeedsUncookedPackagesUpdate = false;
|
|
#endif //if WITH_EDITOR
|
|
|
|
};
|