Language:
Discover
By Skill Level
By Category

FArchive

Choose your OS:

Inheritance Hierarchy

Syntax

class FArchive

Remarks

Base class for archives that can be used for loading, saving, and garbage collecting in a byte order neutral way.

Variables

Name Description

Public variable

uint8 : 1

 

ArAllowLazyLoading

Whether to allow lazy loading.

Public variable

uint8 : 1

 

ArContainsCode

Quickly tell if an archive contains script code.

Public variable

uint8 : 1

 

ArContainsMap

Used to determine whether FArchive contains a level or world.

Public variable

const FCustomPr ...

 

ArCustomPropertyList

Custom property list attribute.

Public variable

uint32

 

ArDebugSerializationFlags

Custom serialization modifier flags can be used for anything

Protected variable

uint32

 

ArEngineNetVer

Holds the engine network protocol version.

Protected variable

FEngineVersionB ...

 

ArEngineVer

Holds the engine version.

Public variable

uint8 : 1

 

ArForceByteSwapping

Whether we should forcefully swap bytes.

Public variable

uint8 : 1

 

ArForceUnicode

Whether this archive wants to always save strings in unicode format

Protected variable

uint32

 

ArGameNetVer

Holds the game network protocol version.

Public variable

uint8 : 1

 

ArIgnoreArchetypeRef

If true, we will not serialize the ObjectArchetype reference in UObject .

Public variable

uint8 : 1

 

ArIgnoreClassGeneratedByRef

If true, we will not serialize ClassGeneratedBy reference in UClass .

Public variable

uint8 : 1

 

ArIgnoreClassRef

If true, UObject::Serialize will skip serialization of the Class property.

Public variable

uint8 : 1

 

ArIgnoreOuterRef

If true, we will not serialize the Outer reference in UObject .

Public variable

uint8 : 1

 

ArIsCountingMemory

Whether this archive is counting memory and therefore wants e.g. TMaps to be serialized.

Public variable

uint8 : 1

 

ArIsCriticalError

Whether this archive contains critical errors.

Public variable

uint8 : 1

 

ArIsError

Whether this archive contains errors.

Public variable

uint8 : 1

 

ArIsFilterEditorOnly

Whether editor only properties are being filtered from the archive (or has been filtered).

Public variable

uint8 : 1

 

ArIsLoading

Whether this archive is for loading data.

Public variable

uint8 : 1

 

ArIsModifyingWeakAndStrongReferences

Whether a reference collector is modifying the references and wants both weak and strong ones

Public variable

uint8 : 1

 

ArIsObjectReferenceCollector

Whether this archive only cares about serializing object references.

Public variable

uint8 : 1

 

ArIsPersistent

Whether this archive saves to persistent storage.

Public variable

uint8 : 1

 

ArIsSaveGame

Whether this archive is saving/loading game state

Public variable

uint8 : 1

 

ArIsSaving

Whether this archive is for saving data.

Public variable

uint8 : 1

 

ArIsTransacting

Whether archive is transacting.

Protected variable

int32

 

ArLicenseeUE4Ver

Holds the archive version for licensees.

Public variable

int64

 

ArMaxSerializeSize

Max size of data that this archive is allowed to serialize.

Public variable

uint8 : 1

 

ArNoDelta

If true, we will not serialize the ObjectArchetype reference in UObject .

Public variable

uint32

 

ArPortFlags

Modifier flags that be used when serializing UProperties

Public variable

uint8 : 1

 

ArRequiresLocalizationGather

Used to determine whether FArchive contains data required to be gathered for localization.

Public variable

int32

 

ArSerializingDefaults

Whether we are currently serializing defaults. > 0 means yes, <= 0 means no.

Public variable

uint8 : 1

 

ArShouldSkipBulkData

Whether bulk data serialization should be skipped or not.

Protected variable

int32

 

ArUE4Ver

Holds the archive version.

Public variable

uint8 : 1

 

ArUseCustomPropertyList

Set TRUE to use the custom property list attribute for serialization.

Public variable

uint8 : 1

 

ArWantBinaryPropertySerialization

Whether this archive wants properties to be serialized in binary form instead of tagged.

Constructors

Name Description

Public function

FArchive()

Default constructor.

Public function

FArchive

(
    const FArchive &
)

Copy constructor.

Destructors

Name Description

Public function Virtual

~FArchive()

Destructor.

Functions

Name Description

Public function Virtual

bool

 

AtEnd()

Public function Virtual

void

 

AttachBulkData

(
    UObject * Owner,
    FUntypedBulkData * BulkData
)

Attaches/ associates the passed in bulk data object with the linker.

Public function Virtual

bool

 

AttachExternalReadDependency

(
    FExternalReadCallback & ReadCallbac...
)

Adds external read dependency

Public function

FArchive &

 

ByteOrderSerialize

(
    void* V,
    int32 Length
)

Public function

void

 

ByteSwap

(
    void* V,
    int32 Length
)

Used to do byte swapping on small items. This does not happen usually, so we don't want it inline.

Public function Virtual

bool

 

Close()

Public function

bool

 

ContainsCode()

Public function

bool

 

ContainsMap()

Public function

const ITarge ...

 

CookingTarget()

Returns the cooking target platform.

Target platform.

Public function Virtual

void

 

CountBytes

(
    SIZE_T InNum,
    SIZE_T InMax
)

Public function

int32

 

CustomVer

(
    const FGuid & Key
)

Queries a custom version from the archive.

Public function Virtual

void

 

DetachBulkData

(
    FUntypedBulkData * BulkData,
    bool bEnsureBulkDataIsLoaded
)

Detaches the passed in bulk data object from the linker.

Public function

bool

 

DoDelta()

Public function

uint32

 

EngineNetVer()

Public function

FEngineVersi ...

 

EngineVer()

Protected function

bool

 

FastPathLoad

(
    void* InDest
)

Public function Virtual

void

 

Flush()

Public function Virtual

void

 

FlushCache()

Flushes cache and frees internal data.

Public function Virtual

void

 

ForceBlueprintFinalization()

Inform the archive that a blueprint would like to force finalization, normally this is triggered by CDO load, but if there's no CDO we force finalization.

Public function

bool

 

ForceByteSwapping()

Public function

uint32

 

GameNetVer()

Public function Virtual

UObject *...

 

GetArchetypeFromLoader

(
    const UObject * Obj
)

Called to retrieve the archetype from the event driven loader.

Public function Virtual

FString

 

GetArchiveName()

Returns the name of the Archive.

Public function Virtual

const FCusto ...

 

GetCustomVersions()

Gets the custom version numbers for this archive.

Public function

uint32

 

GetDebugSerializationFlags()

Public function Virtual

bool

 

GetError()

Public function Virtual

FLinker *...

 

GetLinker()

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

Public function Virtual

FString

 

GetLocalizationNamespace()

Get the localization namespace that this archive should use when serializing text properties.

Public function

int64

 

GetMaxSerializeSize()

Public function

uint32

 

GetPortFlags()

Public function

UProperty &#...

 

GetSerializedProperty()

Gets the property that is currently being serialized

Public function

bool

 

HasAllPortFlags

(
    uint32 Flags
)

Public function

bool

 

HasAnyPortFlags

(
    uint32 Flags
)

Public function Virtual

void

 

IndicateSerializationMismatch()

Public function

bool

 

IsAllowingLazyLoading()

Public function

bool

 

IsByteSwapping()

Public function Virtual

bool

 

IsCloseComplete

(
    bool& bHasError
)

Returns if an async close operation has finished or not, as well as if there was an error.

Public function

bool

 

IsCooking()

Checks whether the archive is used for cooking.

Public function

bool

 

IsCountingMemory()

Public function

bool

 

IsCriticalError()

Public function

bool

 

IsEditorOnlyPropertyOnTheStack()

Returns true if the stack of currently serialized properties contains an editor-only property

Public function

bool

 

IsError()

Public function Virtual

bool

 

IsFilterEditorOnly()

