FJsonStructSerializerBackend

Implements a writer for [UStruct](API\Runtime\CoreUObject\UObject\UStruct) serialization using Json.

Windows
MacOS
Linux

Inheritance Hierarchy

IStructSerializerBackend

FJsonStructSerializerBackend

References

Module

Serialization

Header

/Engine/Source/Runtime/Serialization/Public/Backends/JsonStructSerializerBackend.h

Include

#include "Backends/JsonStructSerializerBackend.h"

Syntax

class FJsonStructSerializerBackend : public IStructSerializerBackend

Remarks

Implements a writer for UStruct serialization using Json.

The underlying Json serializer is currently hard-coded to use UCS2CHAR and pretty-print. This is because the current JsonWriter API does not allow writers to be substituted since it's all based on templates. At some point we will refactor the low-level Json API to provide more flexibility for serialization.

Constructors

Name Description

Public function

FJsonStructSerializerBackend

(
    FArchive& InArchive
)

Use the two-parameter constructor with EStructSerializerBackendFlags::Legacy only if you need backwards compatibility with code compiled prior to 4.22; otherwise use EStructSerializerBackendFlags::Default.

Public function

FJsonStructSerializerBackend

(
    FArchive& InArchive,
    const EStructSerializerBackendFlags...
)

Creates and initializes a new instance with the given flags.

Functions

Name Description

Protected function

TSharedRef< ...

 

GetWriter()

Allow access to the internal JsonWriter to subclasses.

Protected function

void

 

WriteNull

(
    const FStructSerializerState& Stat...
)

Writes a null value to the serialization output.

Protected function

void

 

WritePropertyValue

(
    const FStructSerializerState& Stat...,
    const ValueType& Value
)

Writes a property value to the serialization output.

Overridden from IStructSerializerBackend

Name Description

Public function Virtual

void

 

BeginArray

(
    const FStructSerializerState& Stat...
)

Signals the beginning of an array.

Public function Virtual

void

 

BeginStructure

(
    const FStructSerializerState& Stat...
)

Signals the beginning of a child structure.

Public function Virtual

void

 

EndArray

(
    const FStructSerializerState& Stat...
)

Signals the end of an array.

State.ValueProperty points to the property that holds the array.

Public function Virtual

void

 

EndStructure

(
    const FStructSerializerState& Stat...
)

Signals the end of an object.

State.ValueProperty points to the property that holds the struct.

Public function Virtual

void

 

WriteComment

(
    const FString& Comment
)

Writes a comment to the output stream.

Public function Virtual

void

 

WriteProperty

(
    const FStructSerializerState& Stat...,
    int32 ArrayIndex
)

Writes a property to the output stream.

Deprecated Functions

Name Description

Public function

 

FJsonStructSerializerBackend

(
    FArchive& InArchive
)

Use the two-parameter constructor with EStructSerializerBackendFlags::Legacy only if you need backwards compatibility with code compiled prior to 4.22; otherwise use EStructSerializerBackendFlags::Default.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss