FLinkerSave

Handles saving Unreal package files.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

FLinker

FArchiveUObject

FLinkerSave

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/UObject/LinkerSave.h

Include

#include "UObject/LinkerSave.h"

Syntax

class FLinkerSave :
    public FLinker,
    public FArchiveUObject

Remarks

Handles saving Unreal package files.

Variables

Name Description

Public variable

TArray< Additio...

 

AdditionalDataToAppend

Array of callbacks that will be invoked when it is possible to serialize out data to the end of the output file.

Public variable

bool

 

bProceduralSave

Set to true when the package is being saved due to a procedural save.

Public variable

TArray< FBulkDa...

 

BulkDataToAppend

Public variable

bool

 

bUpdatingLoadedPath

Set to true when the LoadedPath of the package being saved is being updated.

Public variable

FPackageIndex

 

CurrentlySavingExport

Public variable

TArray< FPackag...

 

DepListForErrorChecking

Public variable

TArray< FFileRe...

 

FileRegions

Public variable

TMap< FNameEntr...

 

NameIndices

Index array - location of the name in the NameMap array for each FName is stored in the NameIndices array using the FName's Index

Public variable

TMap< UObject &...

 

ObjectIndicesMap

Index array - location of the resource for a UObject is stored in the ObjectIndices array using the UObject's Index

Public variable

TUniquePtr< UE:...

 

PackageTrailerBuilder

Gathers all payloads while save the package, so that they can be stored in a single data structure

Public variable

TArray< TUnique...

 

PostSaveCallbacks

Array of callbacks that will be invoked when the package has successfully saved to disk.

Public variable

TRefCountPtr< F...

 

SaveContext

Save context associated with this linker

Public variable

FArchive *

 

Saver

Variables.

Public variable

TMap< const UOb...

 

SearchableNamesObjectMap

List of Searchable Names, by object containing them. This gets turned into package indices later

Public variable

TArray< FSideca...

 

SidecarDataToAppend

Used by FVirtualizedUntypedBulkData to add payloads to be added to the payload sidecar file (currently an experimental feature)

Constructors

Name Description

Public function

FLinkerSave

(
    UPackage* InParent,
    bool bForceByteSwapping,
    bool bInSaveUnversioned
)

Constructor for memory writer

Public function

FLinkerSave

(
    UPackage* InParent,
    const TCHAR* InFilename,
    bool bForceByteSwapping,
    bool bInSaveUnversioned
)

Constructor for file writer

Public function

FLinkerSave

(
    UPackage* InParent,
    FArchive* InSaver,
    bool bForceByteSwapping,
    bool bInSaveUnversioned
)

Constructor for custom savers. The linker assumes ownership of the custom saver.

Destructors

Name Description

Public function Virtual

~FLinkerSave()

Functions

Name Description

Public function

bool

 

CloseAndDestroySaver()

Closes and deletes the Saver (file, memory or custom writer) which will close any associated file handle.

Public function Const

const FStrin...

 

GetFilename()

Get the filename being saved to

Public function Const

FOutputDevic...

 

GetOutputDevice()

Returns an output Device that can be used to log info, warnings and errors etc.

Public function Const

int32

 

MapName

(
    FNameEntryId Name
)

Returns the appropriate name index for the source name, or 0 if not found in NameIndices

Public function Const

FPackageInde...

 

MapObject

(
    const UObject* Object
)

Returns the appropriate package index for the source object, or default value if not found in ObjectIndicesMap

Public function

void

 

OnPostSave

(
    const FPackagePath& PackagePath,
    FObjectPostSaveContext ObjectSaveCo...
)

Invoke all of the callbacks in PostSaveCallbacks and then empty it.

Protected function

void

 

SetFilename

(
    FStringView InFilename
)

Set the filename being saved to

Public function

void

 

SetOutputDevice

(
    FOutputDevice* InOutputDevice
)

Set the output device used to log errors, if any.

Public function Static

ELinkerType:...

 

StaticType()

Public function

void

 

ThisRequiresLocalizationGather()

Sets a flag indicating that this archive contains data required to be gathered for localization.

Overridden from FLinker

Name Description

Public function Virtual Const

FString

 

GetDebugName()

Returns a descriptor of the PackagePath this Linker is reading from or writing to, usable for an identifier in warning and log messages

Overridden from FArchive

Name Description

Public function Virtual

void

 

PopDebugDataString()

Public function Virtual

void

 

PushDebugDataString

(
    const FName& DebugData
)

Proxy for debugdata

Public function Virtual

void

 

Seek

(
    int64 InPos
)

Attempts to set the current offset into backing data storage, this will do nothing if there is no storage.

Public function Virtual

void

 

Serialize

(
    void* V,
    int64 Length
)

Public function Virtual

void

 

UsingCustomVersion

(
    const FGuid& Guid
)

Registers the custom version to the archive.

Overridden from FArchiveState

Name Description

Public function Virtual Const

FString

 

GetArchiveName()

Returns the name of the Archive.

Public function Virtual

FLinker *...

 

GetLinker()

If this archive is a FLinkerLoad or FLinkerSave, returns a pointer to the FLinker portion.

Public function Virtual

FUObjectSeri...

 

GetSerializeContext()

Gets the current UObject serialization context for this archive.

Public function Virtual

void

 

SetSerializeContext

(
    FUObjectSerializeContext* InLo...
)

Sets the current UObject serialization context for this archive.

Public function Virtual

void

 

SetUseUnversionedPropertySerialization

(
    bool bInUseUnversioned
)

Sets whether tagged property serialization should be replaced by faster unversioned serialization.

Public function Virtual

int64

 

Tell()

Returns the current location within the backing data storage, which can possibly be passed to Seek later to restore a read/write location.

Operators

Name Description

Public function Virtual

FArchive &

 

operator<<

(
    FName& Value
)

Serializes an FName value from or into this archive.

Public function Virtual

FArchive &

 

operator<<

(
    FLazyObjectPtr& Value
)

Serializes a lazy object pointer value from or into this archive.

Public function Virtual

FArchive &

 

operator<<

(
    UObject*& Value
)

Serializes an UObject value from or into this archive.

Classes

Name

Description

Public struct

FBulkDataStorageInfo

List of bulkdata that needs to be stored at the end of the file

Public struct

FSidecarStorageInfo

Typedefs

Name

Description

AdditionalDataCallback

Callback for arbitrary serializers to append data to the end of the ExportsArchive.

Constants

Name

Description

PackagesToScriptSHAMap

A mapping of package name to generated script SHA keys