#include <PackageTrailer.h>
|
| | FPackageTrailerBuilder ()=default |
| |
| COREUOBJECT_API | FPackageTrailerBuilder (const FName &InPackageName) |
| |
| COREUOBJECT_API | FPackageTrailerBuilder (FString &&DebugContext) |
| |
| | ~FPackageTrailerBuilder ()=default |
| |
| COREUOBJECT_API void | AddPayload (const FIoHash &Identifier, FCompressedBuffer Payload, UE::Virtualization::EPayloadFilterReason Filter, AdditionalDataCallback &&Callback) |
| |
| COREUOBJECT_API void | AddPayload (const FIoHash &Identifier, FCompressedBuffer Payload, UE::Virtualization::EPayloadFilterReason Filter) |
| |
| COREUOBJECT_API void | AddVirtualizedPayload (const FIoHash &Identifier, int64 RawSize) |
| |
| COREUOBJECT_API bool | UpdatePayloadAsLocal (const FIoHash &Identifier, FCompressedBuffer Payload) |
| |
| COREUOBJECT_API bool | BuildAndAppendTrailer (FLinkerSave *Linker, FArchive &DataArchive) |
| |
| COREUOBJECT_API bool | BuildAndAppendTrailer (FLinkerSave *Linker, FArchive &DataArchive, int64 &InOutPackageFileOffset) |
| |
| COREUOBJECT_API bool | IsEmpty () const |
| |
| COREUOBJECT_API bool | IsLocalPayloadEntry (const FIoHash &Identifier) const |
| |
| COREUOBJECT_API bool | IsReferencedPayloadEntry (const FIoHash &Identifier) const |
| |
| COREUOBJECT_API bool | IsVirtualizedPayloadEntry (const FIoHash &Identifier) const |
| |
| COREUOBJECT_API uint64 | CalculateTrailerLength () |
| |
| COREUOBJECT_API int32 | GetNumPayloads () const |
| |
| COREUOBJECT_API int32 | GetNumLocalPayloads () const |
| |
| COREUOBJECT_API int32 | GetNumReferencedPayloads () const |
| |
| COREUOBJECT_API int32 | GetNumVirtualizedPayloads () const |
| |
| const FString & | GetDebugContext () const |
| |
This class is used to build a FPackageTrailer and write it disk.
While saving a package, payloads should be added to a FPackageTrailer via AddPayload then once the package has been saved to disk BuildAndAppendTrailer should be called.
◆ AdditionalDataCallback
◆ FPackageTrailerBuilder() [1/3]
| UE::FPackageTrailerBuilder::FPackageTrailerBuilder |
( |
| ) |
|
|
default |
◆ FPackageTrailerBuilder() [2/3]
| UE::FPackageTrailerBuilder::FPackageTrailerBuilder |
( |
const FName & |
InPackageName | ) |
|
◆ FPackageTrailerBuilder() [3/3]
| UE::FPackageTrailerBuilder::FPackageTrailerBuilder |
( |
FString && |
DebugContext | ) |
|
◆ ~FPackageTrailerBuilder()
| UE::FPackageTrailerBuilder::~FPackageTrailerBuilder |
( |
| ) |
|
|
default |
◆ AddPayload() [1/2]
◆ AddPayload() [2/2]
Adds a payload to the builder to be written to the trailer. Duplicate payloads will be discarded and only a single instance stored in the trailer.
- Parameters
-
| Identifier | The identifier of the payload |
| Payload | The payload data |
| Flags | The custom flags to be applied to the payload |
| Callback | This callback will be invoked once the FPackageTrailer has been built and appended to disk. |
◆ AddVirtualizedPayload()
| void UE::FPackageTrailerBuilder::AddVirtualizedPayload |
( |
const FIoHash & |
Identifier, |
|
|
int64 |
RawSize |
|
) |
| |
Adds an already virtualized payload to the builder to be written to the trailer. When the trailer is written the payload will have EPayloadAccessMode::Virtualized set as it's access mode. It is assumed that the payload is already stored in the virtualization backends and it is up to the calling code to confirm this. Duplicate payloads will be discarded and only a single instance stored in the trailer.
- Parameters
-
| Identifier | The identifier of the payload |
| RawSize | The size of the payload (in bytes) when uncompressed |
◆ BuildAndAppendTrailer() [1/2]
- Parameters
-
| ExportsArchive | The linker associated with the package being written to disk. |
| DataArchive | The archive where the package data has been written to. This is where the FPackageTrailer will be written to |
- Returns
- True if the builder was created and appended successfully and false if any error was encountered
◆ BuildAndAppendTrailer() [2/2]
- Parameters
-
| ExportsArchive | The linker associated with the package being written to disk. |
| DataArchive | The archive where the package data has been written to. This is where the FPackageTrailer will be written to |
| InOutPackageFileOffset | The offset at which the trailer is written in the package file. In this function version, DataArchive might be an archive for the entire package file, or it might be a separate archive solely for the package trailer. The caller must provide the initial value with the accumulated offset, and the function will increment this value by how many bytes are written to DataArchive. |
- Returns
- True if the builder was created and appended successfully and false if any error was encountered
◆ CalculateTrailerLength()
| uint64 UE::FPackageTrailerBuilder::CalculateTrailerLength |
( |
| ) |
|
Returns the length of the trailer (in bytes) that the builder would currently create.
NOTE: At the moment this is not const as we need to check for and remove duplicate payload entries as we do this before building the trailer not when gathering the entry info.
◆ CreateFromTrailer() [1/2]
◆ CreateFromTrailer() [2/2]
Creates a builder from a pre-existing FPackageTrailer. Payloads stored locally in the source trailer will be loaded from disk via the provided archive so that the builder can write them to any future trailer that it creates.
- Parameters
-
| Trailer | The trailer to create the builder from |
| Ar | An archive that the trailer can use to load payloads from |
| DebugContext | The name or path of the of the file that owns the trailer. Used for error messages. |
◆ CreateReferenceToTrailer() [1/2]
◆ CreateReferenceToTrailer() [2/2]
Creates a builder from a pre-existing FPackageTrailer that will will reference the local payloads of the source trailer. This means that there is no need to load the payloads.
- Parameters
-
| Trailer | The trailer to create the reference from. |
| DebugContext | The name or path of the of the file that owns the trailer. Used for error messages. |
◆ GetDebugContext()
| const FString & UE::FPackageTrailerBuilder::GetDebugContext |
( |
| ) |
const |
|
inline |
Returns the debug context associated with the builder, used for adding further description to error messages
◆ GetNumLocalPayloads()
| int32 UE::FPackageTrailerBuilder::GetNumLocalPayloads |
( |
| ) |
const |
◆ GetNumPayloads()
| int32 UE::FPackageTrailerBuilder::GetNumPayloads |
( |
| ) |
const |
Returns the total number of payload entries in the builder
◆ GetNumReferencedPayloads()
| int32 UE::FPackageTrailerBuilder::GetNumReferencedPayloads |
( |
| ) |
const |
◆ GetNumVirtualizedPayloads()
| int32 UE::FPackageTrailerBuilder::GetNumVirtualizedPayloads |
( |
| ) |
const |
◆ IsEmpty()
| bool UE::FPackageTrailerBuilder::IsEmpty |
( |
| ) |
const |
Returns if the builder has any payload entries or not
◆ IsLocalPayloadEntry()
| bool UE::FPackageTrailerBuilder::IsLocalPayloadEntry |
( |
const FIoHash & |
Identifier | ) |
const |
◆ IsReferencedPayloadEntry()
| bool UE::FPackageTrailerBuilder::IsReferencedPayloadEntry |
( |
const FIoHash & |
Identifier | ) |
const |
◆ IsVirtualizedPayloadEntry()
| bool UE::FPackageTrailerBuilder::IsVirtualizedPayloadEntry |
( |
const FIoHash & |
Identifier | ) |
const |
◆ UpdatePayloadAsLocal()
Allows the caller to replace a payload in the builder that is already marked as virtualized and replace it with one that will be stored locally.
- Parameters
-
| Identifier | The identifier of the payload |
| Payload | The content of the payload |
- Returns
- true if a virtualized payload was replaced, false if the payload was not in the builder at all
The documentation for this class was generated from the following files: