Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/Serialization
Inheritance Hierarchy
- FArchiveState
- FArchive
- FArchiveFileReaderGeneric
- FMovieSceneArchiveFileReader
- FArchiveFileWriterGeneric
- FMovieSceneArchiveFileWriter
- FArchiveLoadCompressedProxy
- FArchiveMD5
- FArchiveProxy
- FActorDescArchive
- FActorDescArchivePatcher
- FArchiveFromStructuredArchiveImpl
- FArchiveStackTraceWriter
- FChaosArchive
- FHierarchicalLogArchive
- FMaterialResourceProxyReader
- FNameAsStringIndexProxyArchive
- FNameAsStringProxyArchive
- FObjectAndNameAsStringProxyArchive
- FPropertyProxyArchive
- TVersionedReader
- TVersionedWriter
- FArchiveSaveCompressedProxy
- FArchiveUObject
- FArchiveCountMem
- FArchiveCrc32
- FArchiveFindCulprit
- FArchiveGenerateReferenceGraph
- FArchiveHasReferences
- FArchiveObjectCrc32
- FArchiveObjectPropertyMapper
- FArchiveReferenceMarker
- FArchiveReplaceObjectRefBase
- FArchiveScriptReferenceCollector
- FArchiveShowReferences
- FArchiveTopLevelReferenceCollector
- FDuplicateDataReader
- FDuplicateDataWriter
- FFindAssetsArchive
- FFindReferencersArchive
- FKeyBuilder
- FLinkerLoad
- FLinkerSave
- FReferenceCollectorArchive
- FSerializedObjectDataReader
- FSerializedObjectDataWriterCommon
- FDiffableObjectDataWriter
- FSerializedObjectDataWriter
- FSoftObjectPathFixupArchive
- FArchiveWithDelegate
- FAsyncWriter
- FBitArchive
- FBitReader
- FNetBitReader
- FInBunch
- FBitWriter
- FNetBitWriter
- FOutBunch
- FControlChannelOutBunch
- FBufferReaderBase
- FBufferReader
- FBufferReaderWithSHA
- FBulkDataReader
- FEditorBulkDataReader
- FBufferWriter
- FBuildVersionBuilder
- FBulkDataWriter
- FCacheKeyBuilder
- FEditorBulkDataWriter
- FMemoryArchive
- FArrayReader
- FConcertIdentifierRewriter
- FConcertSyncObjectRewriter
- FLargeMemoryReader
- FArchiveStackTraceReader
- FLargeMemoryWriter
- FArchiveStackTrace
- FArchiveStackTraceMemoryWriter
- FMemoryReader
- FChaosVDMemoryReader
- FConcertIdentifierReader
- FConcertSyncObjectReader
- FMLAdapterMemoryReader
- FMemoryReaderView
- FObjectReader
- FBinaryObjectReader
- FStaticMemoryReader
- TMemoryHasher
- TMemoryWriterBase
- FMemoryWriter
- FChaosVDMemoryWriter
- FConcertIdentifierWriter
- FConcertSyncObjectWriter
- FMaterialResourceMemoryWriter
- FMLAdapterMemoryWriter
- FObjectWriter
- FBinaryObjectWriter
- FMemoryWriter64
- TBufferArchive
- FBufferArchive
- FNetworkFileArchive
- FBufferArchive64
- FOpenXRCaptureEncoder
- FOutputDeviceMemory::FOutputDeviceMemoryProxyArchive
- FPreloadableArchive
- FPreloadableFile
- FPreloadableArchiveProxy
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/Serialization/Archive.h |
| Include | #include "Serialization/Archive.h" |
Syntax
class FArchive : private FArchiveState
Remarks
Base class for archives that can be used for loading, saving, and garbage collecting in a byte order neutral way.
Variables
| Type | Name | Description | |
|---|---|---|---|
| uint8: 1 | ArAllowLazyLoading | Whether to allow lazy loading of bulk/secondary data. | |
| uint8: 1 | ArContainsCode | Quickly tell if an archive contains script code. | |
| uint8: 1 | ArContainsMap | Used to determine whether FArchive contains a level or world. | |
| const FCustomPropertyListNode * | ArCustomPropertyList | Custom property list attribute. | |
| uint32 | ArDebugSerializationFlags | Custom serialization modifier flags can be used for anything | |
| uint8: 1 | ArForceByteSwapping | Whether we should forcefully swap bytes. | |
| uint8: 1 | ArIgnoreArchetypeRef | If true, we will not serialize archetype references for structs and classes. | |
| uint8: 1 | ArIgnoreClassGeneratedByRef | If true, we will not serialize ClassGeneratedBy reference in UClass. | |
| uint8: 1 | ArIgnoreClassRef | If true, UObject::Serialize will skip serialization of the Class property. | |
| uint8: 1 | ArIgnoreOuterRef | If true, we will not serialize the Outer reference in UObject. | |
| uint8: 1 | ArIsCountingMemory | Whether this archive is counting memory. | |
| uint8: 1 | ArIsFilterEditorOnly | Whether editor only properties are being filtered from the archive (or has been filtered). | |
| uint8: 1 | ArIsModifyingWeakAndStrongReferences | Whether a reference collector is modifying the references and wants both weak and strong ones | |
| uint8: 1 | ArIsNetArchive | Whether or not this archive is sending/receiving network data | |
| uint8: 1 | ArIsObjectReferenceCollector | Whether this archive only cares about serializing object references. | |
| uint8: 1 | ArIsSaveGame | Whether this archive is saving/loading game state | |
| int64 | ArMaxSerializeSize | Max size of data that this archive is allowed to serialize. | |
| uint8: 1 | ArMergeOverrides | Set to false if OverriddenProperties should be cleared at the beginning of SerializeVersionedTaggedProperties. | |
| uint8: 1 | ArNoDelta | If true, do not perform delta serialization of properties. | |
| uint8: 1 | ArNoIntraPropertyDelta | If true, do not perform delta serialization within properties (e.g. TMaps and TSets). | |
| uint32 | ArPortFlags | Modifier flags that be used when serializing UProperties | |
| uint8: 1 | ArRequiresLocalizationGather | Used to determine whether FArchive contains data required to be gathered for localization. | |
| int32 | ArSerializingDefaults | Whether we are currently serializing defaults. > 0 means yes, <= 0 means no. | |
| uint8: 1 | ArShouldSkipBulkData | Whether bulk data serialization should be skipped or not. | |
| uint8: 1 | ArUseCustomPropertyList | Set TRUE to use the custom property list attribute for serialization. |
Constructors
Destructors
| Type | Name | Description | |
|---|---|---|---|
~FArchive () |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AttachBulkData
(
UObject* Owner, |
Attaches/ associates the passed in bulk data object with the linker. | |
| void | AttachBulkData
(
UE::Serialization::FEditorBulkData* BulkData |
||
| bool | AttachExternalReadDependency
(
FExternalReadCallback& ReadCallback |
Adds external read dependency | |
| FArchive & | ByteOrderSerialize
(
void* V, |
Serialize data of Length bytes, taking into account byte swapping if needed. | |
| void | Used to do byte swapping on small items. This does not happen usually, so we don't want it inline. | ||
| void | ClearError () |
Sets ArIsError to false, this does not clear any CriticalErrors | |
| bool | Close () |
Attempts to close and finalize any handles used for backing data storage, returns true if it succeeded. | |
| bool | ContainsCode () |
Returns true if this archive contains native or generated code. | |
| bool | ContainsMap () |
Returns true if this archive contains a ULevel or UWorld object. | |
| const ITargetPlatform * | Returns the cooking target platform. | ||
| int32 | Queries a custom version from the archive. | ||
| void | DetachBulkData
(
UE::Serialization::FEditorBulkData* BulkData, |
||
| void | DetachBulkData
(
FBulkData* BulkData, |
Detaches the passed in bulk data object from the linker. | |
| bool | DoDelta () |
Returns true if this archive should handle delta serialization for properties. | |
| bool | Returns true if this archive should perform delta serialization within properties (e.g. TMaps and TSets). | ||
| FEngineVersionBase | EngineVer () |
Returns the compiled engine version used for this archive. | |
| bool | FastPathLoad
(
void* InDest |
||
| void | Flush () |
Attempts to finish writing any buffered data to disk/permanent storage. | |
| void | FlushCache () |
Flushes cache and frees internal data. | |
| void | 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. | ||
| bool | Returns true if this archive should always swap bytes, ignoring endian rules. | ||
| const FArchiveState & | |||
| FArchiveState & | Returns the low level archive state for this archive. | ||
| FArchive * | Returns a pointer to an archive that represents the same data that the current archive covers, but that can be cached and reused later In the case of standard archives, this function will just return a pointer to itself. | ||
| FArchiveCookContext * | |||
| FArchiveCookData * | GetCookData () |
||
| uint32 | Returns the editor-only debug serialization flags. | ||
| bool | GetError () |
||
| int64 | Returns the maximum size of data that this archive is allowed to serialize. | ||
| uint32 | GetPortFlags () |
Returns this archive's property serialization modifier flags. | |
| FArchiveSavePackageData * | |||
| FProperty * | Gets the property that is currently being serialized | ||
| void | GetSerializedPropertyChain
(
TArray< class FProperty* >& OutProperties |
Gets the chain of properties that are currently being serialized | |
| const FArchiveSerializedPropertyChain * | Get the raw serialized property chain for this archive | ||
| bool | HasAllPortFlags
(
uint32 Flags |
Checks to see if all of the passed in property serialization modifier flags are set. | |
| bool | HasAnyPortFlags
(
uint32 Flags |
Checks to see if any of the passed in property serialization modifier flags are set. | |
| bool | Returns true if this archive sould allow lazy loading of bulk / secondary data. | ||
| bool | Returns true if data larger than 1 byte should be swapped to deal with endian mismatches. | ||
| bool | IsCooking () |
Checks whether the archive is used for cooking. | |
| bool | Returns true if this archive is counting memory, normally CountBytes is called to get the size. | ||
| bool | Returns true if this archive contains critical errors that cannot be recovered from. | ||
| bool | IsError () |
Returns true if this archive contains errors, which means that further serialization is generally not safe. | |
| bool | Indicates whether this archive is filtering editor-only on save or contains data that had editor-only content stripped. | ||
| bool | Returns true if this archive wants to always save strings in UTF16 format even if they are ANSI characters. | ||
| bool | Returns true if this archive should ignore archetype references for structs and classes. | ||
| bool | Returns true if this archive should ignore the ClassGeneratedBy reference in UClass. | ||
| bool | Returns true if this archive should ignore the Class reference in UObject. | ||
| bool | Returns true if this archive should ignore the Outer reference in UObject. | ||
| bool | IsLoading () |
Returns true if this archive is for loading data. | |
| bool | Returns true if this archive is loading from a cooked package. | ||
| bool | Returns true if this archive should modify/search weak object references as well as strong ones. | ||
| bool | IsNetArchive () |
Whether or not this archive is serializing data being sent/received by the netcode | |
| bool | Returns true if this archive is only looking for UObject references. | ||
| bool | IsPersistent () |
Returns true if this archive is saving or loading data destined for persistent storage and should skip transient data. | |
| bool | Determine if the given archive is a valid "child" of this archive. | ||
| bool | IsSaveGame () |
Indicates whether this archive is saving or loading game state | |
| bool | IsSaving () |
Returns true if this archive is for saving data, this can also be a pre-save preparation archive. | |
| bool | Returns true if this archive is currently serializing class/struct default values. | ||
| bool | IsTextFormat () |
Returns true if this archive serializes to a structured text format. | |
| bool | Returns true if this archive is transacting, which is used to keep track of changes to objects for things like the editor undo system. | ||
| int32 | Returns the licensee-specific version used for this archive, will be 0 by default. | ||
| void | LinkProxy
(
FArchiveState& Inner, |
||
| void | Logf
(
const FmtType& Fmt, |
Logf implementation for convenience. | |
| void | MarkScriptSerializationEnd
(
const UObject* Obj |
Called when an object stops serializing property data using script serialization. | |
| void | MarkScriptSerializationStart
(
const UObject* Obj |
Called when an object begins serializing property data using script serialization. | |
| void | MarkSearchableName
(
const TObjectPtr< const UObject >& TypeObject, |
Called to register a reference to a specific name value, of type TypeObject (UEnum or UStruct normally). | |
| void | |||
| void | |||
| void | PopSerializedProperty
(
FProperty* InProperty, |
Pop a property that was previously being serialized off the property stack | |
| bool | 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. | ||
| void | Preload
(
UObject* Object |
Tells the archive to attempt to preload the specified object so data can be loaded out of it. | |
| 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 | |
| void | PushFileRegionType
(
EFileRegionType Type |
Called whilst cooking to provide file region hints to the cooker. | |
| void | PushSerializedProperty
(
FProperty* InProperty, |
Push a property that is currently being serialized onto the property stack | |
| bool | Returns true if this archive contains data required to be gathered for localization. | ||
| void | Attempts to set the current offset into backing data storage, this will do nothing if there is no storage. | ||
| void | |||
| void | SerializeBits
(
void* V, |
||
| void | SerializeBool
(
bool& D |
Serializes a Boolean value from or into an archive. | |
| bool | SerializeBulkData
(
FBulkData& BulkData, |
Serialize bulk data. | |
| void | SerializeCompressed
(
void* V, |
Serializes and compresses/ uncompresses data. | |
| void | SerializeCompressedNew
(
void* V, |
Serializes and compresses/ uncompresses data. | |
| void | SerializeCompressedNew
(
void* V, |
Serializes and compresses/ uncompresses data with default compressor choices. | |
| void | SerializeInt
(
uint32& Value, |
||
| void | SerializeIntPacked
(
uint32& Value |
Packs int value into bytes of 7 bits with 8th bit for 'more' | |
| void | SerializeIntPacked64
(
uint64& Value |
||
| void | SetArchiveState
(
const FArchiveState& InState |
Modifies current archive state, can be used to override flags. | |
| void | SetByteSwapping
(
bool Enabled |
Toggle byte order swapping. | |
| bool | SetCompressionMap
(
TArray< struct FCompressedChunk >* CompressedChunks, |
Sets mapping from offsets/ sizes that are going to be used for seeking and serialization to what is actually stored on disk. | |
| void | SetCookData
(
FArchiveCookData* InCookData |
||
| void | Sets the archiver IsCriticalError and IsError to true. | ||
| void | SetCustomVersion
(
const FGuid& Key, |
Sets a specific custom version | |
| void | SetDebugSerializationFlags
(
uint32 InCustomFlags |
Sets the archives custom serialization modifier flags (nothing to do with PortFlags or Custom versions) | |
| void | SetError () |
Sets ArIsError to true. Also sets error in the proxy archiver if one is wrapping this. | |
| void | SetPortFlags
(
uint32 InPortFlags |
Sets the archive's property serialization modifier flags | |
| void | SetSavePackageData
(
FArchiveSavePackageData* InSavePackageData |
Marks that this archive is one of the archives used by SavePackage, and provides access to data and functions used only during savepackage, such as the cook data bundle for information about the cook being conducted (if applicable) and writing build dependencies for assetregistry. | |
| void | SetShouldSkipCompilingAssets
(
bool Enabled |
Set whether or not it is allowed to skip serialization on assets still being compiled to avoid waiting unless strictly necessary. | |
| void | SetShouldSkipUpdateCustomVersion
(
bool bShouldSkip |
If set true, UsingCurrentVersion will not query the version registry to get the latest version data for the key if the version key is already set in the local container. | |
| bool | Returns true if this archive should ignore bulk data. | ||
| bool | Returns true if it is allowed to skip serialization on assets still being compiled to avoid waiting unless strictly necessary. | ||
| bool | Returns true if this Archive is does not update the custom version data for a given key if has already been set previously in the local custom versions container | ||
| void | Sets a flag indicating that this archive is currently serializing class/struct defaults. | ||
| void | Indicate that this archive is no longer serializing class/struct defaults. | ||
| void | Sets a flag indicating that this archive contains native or generated code. | ||
| void | Sets a flag indicating that this archive contains a ULevel or UWorld object. | ||
| void | Sets a flag indicating that this archive contains data required to be gathered for localization. | ||
| FPackageFileVersion | UEVer () |
Returns the global engine serialization version used for this archive. | |
| void | UnlinkProxy
(
FArchiveState& Inner, |
||
| bool | Returns true if tagged property serialization should be replaced by faster unversioned serialization. | ||
| void | UsingCustomVersion
(
const FGuid& Guid |
Registers the custom version to the archive. | |
| bool | Returns true if this archive wants properties to be serialized in binary form instead of safer but slower tagged form. |
Overridden from FArchiveState
| Type | Name | Description | |
|---|---|---|---|
| bool | AtEnd () |
Returns true if the current location within the backing data storage is at the end, always returns false if there is no storage. | |
| void | CountBytes
(
SIZE_T InNum, |
Called to get the computed size from a size-detecting archive after it has finished serializing. | |
| uint32 | EngineNetVer () |
Returns the engine-global network protocol version for this archive. | |
| uint32 | GameNetVer () |
Returns the game-specific network protocol version for this archive. | |
| UObject * | GetArchetypeFromLoader
(
const UObject* Obj |
Called to retrieve the archetype from the event driven loader. | |
| FString | Returns the name of the Archive. | ||
| const FCustomVersionContainer & | Gets the custom version numbers for this archive. | ||
| FArchiveState & | Returns lowest level archive state, proxy archives will override this. | ||
| FLinker * | GetLinker () |
If this archive is a FLinkerLoad or FLinkerSave, returns a pointer to the ULinker portion. | |
| FString | Get the localization namespace that this archive should use when serializing text properties. | ||
| FUObjectSerializeContext * | Gets the current UObject serialization context for this archive. | ||
| bool | Returns true if the stack of currently serialized properties contains an editor-only property | ||
| void | Reset () |
Resets all of the base archive members. | |
| void | Resets the custom version numbers for this archive. | ||
| void | SetCustomVersions
(
const FCustomVersionContainer& CustomVersionContainer |
Sets the custom version numbers for this archive. | |
| void | SetEngineNetVer
(
const uint32 InEngineNetVer |
Sets the archive engine network version. | |
| void | SetEngineVer
(
const FEngineVersionBase& InVer |
Sets the archive engine version. | |
| void | SetFilterEditorOnly
(
bool InFilterEditorOnly |
Sets a flag indicating that this archive needs to filter editor-only content. | |
| void | SetForceUnicode
(
bool bInForceUnicode |
Sets whether this archive wants to force saving as Unicode. | |
| void | SetGameNetVer
(
const uint32 InGameNetVer |
Sets the archive game network version. | |
| void | SetIsLoading
(
bool bInIsLoading |
Sets whether this archive is for loading data. | |
| void | SetIsLoadingFromCookedPackage
(
bool bInIsLoadingFromCookedPackage |
Sets whether the archive is loading from a cooked package. | |
| void | SetIsPersistent
(
bool bInIsPersistent |
Sets whether this archive is to persistent storage. | |
| void | SetIsSaving
(
bool bInIsSaving |
Sets whether this archive is for saving data. | |
| void | SetIsTextFormat
(
bool bInIsTextFormat |
Sets whether this archive is in text format. | |
| void | SetIsTransacting
(
bool bInIsTransacting |
Sets whether this archive is for transacting. | |
| void | SetLicenseeUEVer
(
int32 InVer |
Sets the archive licensee version number. | |
| void | SetLocalizationNamespace
(
const FString& InLocalizationNamespace |
Set the localization namespace that this archive should use when serializing text properties. | |
| void | SetSerializeContext
(
FUObjectSerializeContext* InLoadContext |
Sets the current UObject serialization context for this archive. | |
| void | SetSerializedProperty
(
FProperty* InProperty |
Overrides the property that is currently being serialized | |
| void | SetSerializedPropertyChain
(
const FArchiveSerializedPropertyChain* InSerializedPropertyChain, |
Set the raw serialized property chain for this archive, optionally overriding the serialized property too (or null to use the head of the property chain) | |
| void | SetUEVer
(
FPackageFileVersion InVer |
Sets the archive version number. | |
| void | SetUseUnversionedPropertySerialization
(
bool bInUseUnversioned |
Sets whether tagged property serialization should be replaced by faster unversioned serialization. | |
| void | SetWantBinaryPropertySerialization
(
bool bInWantBinaryPropertySerialization |
Sets whether this archive wants binary property serialization. | |
| bool | ShouldSkipProperty
(
const FProperty* InProperty |
Checks whether the archive wants to skip the property independent of the other flags | |
| 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. | |
| int64 | TotalSize () |
Returns total size of the backing data storage. | |
| bool | 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 |
Operators
| Type | Name | Description | |
|---|---|---|---|
| FArchive & | operator<<
(
FField*& Value |
Serializes a Field value from or into this archive. | |
| FArchive & | operator<<
(
FName& Value |
Serializes an FName value from or into this archive. | |
| FArchive & | operator<<
(
FText& Value |
Serializes an FText value from or into an archive. | |
| FArchive & | operator<<
(
UObject*& Value |
Serializes an UObject value from or into this archive. | |
| 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. | |
| FArchive & | operator<<
(
FWeakObjectPtr& Value |
Serializes FWeakObjectPtr value from or into this archive. | |
| FArchive & | operator<<
(
FObjectPtr& Value |
Serializes a wrapped object pointer value from or into this archive. | |
| FArchive & | operator<<
(
FSoftObjectPtr& Value |
Serializes asset pointer from or into this archive. | |
| FArchive & | operator<<
(
FSoftObjectPath& Value |
Serializes soft object paths from or into this archive. | |
| FArchive & | operator<<
(
FLazyObjectPtr& Value |
Serializes a lazy object pointer value from or into this archive. | |
| FArchive & |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FScopeAddDebugData | |||
| FScopeSeekTo | Seeks to and restores the position of an archive. | ||
| FScopeSetDebugSerializationFlags |