UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IPackageResourceManager Class Referenceabstract

#include <PackageResourceManager.h>

+ Inheritance diagram for IPackageResourceManager:

Public Types

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
 

Public Member Functions

virtual ~IPackageResourceManager ()=default
 
virtual bool SupportsLocalOnlyPaths ()=0
 
virtual bool SupportsPackageOnlyPaths ()=0
 
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)
 
virtual bool TryMatchCaseOnDisk (const FPackagePath &PackagePath, FPackagePath *OutNormalizedPath=nullptr)=0
 
virtual TUniquePtr< FArchiveOpenReadExternalResource (EPackageExternalResource ResourceType, FStringView Identifier)=0
 
virtual FOpenAsyncPackageResult OpenAsyncReadExternalResource (EPackageExternalResource ResourceType, FStringView Identifier)=0
 
virtual bool DoesExternalResourceExist (EPackageExternalResource ResourceType, FStringView Identifier)=0
 
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)
 
virtual bool DoesPackageExist (const FPackagePath &PackagePath, FBulkDataCookedIndex CookedIndex, EPackageSegment PackageSegment, FPackagePath *OutUpdatedPath=nullptr)=0
 
int64 FileSize (const FPackagePath &PackagePath, EPackageSegment PackageSegment, FPackagePath *OutUpdatedPath=nullptr)
 
virtual int64 FileSize (const FPackagePath &PackagePath, FBulkDataCookedIndex CookedIndex, EPackageSegment PackageSegment, FPackagePath *OutUpdatedPath=nullptr)=0
 
FOpenPackageResult OpenReadPackage (const FPackagePath &PackagePath, EPackageSegment PackageSegment, FPackagePath *OutUpdatedPath=nullptr)
 
virtual FOpenPackageResult OpenReadPackage (const FPackagePath &PackagePath, FBulkDataCookedIndex CookedIndex, EPackageSegment PackageSegment, FPackagePath *OutUpdatedPath=nullptr)=0
 
FOpenAsyncPackageResult OpenAsyncReadPackage (const FPackagePath &PackagePath, EPackageSegment PackageSegment)
 
virtual FOpenAsyncPackageResult OpenAsyncReadPackage (const FPackagePath &PackagePath, FBulkDataCookedIndex CookedIndex, EPackageSegment PackageSegment)=0
 
virtual IMappedFileHandleOpenMappedHandleToPackage (const FPackagePath &PackagePath, EPackageSegment PackageSegment, FPackagePath *OutUpdatedPath=nullptr)=0
 
virtual void FindPackagesRecursive (TArray< TPair< FPackagePath, EPackageSegment > > &OutPackages, FStringView PackageMount, FStringView FileMount, FStringView RootRelPath, FStringView BasenameWildcard)=0
 
virtual void IteratePackagesInPath (FStringView PackageMount, FStringView FileMount, FStringView RootRelPath, FPackageSegmentVisitor Callback)=0
 
virtual void IteratePackagesInLocalOnlyDirectory (FStringView RootDir, FPackageSegmentVisitor Callback)=0
 
virtual void IteratePackagesStatInPath (FStringView PackageMount, FStringView FileMount, FStringView RootRelPath, FPackageSegmentStatVisitor Callback)=0
 
virtual void IteratePackagesStatInLocalOnlyDirectory (FStringView RootDir, FPackageSegmentStatVisitor Callback)=0
 

Static Public Member Functions

static COREUOBJECT_API IPackageResourceManagerGet ()
 
static COREUOBJECT_API void Initialize ()
 
static COREUOBJECT_API void Shutdown ()
 
static COREUOBJECT_API FSetPackageResourceManagerGetSetPackageResourceManagerDelegate ()
 
static COREUOBJECT_API FOnClearPackageResourceManagerGetOnClearPackageResourceManagerDelegate ()
 

Detailed Description

Provides directory queries and Archive payloads for PackagePaths and their PackageSegments from a repository that might be the local content directories, a database running on the current machine, or a remote database.

Member Typedef Documentation

◆ FPackagePathStatVisitor

Return value specifies whether iteration should continue

◆ FPackagePathVisitor

Return value specifies whether iteration should continue

◆ FPackageSegmentStatVisitor

Return value specifies whether iteration should continue

◆ FPackageSegmentVisitor

Return value specifies whether iteration should continue

Constructor & Destructor Documentation

◆ ~IPackageResourceManager()

virtual IPackageResourceManager::~IPackageResourceManager ( )
virtualdefault

Member Function Documentation

◆ DoesExternalResourceExist()

virtual bool IPackageResourceManager::DoesExternalResourceExist ( EPackageExternalResource  ResourceType,
FStringView  Identifier 
)
pure virtual

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

Implemented in FPackageResourceManagerFile.

◆ DoesPackageExist() [1/3]

bool IPackageResourceManager::DoesPackageExist ( const FPackagePath PackagePath,
EPackageSegment  PackageSegment,
FPackagePath OutUpdatedPath = nullptr 
)
inline

◆ DoesPackageExist() [2/3]

virtual bool IPackageResourceManager::DoesPackageExist ( const FPackagePath PackagePath,
FBulkDataCookedIndex  CookedIndex,
EPackageSegment  PackageSegment,
FPackagePath OutUpdatedPath = nullptr 
)
pure virtual

DoesPackageExist that takes a PackageSegment

Implemented in FPackageResourceManagerFile.

◆ DoesPackageExist() [3/3]

bool IPackageResourceManager::DoesPackageExist ( const FPackagePath PackagePath,
FPackagePath OutUpdatedPath = nullptr 
)

Report whether the package exists

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

◆ FileSize() [1/3]

int64 IPackageResourceManager::FileSize ( const FPackagePath PackagePath,
EPackageSegment  PackageSegment,
FPackagePath OutUpdatedPath = nullptr 
)
inline

◆ FileSize() [2/3]

virtual int64 IPackageResourceManager::FileSize ( const FPackagePath PackagePath,
FBulkDataCookedIndex  CookedIndex,
EPackageSegment  PackageSegment,
FPackagePath OutUpdatedPath = nullptr 
)
pure virtual

FileSize that takes a PackageSegment

Implemented in FPackageResourceManagerFile.

◆ FileSize() [3/3]

int64 IPackageResourceManager::FileSize ( const FPackagePath PackagePath,
FPackagePath OutUpdatedPath = nullptr 
)

Report the payload size of the package

Parameters
PackagePathThe package to look for
OutUpdatedPathIf non-null and the package is found, PackagePath is copied into this path (noop if OutUpdatedPath == &PackagePath), and if the package exists, the specific extension found is set
Returns
The size in bytes of the package, or INDEX_NONE if it isn't found

◆ FindPackagesRecursive() [1/2]

void IPackageResourceManager::FindPackagesRecursive ( TArray< FPackagePath > &  OutPackages,
FStringView  PackageMount,
FStringView  FileMount,
FStringView  RootRelPath,
FStringView  BasenameWildcard 
)

Search the given subdirectory of a package mount for all packages with the given package basename in the package repository

Parameters
OutPackagesThe list of packages found
PackageMountThe package name of the mount point to look under
FileMountThe local file path of the mount point to look under, must be the local file path that corresponds to PackageMount
RootRelPathA relative path from PackageMount that specifies the subdirectory of the mount point to use as the root of the search
BasenameWildcardThe basenamewithoutpath to look for BasenameWildcard can not include path or extension; / and . are invalid characters BasenameWildcard can include *?-type wildcards (FString::MatchesWildcard)

◆ FindPackagesRecursive() [2/2]

virtual void IPackageResourceManager::FindPackagesRecursive ( TArray< TPair< FPackagePath, EPackageSegment > > &  OutPackages,
FStringView  PackageMount,
FStringView  FileMount,
FStringView  RootRelPath,
FStringView  BasenameWildcard 
)
pure virtual

FindPackagesRecursive that returns PackageSegments

Implemented in FPackageResourceManagerFile.

◆ Get()

IPackageResourceManager & IPackageResourceManager::Get ( )
static

Returns the package resource manager. It is illegal to call Get before calling initialize.

◆ GetOnClearPackageResourceManagerDelegate()

FOnClearPackageResourceManager & IPackageResourceManager::GetOnClearPackageResourceManagerDelegate ( )
static

◆ GetSetPackageResourceManagerDelegate()

FSetPackageResourceManager & IPackageResourceManager::GetSetPackageResourceManagerDelegate ( )
static

◆ Initialize()

void IPackageResourceManager::Initialize ( )
static

Call during engine startup to choose the appropriate PackageResourceManager for the current configuration and construct it and bind it to be returned from Get

◆ IteratePackagesInLocalOnlyDirectory() [1/2]

void IPackageResourceManager::IteratePackagesInLocalOnlyDirectory ( FStringView  RootDir,
FPackagePathVisitor  Callback 
)

Call the callback on all packages in the given local path

PackageResourceManagers that do not support LocalOnly paths will return without calling the Callback

Parameters
RootDirThe local path on disk to search
CallbackThe callback called on each package

◆ IteratePackagesInLocalOnlyDirectory() [2/2]

virtual void IPackageResourceManager::IteratePackagesInLocalOnlyDirectory ( FStringView  RootDir,
FPackageSegmentVisitor  Callback 
)
pure virtual

IteratePackagesInLocalOnlyDirectory that takes a FPackageSegmentStatVisitor

Implemented in FPackageResourceManagerFile.

◆ IteratePackagesInPath() [1/2]

void IPackageResourceManager::IteratePackagesInPath ( FStringView  PackageMount,
FStringView  FileMount,
FStringView  RootRelPath,
FPackagePathVisitor  Callback 
)

Call the callback on all packages in the package repository that are in the given subdirectory of a package mount

Parameters
PackageMountThe package name of the mount point's to look under
FileMountThe local file path of the mount point to look under, must be the local file path that corresponds to PackageMount
RootRelPathA relative path from PackageMount that specifies the subdirectory of the mount point to use as the root of the search
CallbackThe callback called on each package

◆ IteratePackagesInPath() [2/2]

virtual void IPackageResourceManager::IteratePackagesInPath ( FStringView  PackageMount,
FStringView  FileMount,
FStringView  RootRelPath,
FPackageSegmentVisitor  Callback 
)
pure virtual

IteratePackagesInPath that takes a FPackageSegmentVisitor

Implemented in FPackageResourceManagerFile.

◆ IteratePackagesStatInLocalOnlyDirectory() [1/2]

void IPackageResourceManager::IteratePackagesStatInLocalOnlyDirectory ( FStringView  RootDir,
FPackagePathStatVisitor  Callback 
)

Call the callback - with stat data - on all packages in the given local path

PackageResourceManagers that do not support LocalOnly paths will return without calling the Callback

Parameters
RootDirThe local path on disk to search
CallbackThe callback called on each package
bOutSupportedIf nonnull, receives a true or false value for whether this PackageResourceManager supports searching LocalOnlyDirectories

◆ IteratePackagesStatInLocalOnlyDirectory() [2/2]

virtual void IPackageResourceManager::IteratePackagesStatInLocalOnlyDirectory ( FStringView  RootDir,
FPackageSegmentStatVisitor  Callback 
)
pure virtual

IteratePackagesStatInLocalOnlyDirectory that takes a FPackageSegmentStatVisitor

Implemented in FPackageResourceManagerFile.

◆ IteratePackagesStatInPath() [1/2]

void IPackageResourceManager::IteratePackagesStatInPath ( FStringView  PackageMount,
FStringView  FileMount,
FStringView  RootRelPath,
FPackagePathStatVisitor  Callback 
)

Call the callback - with stat data - on all packages in the package repository that are in the given subdirectory of a package mount

Parameters
PackageMountThe package name of the mount point's to look under
FileMountThe local file path of the mount point to look under, must be the local file path that corresponds to PackageMount
RootRelPathA relative path from PackageMount that specifies the subdirectory of the mount point to use as the root of the search
CallbackThe callback called on each package

◆ IteratePackagesStatInPath() [2/2]

virtual void IPackageResourceManager::IteratePackagesStatInPath ( FStringView  PackageMount,
FStringView  FileMount,
FStringView  RootRelPath,
FPackageSegmentStatVisitor  Callback 
)
pure virtual

IteratePackagesStatInPath that takes a FPackageSegmentVisitor

Implemented in FPackageResourceManagerFile.

◆ OpenAsyncReadExternalResource()

virtual FOpenAsyncPackageResult IPackageResourceManager::OpenAsyncReadExternalResource ( EPackageExternalResource  ResourceType,
FStringView  Identifier 
)
pure virtual

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)

Implemented in FPackageResourceManagerFile.

◆ OpenAsyncReadPackage() [1/3]

FOpenAsyncPackageResult IPackageResourceManager::OpenAsyncReadPackage ( const FPackagePath PackagePath)

Open an IAsyncReadFileHandle to asynchronously read the bytes of the package

If the PackagePath specifies the extension, this call does not hit the disk/network or block. Otherwise, this call will read from network/disk to find the extension This call will always return a non-null handle, even if the package does not exist

Parameters
PackagePathThe package to look for
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)

◆ OpenAsyncReadPackage() [2/3]

FOpenAsyncPackageResult IPackageResourceManager::OpenAsyncReadPackage ( const FPackagePath PackagePath,
EPackageSegment  PackageSegment 
)
inline

◆ OpenAsyncReadPackage() [3/3]

virtual FOpenAsyncPackageResult IPackageResourceManager::OpenAsyncReadPackage ( const FPackagePath PackagePath,
FBulkDataCookedIndex  CookedIndex,
EPackageSegment  PackageSegment 
)
pure virtual

OpenAsyncReadPackage that takes a PackageSegment

Implemented in FPackageResourceManagerFile.

◆ OpenMappedHandleToPackage() [1/2]

virtual IMappedFileHandle * IPackageResourceManager::OpenMappedHandleToPackage ( const FPackagePath PackagePath,
EPackageSegment  PackageSegment,
FPackagePath OutUpdatedPath = nullptr 
)
pure virtual

Implemented in FPackageResourceManagerFile.

◆ OpenMappedHandleToPackage() [2/2]

IMappedFileHandle * IPackageResourceManager::OpenMappedHandleToPackage ( const FPackagePath PackagePath,
FPackagePath OutUpdatedPath = nullptr 
)

Open an IMappedFileHandle to the package, if the PackageResourceManager supports it

Will return nullptr if the package does not exist or if the PackageResourceManager does not support MappedFilesHandles

Parameters
PackagePathThe package to look for
OutUpdatedPathIf non-null and the package is found, PackagePath is copied into this path (noop if OutUpdatedPath == &PackagePath), and if the package exists, the specific extension found is set
Returns
IMappedFileHandle* or nullptr

◆ OpenReadExternalResource()

virtual TUniquePtr< FArchive > IPackageResourceManager::OpenReadExternalResource ( EPackageExternalResource  ResourceType,
FStringView  Identifier 
)
pure virtual

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.

Implemented in FPackageResourceManagerFile.

◆ OpenReadPackage() [1/3]

FOpenPackageResult IPackageResourceManager::OpenReadPackage ( const FPackagePath PackagePath,
EPackageSegment  PackageSegment,
FPackagePath OutUpdatedPath = nullptr 
)
inline

◆ OpenReadPackage() [2/3]

virtual FOpenPackageResult IPackageResourceManager::OpenReadPackage ( const FPackagePath PackagePath,
FBulkDataCookedIndex  CookedIndex,
EPackageSegment  PackageSegment,
FPackagePath OutUpdatedPath = nullptr 
)
pure virtual

OpenReadPackage that takes a PackageSegment

Implemented in FPackageResourceManagerFile.

◆ OpenReadPackage() [3/3]

FOpenPackageResult IPackageResourceManager::OpenReadPackage ( const FPackagePath PackagePath,
FPackagePath OutUpdatedPath = nullptr 
)

Open an FArchive to read the bytes of the package

Parameters
PackagePathThe package to look for
OutUpdatedPathIf non-null and the package is found, PackagePath is copied into this path (noop if OutUpdatedPath == &PackagePath), and if the package exists, the specific extension found is set
Returns
An FOpenPackageResult, with Result.Archive == archive for the bytes of the package or nullptr if it isn't found, and with other data describing the returned archive (see FOpenPackageResult)

◆ Shutdown()

void IPackageResourceManager::Shutdown ( )
static

Call during engine shutdown to free the PackageResourceManager that was created by Initialize; Get will and return nullptr from this point on

◆ SupportsLocalOnlyPaths()

virtual bool IPackageResourceManager::SupportsLocalOnlyPaths ( )
pure virtual

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

Implemented in FPackageResourceManagerFile.

◆ SupportsPackageOnlyPaths()

virtual bool IPackageResourceManager::SupportsPackageOnlyPaths ( )
pure virtual

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

Implemented in FPackageResourceManagerFile.

◆ TryMatchCaseOnDisk()

virtual bool IPackageResourceManager::TryMatchCaseOnDisk ( const FPackagePath PackagePath,
FPackagePath OutNormalizedPath = nullptr 
)
pure virtual

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

Implemented in FPackageResourceManagerFile.


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