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

#include <JsonObjectStructInterface.h>

+ Inheritance diagram for IJsonObjectStructConverter:

Public Member Functions

virtual EJsonObjectConvertResult ConvertToJson (const void *StructMemory, TSharedPtr< FJsonObject > &OutJsonObject) const =0
 
virtual EJsonObjectConvertResult ConvertFromJson (void *StructMemory, const TSharedPtr< FJsonObject > &InJsonObject) const =0
 

Protected Member Functions

virtual ~IJsonObjectStructConverter ()=default
 

Detailed Description

UStructs are special and may need to avoid the use of virtual functions via standard interface patterns due to mismatched base-class polymorphism. So use a static TImplementsJsonObjectStructConverter<StructType> which uses a static-interface pattern with global type-registry instead of implementing an interface directly.

The registered struct should have the following functions (the compiler will fail without them): EJsonObjectConvertResult ConvertToJson(TSharedPtr<FJsonObject>& OutJsonObject) const; EJsonObjectConvertResult ConvertFromJson(const TSharedPtr<FJsonObject>& InJsonObject);

Constructor & Destructor Documentation

◆ ~IJsonObjectStructConverter()

virtual IJsonObjectStructConverter::~IJsonObjectStructConverter ( )
protectedvirtualdefault

Member Function Documentation

◆ ConvertFromJson()

virtual EJsonObjectConvertResult IJsonObjectStructConverter::ConvertFromJson ( void StructMemory,
const TSharedPtr< FJsonObject > &  InJsonObject 
) const
pure virtual

Result of Converted represents success by the interface call, FailAndAbort will bubble up the failure to its owner converter failing the entire converter tree, IgnoreAndContinue should leave the struct untouched/default and the converter tree can still succeed, and UseDefaultConverter will try to fallback to the non-static-interface behavior instead.

Implemented in TImplementsJsonObjectStructConverter< StructType >.

◆ ConvertToJson()

virtual EJsonObjectConvertResult IJsonObjectStructConverter::ConvertToJson ( const void StructMemory,
TSharedPtr< FJsonObject > &  OutJsonObject 
) const
pure virtual

Result of Converted represents success by the interface call, FailAndAbort will bubble up the failure to its owner converter which may fail the entire converter tree, IgnoreAndContinue will make an empty FJsonObject for this struct and the converter tree can still succeed, and UseDefaultConverter will try to fallback to the non-static-interface behavior instead.

Implemented in TImplementsJsonObjectStructConverter< StructType >.


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