UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FPackageResourceManagerFile Class Referencefinal
+ Inheritance diagram for FPackageResourceManagerFile:

Classes

class  FDirectoryVisitorBaseLocalOnly
 
class  FDirectoryVisitorBaseMounted
 

Public Member Functions

 FPackageResourceManagerFile ()
 
virtual ~FPackageResourceManagerFile ()=default
 
virtual bool SupportsLocalOnlyPaths () override
 
virtual bool SupportsPackageOnlyPaths () override
 
virtual bool DoesPackageExist (const FPackagePath &PackagePath, FBulkDataCookedIndex CookedIndex, EPackageSegment PackageSegment, FPackagePath *OutUpdatedPath=nullptr) override
 
virtual int64 FileSize (const FPackagePath &PackagePath, FBulkDataCookedIndex CookedIndex, EPackageSegment PackageSegment, FPackagePath *OutUpdatedPath=nullptr) override
 
virtual FOpenPackageResult OpenReadPackage (const FPackagePath &PackagePath, FBulkDataCookedIndex CookedIndex, EPackageSegment PackageSegment, FPackagePath *OutUpdatedPath=nullptr) override
 
virtual FOpenAsyncPackageResult OpenAsyncReadPackage (const FPackagePath &PackagePath, FBulkDataCookedIndex CookedIndex, EPackageSegment PackageSegment) override
 
virtual IMappedFileHandleOpenMappedHandleToPackage (const FPackagePath &PackagePath, EPackageSegment PackageSegment, FPackagePath *OutUpdatedPath=nullptr) override
 
virtual bool TryMatchCaseOnDisk (const FPackagePath &PackagePath, FPackagePath *OutPackagePath=nullptr) override
 
virtual TUniquePtr< FArchiveOpenReadExternalResource (EPackageExternalResource ResourceType, FStringView Identifier) override
 
virtual bool DoesExternalResourceExist (EPackageExternalResource ResourceType, FStringView Identifier) override
 
virtual FOpenAsyncPackageResult OpenAsyncReadExternalResource (EPackageExternalResource ResourceType, FStringView Identifier) override
 
virtual void FindPackagesRecursive (TArray< TPair< FPackagePath, EPackageSegment > > &OutPackages, FStringView PackageMount, FStringView FileMount, FStringView RootRelPath, FStringView BasenameWildcard) override
 
virtual void IteratePackagesInPath (FStringView PackageMount, FStringView FileMount, FStringView RootRelPath, FPackageSegmentVisitor Callback) override
 
virtual void IteratePackagesInLocalOnlyDirectory (FStringView RootDir, FPackageSegmentVisitor Callback) override
 
virtual void IteratePackagesStatInPath (FStringView PackageMount, FStringView FileMount, FStringView RootRelPath, FPackageSegmentStatVisitor Callback) override
 
virtual void IteratePackagesStatInLocalOnlyDirectory (FStringView RootDir, FPackageSegmentStatVisitor Callback) override
 
- Public Member Functions inherited from IPackageResourceManager
virtual ~IPackageResourceManager ()=default
 
COREUOBJECT_API bool DoesPackageExist (const FPackagePath &PackagePath, FPackagePath *OutUpdatedPath=nullptr)
 
COREUOBJECT_API int64 FileSize (const FPackagePath &PackagePath, FPackagePath *OutUpdatedPath=nullptr)
 
COREUOBJECT_API FOpenPackageResult OpenReadPackage (const FPackagePath &PackagePath, FPackagePath *OutUpdatedPath=nullptr)
 
COREUOBJECT_API FOpenAsyncPackageResult OpenAsyncReadPackage (const FPackagePath &PackagePath)
 
COREUOBJECT_API IMappedFileHandleOpenMappedHandleToPackage (const FPackagePath &PackagePath, FPackagePath *OutUpdatedPath=nullptr)
 
COREUOBJECT_API void FindPackagesRecursive (TArray< FPackagePath > &OutPackages, FStringView PackageMount, FStringView FileMount, FStringView RootRelPath, FStringView BasenameWildcard)
 