Indicates whether this archive is filtering editor-only on save or contains data that had editor-only content stripped.

Public function

bool

 

IsForcingUnicode()

Public function

bool

 

IsIgnoringArchetypeRef()

Public function

bool

 

IsIgnoringClassGeneratedByRef()

Public function

bool

 

IsIgnoringClassRef()

Public function

bool

 

IsIgnoringOuterRef()

Public function

bool

 

IsLoading()

Public function

bool

 

IsModifyingWeakAndStrongReferences()

Public function

bool

 

IsObjectReferenceCollector()

Public function

bool

 

IsPersistent()

Public function Virtual

bool

 

IsSaveGame()

Indicates whether this archive is saving or loading game state

Public function

bool

 

IsSaving()

Public function

bool

 

IsSerializingDefaults()

Public function

bool

 

IsTransacting()

Public function

int32

 

LicenseeUE4Ver()

Public function

void

 

Logf

(
    const TCHAR * Fmt,
    ...
)

Logf implementation for convenience.

Public function Virtual

void

 

MarkScriptSerializationEnd

(
    const UObject * Obj
)

Called when an object stops serializing property data using script serialization.

Public function Virtual

void

 

MarkScriptSerializationStart

(
    const UObject * Obj
)

Called when an object begins serializing property data using script serialization.

Public function Virtual

void

 

MarkSearchableName

(
    const UObject * TypeObject,
    const FName & ValueName
)

Called to register a reference to a specific name value, of type TypeObject (UEnum or UStruct normally).

Public function Virtual

void

 

PopDebugDataString()

Public function

void

 

PopEditorOnlyProperty()

Pops editor-only marker from the stack of currently serialized properties

Public function Virtual

bool

 

Precache

(
    int64 PrecacheOffset,
    int64 PrecacheSize
)

Hint the archive that the region starting at passed in offset and spanning the passed in size is going to be read soon and should be precached.

Public function Virtual

void

 

Preload

(
    UObject * Object
)

Public function Virtual

void

 

PushDebugDataString

(
    const FName & DebugData
)

Debug stack storage if you want to add data to the archive for usage further down the serialization stack this should be used in conjunction with the FScopeAddDebugData struct

Public function

void

 

PushEditorOnlyProperty()

Pushes editor-only marker to the stack of currently serialized properties

Public function

bool

 

RequiresLocalizationGather()

Protected function

void

 

Reset()

USE_STABLE_LOCALIZATION_KEYS.

Public function Virtual

void

 

ResetCustomVersions()

Resets the custom version numbers for this archive.

Public function Virtual

void

 

Seek

(
    int64 InPos
)

Public function Virtual

void

 

Serialize

(
    void* V,
    int64 Length
)

Public function Virtual

void

 

SerializeBits

(
    void* V,
    int64 LengthBits
)

Public function

void

 

SerializeCompressed

(
    void* V,
    int64 Length,
    ECompressionFlags Flags,
    bool bTreatBufferAsFileReader,
    bool bUsePlatformBitWindow
)

WITH_MULTI_THREADED_COMPRESSION.

Public function Virtual

void

 

SerializeInt

(
    uint32 & Value,
    uint32 Max
)

Public function Virtual

void

 

SerializeIntPacked

(
    uint32 & Value
)

Packs int value into bytes of 7 bits with 8th bit for 'more'

Public function

void

 

SetByteSwapping

(
    bool Enabled
)

Toggle byte order swapping.

Public function Virtual

bool

 

SetCompressionMap

(
    TArray < struct FCompressedChunk >&...,
    ECompressionFlags CompressionFlags
)

Sets mapping from offsets/ sizes that are going to be used for seeking and serialization to what is actually stored on disk.

Public function

void

 

SetCookingTarget

(
    const ITargetPlatform * InCooki...
)

Sets the cooking target platform.

Public function

void

 

SetCustomVersion

(
    const FGuid & Key,
    int32 Version,
    FName FriendlyName
)

Sets a specific custom version

Public function Virtual

void

 

SetCustomVersions

(
    const FCustomVersionContainer & Cus...
)

