Navigation
API > API/Runtime > API/Runtime/JsonUtilities
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
The registered struct should have the following functions (the compiler will fail without them): EJsonObjectConvertResult ConvertToJson(TSharedPtr
| Name | IJsonObjectStructConverter |
| Type | struct |
| Header File | /Engine/Source/Runtime/JsonUtilities/Public/JsonObjectStructInterface.h |
| Include Path | #include "JsonObjectStructInterface.h" |
Syntax
struct IJsonObjectStructConverter
Derived Classes
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~IJsonObjectStructConverter() |
JsonObjectStructInterface.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
EJsonObjectConvertResult ConvertFromJson
(
void* StructMemory, |
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. | JsonObjectStructInterface.h | |
EJsonObjectConvertResult ConvertToJson
(
const void* StructMemory, |
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. | JsonObjectStructInterface.h |