COREUOBJECT_API void IteratePackagesInPath (FStringView PackageMount, FStringView FileMount, FStringView RootRelPath, FPackagePathVisitor Callback)
 
COREUOBJECT_API void IteratePackagesInLocalOnlyDirectory (FStringView RootDir, FPackagePathVisitor Callback)
 
COREUOBJECT_API void IteratePackagesStatInPath (FStringView PackageMount, FStringView FileMount, FStringView RootRelPath, FPackagePathStatVisitor Callback)
 
COREUOBJECT_API void IteratePackagesStatInLocalOnlyDirectory (FStringView RootDir, FPackagePathStatVisitor Callback)
 
bool DoesPackageExist (const FPackagePath &PackagePath, EPackageSegment PackageSegment, FPackagePath *OutUpdatedPath=nullptr)
 
int64 FileSize (const FPackagePath &PackagePath, EPackageSegment PackageSegment, FPackagePath *OutUpdatedPath=nullptr)
 
FOpenPackageResult OpenReadPackage (const FPackagePath &PackagePath, EPackageSegment PackageSegment, FPackagePath *OutUpdatedPath=nullptr)
 
FOpenAsyncPackageResult OpenAsyncReadPackage (const FPackagePath &PackagePath, EPackageSegment PackageSegment)
 

Protected Member Functions

template<typename CallbackType >
void IteratePossibleFiles (const FPackagePath &PackagePath, FBulkDataCookedIndex CookedIndex, EPackageSegment PackageSegment, FPackagePath *OutUpdatedPath, const CallbackType &Callback)
 

Additional Inherited Members

- Public Types inherited from IPackageResourceManager
typedef TFunctionRef< bool(const FPackagePath &PackagePath)> FPackagePathVisitor
 
typedef TFunctionRef< bool(const FPackagePath &PackagePath, const FFileStatData &StatData)> FPackagePathStatVisitor
 
typedef TFunctionRef< bool(const FPackagePath &PackagePath, EPackageSegment PackageSegment)> FPackageSegmentVisitor
 
typedef TFunctionRef< bool(const FPackagePath &PackagePath, EPackageSegment PackageSegment, const FFileStatData &StatData)> FPackageSegmentStatVisitor
 
- Static Public Member Functions inherited from IPackageResourceManager
static COREUOBJECT_API IPackageResourceManagerGet ()
 
static COREUOBJECT_API void Initialize ()
 
static COREUOBJECT_API void Shutdown ()
 
static COREUOBJECT_API FSetPackageResourceManagerGetSetPackageResourceManagerDelegate ()
 
static COREUOBJECT_API FOnClearPackageResourceManagerGetOnClearPackageResourceManagerDelegate ()
 

Detailed Description

A PackageResourceManager that reads package payloads from the content directories on disk

Constructor & Destructor Documentation

◆ FPackageResourceManagerFile()

FPackageResourceManagerFile::FPackageResourceManagerFile ( )

◆ ~FPackageResourceManagerFile()

virtual FPackageResourceManagerFile::~FPackageResourceManagerFile ( )
virtualdefault

Member Function Documentation

◆ DoesExternalResourceExist()

bool FPackageResourceManagerFile::DoesExternalResourceExist ( EPackageExternalResource  ResourceType,
FStringView  Identifier 
)
overridevirtual

Report whether a given ExternalResource exists. The same behavior as OpenReadExternalResource != nullptr, but more performant.

Parameters
ResourceTypeId for the method used to map the identifier to an archive.
IdentifierId for which resource to return within the ResourceType's domain.
Returns
true if the ExternalResource exists, else false

Implements IPackageResourceManager.

◆ DoesPackageExist()

bool FPackageResourceManagerFile::DoesPackageExist ( const FPackagePath PackagePath,
FBulkDataCookedIndex  CookedIndex,
EPackageSegment  PackageSegment,
FPackagePath OutUpdatedPath = nullptr 
)
overridevirtual

DoesPackageExist that takes a PackageSegment