Sets the custom version numbers for this archive.

Public function

void

 

SetDebugSerializationFlags

(
    uint32 InCustomFlags
)

Sets the archives custom serialization modifier flags (nothing to do with PortFlags or Custom versions)

Public function

void

 

SetEngineNetVer

(
    const uint32 InEngineNetVer
)

Sets the archive engine network version.

Public function

void

 

SetEngineVer

(
    const FEngineVersionBase & InVer
)

Sets the archive engine version.

Public function

void

 

SetError()

Public function Virtual

void

 

SetFilterEditorOnly

(
    bool InFilterEditorOnly
)

Sets a flag indicating that this archive needs to filter editor-only content.

Public function

void

 

SetForceUnicode

(
    bool Enabled
)

Toggle saving as Unicode.

Public function

void

 

SetGameNetVer

(
    const uint32 InGameNetVer
)

Sets the archive game network version.

Public function

void

 

SetLicenseeUE4Ver

(
    int32 InVer
)

Sets the archive licensee version number.

Public function Virtual

void

 

SetLocalizationNamespace

(
    const FString & InLocalizationNames...
)

Set the localization namespace that this archive should use when serializing text properties.

Public function

void

 

SetPortFlags

(
    uint32 InPortFlags
)

Sets the archive's property serialization modifier flags

Public function

void

 

SetSerializedProperty

(
    UProperty * InProperty
)

Sets the property that is currently being serialized

Public function

void

 

SetUE4Ver

(
    int32 InVer
)

Sets the archive version number.

Public function

bool

 

ShouldSkipBulkData()

Public function Virtual

bool

 

ShouldSkipProperty

(
    const UProperty * InProperty
)

Checks whether the archive wants to skip the property independent of the other flags

Public function

void

 

StartSerializingDefaults()

Sets a flag indicating that this archive is currently serializing class/struct defaults.

Public function

void

 

StopSerializingDefaults()

Indicate that this archive is no longer serializing class/struct defaults.

Public function Virtual

int64

 

Tell()

Public function

void

 

ThisContainsCode()

Sets a flag indicating that this archive contains code.

Public function

void

 

ThisContainsMap()

Sets a flag indicating that this archive contains a ULevel or UWorld object.

Public function

void

 

ThisRequiresLocalizationGather()

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

Public function Virtual

int64

 

TotalSize()

Public function

int32

 

UE4Ver()

Public function Virtual

bool

 

UseToResolveEnumerators()

Checks whether the archive is used to resolve out-of-date enum indexes If function returns true, the archive should be called only for objects containing user defined enum

Public function

void

 

UsingCustomVersion

(
    const FGuid & Guid
)

Registers the custom version to the archive.

Public function

bool

 

WantBinaryPropertySerialization()

Operators

Name Description

Public function Virtual

FArchive &

 

operator<<

(
    FSoftObjectPtr & Value
)

Serializes asset pointer 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

FArchive &

 

operator<<

(
    TCheckedObjPtr < T >& Value
)

Serializes a UObject wrapped in a TCheckedObjPtr container, using the above operator, and verifies the serialized object is derived from the correct base class, to prevent illegal casting.

Public function Virtual

FArchive &

 

operator<<

(
    UObject *& Value
)

Serializes an UObject value from or into this archive.

Public function Virtual

FArchive &

 

operator<<

(
    FText & Value
)

Serializes an FText value from or into an archive.

Public function Virtual

FArchive &

 

operator<<

(
    FName & Value
)

Serializes an FName value from or into this archive.

Public function Virtual

FArchive &

 

operator<<

(
    FSoftObjectPath & Value
)

Serializes soft object paths from or into this archive.

This instance.

Public function Virtual

FArchive &

 

operator<<

(
    FWeakObjectPtr & Value
)

Serializes FWeakObjectPtr value from or into this archive.

Public function

FArchive &

 

operator=

(
    const FArchive & ArchiveToCopy
)

Copy assignment operator.

Classes

References

Module

Core

Header

Runtime/Core/Public/Serialization/Archive.h