UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FJsonSerializable Struct Referenceabstract

#include <JsonSerializable.h>

+ Inheritance diagram for FJsonSerializable:

Public Member Functions

virtual JSON_API ~FJsonSerializable ()
 
JSON_API const FString ToJson (bool bPrettyPrint=true) const
 
JSON_API const FUtf8String ToJsonUtf8 (bool bPrettyPrint=true) const
 
virtual JSON_API const FString ToJson (bool bPrettyPrint=true)
 
virtual JSON_API const FUtf8String ToJsonUtf8 (bool bPrettyPrint=true)
 
template<class CharType , class PrintPolicy , ESPMode SPMode>
void ToJson (TSharedRef< TJsonWriter< CharType, PrintPolicy >, SPMode > JsonWriter, bool bFlatObject=false) const
 
virtual JSON_API bool FromJson (const TCHAR *Json)
 
virtual JSON_API bool FromJson (const UTF8CHAR *Json)
 
virtual JSON_API bool FromJson (const FString &Json)
 
virtual JSON_API bool FromJson (const FUtf8String &Json)
 
virtual JSON_API bool FromJson (FString &&Json)
 
virtual JSON_API bool FromJson (FUtf8String &&Json)
 
JSON_API bool FromJsonStringView (FUtf8StringView JsonStringView)
 
JSON_API bool FromJsonStringView (FWideStringView JsonStringView)
 
virtual JSON_API bool FromJson (TSharedPtr< FJsonObject > JsonObject)
 
virtual void Serialize (FJsonSerializerBase &Serializer, bool bFlatObject)=0
 

Detailed Description

Base class for a JSON serializable object

Constructor & Destructor Documentation

◆ ~FJsonSerializable()

FJsonSerializable::~FJsonSerializable ( )
virtual

Virtualize destructor as we provide overridable functions

Member Function Documentation

◆ FromJson() [1/7]

bool FJsonSerializable::FromJson ( const FString &  Json)
virtual

◆ FromJson() [2/7]

bool FJsonSerializable::FromJson ( const FUtf8String Json)
virtual

◆ FromJson() [3/7]

bool FJsonSerializable::FromJson ( const TCHAR Json)
virtual

Serializes the contents of a JSON string into this object

Parameters
Jsonthe JSON data to serialize from

◆ FromJson() [4/7]

bool FJsonSerializable::FromJson ( const UTF8CHAR Json)
virtual

◆ FromJson() [5/7]

bool FJsonSerializable::FromJson ( FString &&  Json)
virtual

Serializes the contents of a JSON string into this object

Parameters
Jsonthe JSON data to serialize from

◆ FromJson() [6/7]

bool FJsonSerializable::FromJson ( FUtf8String &&  Json)
virtual

◆ FromJson() [7/7]

bool FJsonSerializable::FromJson ( TSharedPtr< FJsonObject JsonObject)
virtual

◆ FromJsonStringView() [1/2]

bool FJsonSerializable::FromJsonStringView ( FUtf8StringView  JsonStringView)

Serializes the contents of a JSON string into this object using FUtf8StringView

Parameters
JsonStringViewthe JSON data to serialize from

◆ FromJsonStringView() [2/2]

bool FJsonSerializable::FromJsonStringView ( FWideStringView  JsonStringView)

Serializes the contents of a JSON string into this object using FWideStringView

Parameters
JsonStringViewthe JSON data to serialize from

◆ Serialize()

virtual void FJsonSerializable::Serialize ( FJsonSerializerBase Serializer,
bool  bFlatObject 
)
pure virtual

Abstract method that needs to be supplied using the macros

Parameters
Serializerthe object that will perform serialization in/out of JSON
bFlatObjectif true then no object wrapper is used

Implemented in FJsonDataBag.

◆ ToJson() [1/3]

const FString FJsonSerializable::ToJson ( bool  bPrettyPrint = true)
virtual

Serializes this object to its JSON string form

Parameters
bPrettyPrint- If true, will use the pretty json formatter
Returns
the corresponding json string

◆ ToJson() [2/3]

const FString FJsonSerializable::ToJson ( bool  bPrettyPrint = true) const

Used to allow serialization of a const ref

Returns
the corresponding json string

◆ ToJson() [3/3]

template<class CharType , class PrintPolicy , ESPMode SPMode>
void FJsonSerializable::ToJson ( TSharedRef< TJsonWriter< CharType, PrintPolicy >, SPMode JsonWriter,
bool  bFlatObject = false 
) const
inline

Serializes this object with a Json Writer

Parameters
JsonWriter- The writer to use
bFlatObjectif true then no object wrapper is used

◆ ToJsonUtf8() [1/2]

const FUtf8String FJsonSerializable::ToJsonUtf8 ( bool  bPrettyPrint = true)
virtual

◆ ToJsonUtf8() [2/2]

const FUtf8String FJsonSerializable::ToJsonUtf8 ( bool  bPrettyPrint = true) const

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