UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
StructDeserializerBackendUtilities.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "UObject/Class.h"
11
12
14{
25 static bool ClearPropertyValue(FProperty* Property, FProperty* Outer, void* Data, int32 ArrayIndex)
26 {
28
29 if (ArrayProperty != nullptr)
30 {
31 if (ArrayProperty->Inner != Property)
32 {
33 return false;
34 }
35
36 FScriptArrayHelper ArrayHelper(ArrayProperty, ArrayProperty->template ContainerPtrToValuePtr<void>(Data));
37 ArrayIndex = ArrayHelper.AddValue();
38 }
39
40 Property->ClearValue_InContainer(Data, ArrayIndex);
41
42 return true;
43 }
44
45
56 static void* GetPropertyValuePtr(FProperty* Property, FProperty* Outer, void* Data, int32 ArrayIndex)
57 {
59
61 {
62 if (ArrayProperty->Inner != Property)
63 {
64 return nullptr;
65 }
66
67 FScriptArrayHelper ArrayHelper(ArrayProperty, ArrayProperty->template ContainerPtrToValuePtr<void>(Data));
68 int32 Index = ArrayHelper.AddValue();
69
70 return ArrayHelper.GetRawPtr(Index);
71 }
72
73 if (ArrayIndex >= Property->ArrayDim)
74 {
75 return nullptr;
76 }
77
78 return Property->template ContainerPtrToValuePtr<void>(Data, ArrayIndex);
79 }
80
91 template<typename PropertyType, typename ValueType>
92 static bool SetPropertyValue(PropertyType* Property, FProperty* Outer, void* Data, int32 ArrayIndex, const ValueType& Value)
93 {
94 if (void* Ptr = GetPropertyValuePtr(Property, Outer, Data, ArrayIndex))
95 {
96 Property->SetPropertyValue(Ptr, Value);
97 return true;
98 }
99
100 return false;
101 }
102};
#define check(expr)
Definition AssertionMacros.h:314
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition UnrealType.h:3702
Definition UnrealType.h:174
Definition UnrealType.h:4175
U16 Index
Definition radfft.cpp:71
Definition StructDeserializerBackendUtilities.h:14
static bool SetPropertyValue(PropertyType *Property, FProperty *Outer, void *Data, int32 ArrayIndex, const ValueType &Value)
Definition StructDeserializerBackendUtilities.h:92
static bool ClearPropertyValue(FProperty *Property, FProperty *Outer, void *Data, int32 ArrayIndex)
Definition StructDeserializerBackendUtilities.h:25
static void * GetPropertyValuePtr(FProperty *Property, FProperty *Outer, void *Data, int32 ArrayIndex)
Definition StructDeserializerBackendUtilities.h:56