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

#include <StructSerializer.h>

Static Public Member Functions

static SERIALIZATION_API void Serialize (const void *Struct, UStruct &TypeInfo, IStructSerializerBackend &Backend, const FStructSerializerPolicies &Policies)
 
static SERIALIZATION_API void SerializeElement (const void *Address, FProperty *Property, int32 ElementIndex, IStructSerializerBackend &Backend, const FStructSerializerPolicies &Policies)
 
static void Serialize (const void *Struct, UStruct &TypeInfo, IStructSerializerBackend &Backend)
 
template<typename StructType >
static void Serialize (const StructType &Struct, IStructSerializerBackend &Backend)
 
template<typename StructType >
static void Serialize (const StructType &Struct, IStructSerializerBackend &Backend, const FStructSerializerPolicies &Policies)
 

Detailed Description

Implements a static class that can serialize UStruct based types.

This class implements the basic functionality for the serialization of UStructs, such as iterating a structure's properties and writing property values. The actual writing of serialized output data is performed by serialization backends, which allows this class to remain serialization format agnostic.

The serializer's behavior can be customized with serialization policies. This allows for control over how to handle null values, circular references and other edge cases.

Member Function Documentation

◆ Serialize() [1/4]

template<typename StructType >
static void FStructSerializer::Serialize ( const StructType &  Struct,
IStructSerializerBackend Backend 
)
inlinestatic

Serializes a given USTRUCT to a string using the default policy.

Parameters
StructTypeThe type of the struct to serialize.
StructThe struct to serialize.
BackendThe serialization backend to use.
Returns
A string holding the serialized object.

◆ Serialize() [2/4]

template<typename StructType >
static void FStructSerializer::Serialize ( const StructType &  Struct,
IStructSerializerBackend Backend,
const FStructSerializerPolicies Policies 
)
inlinestatic

Serializes a given USTRUCT to a string using the specified policy.

Parameters
StructTypeThe type of the struct to serialize.
StructThe struct to serialize.
BackendThe serialization backend to use.
PoliciesThe serialization policies to use.
Returns
A string holding the serialized object.

◆ Serialize() [3/4]

static void FStructSerializer::Serialize ( const void Struct,
UStruct TypeInfo,
IStructSerializerBackend Backend 
)
inlinestatic

Serializes a given data structure of the specified type using the default policy.

Parameters
StructThe data structure to serialize.
TypeInfoThe structure's type information.
BackendThe serialization backend to use.
See also
Deserialize

◆ Serialize() [4/4]

void FStructSerializer::Serialize ( const void Struct,
UStruct TypeInfo,
IStructSerializerBackend Backend,
const FStructSerializerPolicies Policies 
)
static

Serializes a given data structure of the specified type using the specified policy.

Parameters
StructThe data structure to serialize.
TypeInfoThe structure's type information.
BackendThe serialization backend to use.
PoliciesThe serialization policies to use.
See also
Deserialize

◆ SerializeElement()

void FStructSerializer::SerializeElement ( const void Address,
FProperty Property,
int32  ElementIndex,
IStructSerializerBackend Backend,
const FStructSerializerPolicies Policies 
)
static

Serializes a given element of a data structure of the specified type using the specified policy.

Parameters
AddressThe address of the container of the property to serialize.
PropertyThe property to serialize.
ElementIndexThe index of the element to serialize if property is a container.
BackendThe serialization backend to use.
PoliciesThe serialization policies to use.
See also
Deserialize

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