Implements IPackageResourceManager.

◆ FileSize()

int64 FPackageResourceManagerFile::FileSize ( const FPackagePath PackagePath,
FBulkDataCookedIndex  CookedIndex,
EPackageSegment  PackageSegment,
FPackagePath OutUpdatedPath = nullptr 
)
overridevirtual

FileSize that takes a PackageSegment

Implements IPackageResourceManager.

◆ FindPackagesRecursive()

void FPackageResourceManagerFile::FindPackagesRecursive ( TArray< TPair< FPackagePath, EPackageSegment > > &  OutPackages,
FStringView  PackageMount,
FStringView  FileMount,
FStringView  RootRelPath,
FStringView  BasenameWildcard 
)
overridevirtual

FindPackagesRecursive that returns PackageSegments

Implements IPackageResourceManager.

◆ IteratePackagesInLocalOnlyDirectory()

void FPackageResourceManagerFile::IteratePackagesInLocalOnlyDirectory ( FStringView  RootDir,
FPackageSegmentVisitor  Callback 
)
overridevirtual

IteratePackagesInLocalOnlyDirectory that takes a FPackageSegmentStatVisitor

Implements IPackageResourceManager.

◆ IteratePackagesInPath()

void FPackageResourceManagerFile::IteratePackagesInPath ( FStringView  PackageMount,
FStringView  FileMount,
FStringView  RootRelPath,
FPackageSegmentVisitor  Callback 
)
overridevirtual

IteratePackagesInPath that takes a FPackageSegmentVisitor

Implements IPackageResourceManager.

◆ IteratePackagesStatInLocalOnlyDirectory()

void FPackageResourceManagerFile::IteratePackagesStatInLocalOnlyDirectory ( FStringView  RootDir,
FPackageSegmentStatVisitor  Callback 
)
overridevirtual

IteratePackagesStatInLocalOnlyDirectory that takes a FPackageSegmentStatVisitor

Implements IPackageResourceManager.

◆ IteratePackagesStatInPath()

void FPackageResourceManagerFile::IteratePackagesStatInPath ( FStringView  PackageMount,
FStringView  FileMount,
FStringView  RootRelPath,
FPackageSegmentStatVisitor  Callback 
)
overridevirtual

IteratePackagesStatInPath that takes a FPackageSegmentVisitor

Implements IPackageResourceManager.

◆ IteratePossibleFiles()

template<typename CallbackType >
void FPackageResourceManagerFile::IteratePossibleFiles ( const FPackagePath PackagePath,
FBulkDataCookedIndex  CookedIndex,
EPackageSegment  PackageSegment,
FPackagePath OutUpdatedPath,
const CallbackType Callback 
)
protected

Enumerate the possible extensions for the given PackagePath and segment and call Callback on the full LocalPath. Callback returns true if the given fullpath should be used, in which case iteration stops and OutUpdatedPath is assigned the chosen extension. PackagePaths without a LocalPath (PackageNameOnly PackagePaths) will result in no calls made to the Callback.

Parameters
PackagePathThe PackagePath used to construct the LocalPath.
CookedIndexThe cooked index used by the bulkdata, other segment types can just pass in default
PackageSegmentThe PackageSegment used to construct the LocalPath.
OutUpdatedPathIf non-null and a LocalPath is found for which Callback returns true, will be set equal to a copy of PackagePath, and if a header extension was found, will have the header extension set
Callbackbool (Callback)(const TCHAR FullLocalPath, EPackageExtension Extension), the callback used to check whether an extension is the correct one (because the FullLocalPath exists)

◆ OpenAsyncReadExternalResource()

FOpenAsyncPackageResult FPackageResourceManagerFile::OpenAsyncReadExternalResource ( EPackageExternalResource  ResourceType,
FStringView  Identifier 
)
overridevirtual

Open an IAsyncReadFileHandle to asynchronously read the bytes of the given ExternalResource. An ExternalResource is in a separate domain from the one out of which this ResourceManager serves PackagePaths.

TODO: This call should not hit the disk/network or block, but it currently does, to find the extension. This call will always return a non-null handle, even if the package does not exist

Parameters
ResourceTypeId for the method used to map the identifier to an archive.
IdentifierId for which resource to return within the ResourceType's domain.
Returns
An FOpenAsyncPackageResult, with Handle that will read from the package if it exists, or will be in the canceled state if the package does not exist, and with other data describing the returned archive (see FOpenAsyncPackageResult)

Implements IPackageResourceManager.

◆ OpenAsyncReadPackage()

FOpenAsyncPackageResult FPackageResourceManagerFile::OpenAsyncReadPackage ( const FPackagePath PackagePath,
FBulkDataCookedIndex  CookedIndex,
EPackageSegment  PackageSegment 
)
overridevirtual

OpenAsyncReadPackage that takes a PackageSegment

Implements IPackageResourceManager.

◆ OpenMappedHandleToPackage()

IMappedFileHandle * FPackageResourceManagerFile::OpenMappedHandleToPackage ( const FPackagePath PackagePath,
EPackageSegment  PackageSegment,
FPackagePath OutUpdatedPath = nullptr 
)
overridevirtual

◆ OpenReadExternalResource()

TUniquePtr< FArchive > FPackageResourceManagerFile::OpenReadExternalResource ( EPackageExternalResource  ResourceType,
FStringView  Identifier 
)
overridevirtual

Open a seekable binary FArchive to read the bytes of the given External Resource. An ExternalResource is in a separate domain from the one out of which this ResourceManager serves PackagePaths.

Parameters
ResourceTypeId for the method used to map the identifier to an archive.
IdentifierId for which resource to return within the ResourceType's domain.
Returns
The opened FArchive, or nullptr if it wasn't found.

Implements IPackageResourceManager.

◆ OpenReadPackage()

FOpenPackageResult FPackageResourceManagerFile::OpenReadPackage ( const FPackagePath PackagePath,
FBulkDataCookedIndex  CookedIndex,
EPackageSegment  PackageSegment,
FPackagePath OutUpdatedPath = nullptr 
)
overridevirtual

OpenReadPackage that takes a PackageSegment

Implements IPackageResourceManager.

◆ SupportsLocalOnlyPaths()

virtual bool FPackageResourceManagerFile::SupportsLocalOnlyPaths ( )
inlineoverridevirtual

Report whether the PackageResourceManager supports PackagePaths that are unmounted LocalPaths

If unsupported, functions without LocalOnly in their name that take a PackagePath will behave as if the package does not exist in the repository for unmounted LocalPaths If unsupported, functions with LocalOnly in their name will indicate the lack of support when called with unmounted LocalPaths; see each function's description for its precise behavior

Implements IPackageResourceManager.

◆ SupportsPackageOnlyPaths()

virtual bool FPackageResourceManagerFile::SupportsPackageOnlyPaths ( )
inlineoverridevirtual

Report whether the PackageResourceManager supports PackagePaths that are unmounted PackageNames

If unsupported, functions without PackageNameOnly in their name that take a PackagePath will behave as if the package does not exist in the repository for unmounted PackageNames If unsupported, functions with PackageNameOnly in their name will indicate the lack of support when called with unmounted PackageNames; see each function's description for its precise behavior

Implements IPackageResourceManager.

◆ TryMatchCaseOnDisk()

bool FPackageResourceManagerFile::TryMatchCaseOnDisk ( const FPackagePath PackagePath,
FPackagePath OutNormalizedPath = nullptr 
)
overridevirtual

Find the package in the package repository and set OutNormalizedPath equal to PackagePath, but with capitalization of the PackageName and LocalPath matching the capitalization present in the package repository's internal path string (e.g. the path on disk)

Parameters
PackagePathThe package to look for
OutNormalizedPathIf non-null and the package is found, PackagePath is copied into this path (noop if OutUpdatedPath == &PackagePath), with matching capitalization and with the specific extension found
Returns
true if the package exists, else false

Implements IPackageResourceManager.


The documentation for this class was generated from the following file: