UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::FPackageTrailer Class Reference

#include <PackageTrailer.h>

Classes

struct  FFooter
 
struct  FHeader
 

Public Member Functions

 FPackageTrailer ()=default
 
 ~FPackageTrailer ()=default
 
 FPackageTrailer (const FPackageTrailer &Other)=default
 
FPackageTraileroperator= (const FPackageTrailer &Other)=default
 
 FPackageTrailer (FPackageTrailer &&Other)=default
 
FPackageTraileroperator= (FPackageTrailer &&Other)=default
 
bool IsValid () const
 
COREUOBJECT_API bool TryLoad (FArchive &Ar)
 
COREUOBJECT_API bool TryLoadBackwards (FArchive &Ar)
 
COREUOBJECT_API FCompressedBuffer LoadLocalPayload (const FIoHash &Id, FArchive &Ar) const
 
COREUOBJECT_API bool UpdatePayloadAsVirtualized (const FIoHash &Identifier)
 
COREUOBJECT_API void ForEachPayload (TFunctionRef< void(const FIoHash &, uint64, uint64, EPayloadAccessMode, UE::Virtualization::EPayloadFilterReason)> Callback) const
 
COREUOBJECT_API EPayloadStatus FindPayloadStatus (const FIoHash &Id) const
 
COREUOBJECT_API int64 FindPayloadOffsetInFile (const FIoHash &Id) const
 
COREUOBJECT_API int64 FindPayloadSizeOnDisk (const FIoHash &Id) const
 
COREUOBJECT_API int64 GetTrailerLength () const
 
COREUOBJECT_API FPayloadInfo GetPayloadInfo (const FIoHash &Id) const
 
COREUOBJECT_API TArray< FIoHashGetPayloads (EPayloadStorageType StorageType) const
 
COREUOBJECT_API int32 GetNumPayloads (EPayloadStorageType Type) const
 
COREUOBJECT_API TArray< FIoHashGetPayloads (EPayloadFilter Filter) const
 
COREUOBJECT_API int32 GetNumPayloads (EPayloadFilter Filter) const
 

Static Public Member Functions

static bool IsEnabled ()
 
static COREUOBJECT_API bool TryLoadFromPackage (const FPackagePath &PackagePath, FPackageTrailer &OutTrailer)
 
static COREUOBJECT_API bool TryLoadFromFile (const FString &Path, FPackageTrailer &OutTrailer)
 
static COREUOBJECT_API bool TryLoadFromArchive (FArchive &Ar, FPackageTrailer &OutTrailer)
 

Friends

class FPackageTrailerBuilder
 

Detailed Description

The package trailer should only ever stored the payloads in the workspace domain. If the package trailer is in the editor domain then it's values should be valid, but when loading non-virtualized payloads they need to come from the workspace domain package.

Constructor & Destructor Documentation

◆ FPackageTrailer() [1/3]

UE::FPackageTrailer::FPackageTrailer ( )
default

◆ ~FPackageTrailer()

UE::FPackageTrailer::~FPackageTrailer ( )
default

◆ FPackageTrailer() [2/3]

UE::FPackageTrailer::FPackageTrailer ( const FPackageTrailer Other)
default

◆ FPackageTrailer() [3/3]

UE::FPackageTrailer::FPackageTrailer ( FPackageTrailer &&  Other)
default

Member Function Documentation

◆ FindPayloadOffsetInFile()

int64 UE::FPackageTrailer::FindPayloadOffsetInFile ( const FIoHash Id) const

Returns the absolute offset of the payload in the package file, invalid and virtualized payloads will return INDEX_NONE

◆ FindPayloadSizeOnDisk()

int64 UE::FPackageTrailer::FindPayloadSizeOnDisk ( const FIoHash Id) const

Returns the size of the payload on as stored on disk, invalid and virtualized payloads will return INDEX_NONE

◆ FindPayloadStatus()

EPayloadStatus UE::FPackageTrailer::FindPayloadStatus ( const FIoHash Id) const

Attempt to find the status of the given payload. @See EPayloadStatus

◆ ForEachPayload()

void UE::FPackageTrailer::ForEachPayload ( TFunctionRef< void(const FIoHash &, uint64, uint64, EPayloadAccessMode, UE::Virtualization::EPayloadFilterReason)>  Callback) const

Iterates over all payloads in the trailer and invokes the provoided callback on them

◆ GetNumPayloads() [1/2]

int32 UE::FPackageTrailer::GetNumPayloads ( EPayloadFilter  Filter) const

Returns the number of payloads that the trailer owns that match the given filter type. @See EPayloadFilter

◆ GetNumPayloads() [2/2]

int32 UE::FPackageTrailer::GetNumPayloads ( EPayloadStorageType  Type) const

Returns the number of payloads that the trailer owns with the given storage type. @See EPayloadStoragetype

◆ GetPayloadInfo()

FPayloadInfo UE::FPackageTrailer::GetPayloadInfo ( const FIoHash Id) const

◆ GetPayloads() [1/2]

TArray< FIoHash > UE::FPackageTrailer::GetPayloads ( EPayloadFilter  Filter) const

Returns an array of the payloads that match the given filter type. @See EPayloadFilter

◆ GetPayloads() [2/2]

TArray< FIoHash > UE::FPackageTrailer::GetPayloads ( EPayloadStorageType  StorageType) const

Returns an array of the payloads with the given storage type. @See EPayloadStoragetype

◆ GetTrailerLength()

int64 UE::FPackageTrailer::GetTrailerLength ( ) const

Returns the total size of the of the trailer on disk in bytes

◆ IsEnabled()

static bool UE::FPackageTrailer::IsEnabled ( )
inlinestatic

Returns if the feature is enabled or disabled.

Note that this is for development purposes only and should ship as always enabled!

◆ IsValid()

bool UE::FPackageTrailer::IsValid ( ) const
inline

Returns true if the trailer contains actual data from a package file and false if it just contains the defaults of an unloaded trailer.

◆ LoadLocalPayload()

FCompressedBuffer UE::FPackageTrailer::LoadLocalPayload ( const FIoHash Id,
FArchive Ar 
) const

Loads a payload that is stored locally within the package trailer. Payloads stored externally (either referenced or virtualized) will not load.

Parameters
IdThe payload to load
ArThe archive from which the payload trailer was also loaded from
Returns
The payload in the form of a FCompressedBuffer. If the payload does not exist in the trailer or is not stored locally in the trailer then the FCompressedBuffer will be null.

◆ operator=() [1/2]

FPackageTrailer & UE::FPackageTrailer::operator= ( const FPackageTrailer Other)
default

◆ operator=() [2/2]

FPackageTrailer & UE::FPackageTrailer::operator= ( FPackageTrailer &&  Other)
default

◆ TryLoad()

bool UE::FPackageTrailer::TryLoad ( FArchive Ar)

Serializes the trailer from the given archive assuming that the seek position of the archive is already at the correct position for the trailer.

Parameters
ArThe archive to load the trailer from
Returns
True if a valid trailer was found and was able to be loaded, otherwise false. If the trailer was found but failed to load then the archive will be set to the error state.

◆ TryLoadBackwards()

bool UE::FPackageTrailer::TryLoadBackwards ( FArchive Ar)

Serializes the trailer from the given archive BUT assumes that the seek position of the archive is at the end of the trailer and so will attempt to read the footer first and use that to find the start of the trailer in order to read the header.

Parameters
ArThe archive to load the trailer from
Returns
True if a valid trailer was found and was able to be loaded, otherwise false. If the trailer was found but failed to load then the archive will be set to the error state.

◆ TryLoadFromArchive()

bool UE::FPackageTrailer::TryLoadFromArchive ( FArchive Ar,
FPackageTrailer OutTrailer 
)
static

Try to load a trailer from a given archive. Assumes that the trailer is at the end of the archive

◆ TryLoadFromFile()

bool UE::FPackageTrailer::TryLoadFromFile ( const FString &  Path,
FPackageTrailer OutTrailer 
)
static

Try to load a trailer from a given file path.

◆ TryLoadFromPackage()

bool UE::FPackageTrailer::TryLoadFromPackage ( const FPackagePath PackagePath,
FPackageTrailer OutTrailer 
)
static

Try to load a trailer from a given package path. Note that it will always try to load the trailer from the workspace domain

◆ UpdatePayloadAsVirtualized()

bool UE::FPackageTrailer::UpdatePayloadAsVirtualized ( const FIoHash Identifier)

Calling this indicates that the payload has been virtualized and will no longer be stored on disk.

Parameters
IdentifierThe payload that has been virtualized
Returns
True if the payload was in the trailer, otherwise false

Friends And Related Symbol Documentation

◆ FPackageTrailerBuilder


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