UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PropertyTag.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*-----------------------------------------------------------------------------
4 FPropertyTag.
5-----------------------------------------------------------------------------*/
6
7#pragma once
8
9#include "CoreTypes.h"
10#include "Misc/Guid.h"
12#include "UObject/NameTypes.h"
14
16class FArchive;
17class FProperty;
18
33
38{
39 // Transient.
40 UE_DEPRECATED(5.4, "Prop has been deprecated. Use GetProperty()/SetProperty().")
41 FProperty* Prop = nullptr;
42
43 // Variables.
45 UE::FPropertyTypeName TypeName;
46
47public:
48 FName Type; // Type of property
49 FName Name; // Name of property.
50 UE_DEPRECATED(5.4, "StructName has been deprecated and replaced by GetType(). Use GetType().IsStruct(StructName) to test, otherwise if Type is StructProperty then StructName is GetType().GetParameterName(0).")
51 FName StructName; // Struct name if FStructProperty.
52 UE_DEPRECATED(5.4, "EnumName has been deprecated and replaced by GetType(). Use GetType().IsEnum(EnumName) to test, otherwise if Type is EnumProperty or ByteProperty then EnumName is GetType().GetParameterName(0).")
53 FName EnumName; // Enum name if FByteProperty or FEnumProperty
54 UE_DEPRECATED(5.4, "InnerName has been deprecated and replaced by GetType(). If Type is ArrayProperty/SetProperty/MapProperty/OptionalProperty then InnerType is GetType().GetParameterName(0).")
55 FName InnerType; // Inner type if FArrayProperty, FSetProperty, FMapProperty, or OptionalProperty
56 UE_DEPRECATED(5.4, "ValueName has been deprecated and replaced by GetType(). If Type is MapProperty then ValueType is GetType().GetParameterName(1).")
57 FName ValueType; // Value type if UMapProperty
58 int32 Size = 0; // Property size.
59 int32 ArrayIndex = INDEX_NONE; // Index if an array; else 0.
60 int64 SizeOffset = INDEX_NONE; // location in stream of tag size member
61 UE_DEPRECATED(5.4, "StructGuid has been deprecated and replaced by GetType(). If Type is StructProperty then StructGuid is GetType().GetParameterName(1).")
65 uint8 BoolVal = 0;// a boolean property's value (never need to serialize data for bool properties except here)
67 EOverriddenPropertyOperation OverrideOperation; // Overridable serialization state reconstruction
68 bool bExperimentalOverridableLogic = false; // Remember if property had CPF_ExperimentalOverridableLogic when saved
69
70 // Constructors.
73
76 FPropertyTag(const FPropertyTag&) = default;
77 FPropertyTag& operator=(FPropertyTag&&) = default;
78 FPropertyTag& operator=(const FPropertyTag&) = default;
80
87
90
91 inline UE::FPropertyTypeName GetType() const { return TypeName; }
92 void SetType(UE::FPropertyTypeName TypeName);
93
94 // Serializer.
97
98 // Property serializer.
101
102private:
105};
106
108{
110 : PropertyTagToRestore(CurrentPropertyTag)
111 {
112 CurrentPropertyTag = InCurrentPropertyTag;
113 }
114
116 {
117 CurrentPropertyTag = PropertyTagToRestore;
118 }
119
121 {
122 return CurrentPropertyTag;
123 }
124private:
125 const FPropertyTag* PropertyTagToRestore;
126
127 static thread_local const FPropertyTag* CurrentPropertyTag;
128};
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_INTERNAL
Definition CoreMiscDefines.h:345
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
EOverriddenPropertyOperation
Definition OverriddenPropertySet.h:179
EPropertyTagSerializeType
Definition PropertyTag.h:23
@ IsStruct
Indicates the property is eligible for shared serialization.
if(Failed) console_printf("Failed.\n")
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Archive.h:1208
Definition NameTypes.h:617
Definition UnrealType.h:174
Definition StructuredArchiveSlots.h:52
Definition PropertyTypeName.h:46
Definition AdvancedWidgetsModule.cpp:13
@ false
Definition radaudio_common.h:23
Definition Guid.h:109
Definition PropertyTag.h:108
~FPropertyTagScope()
Definition PropertyTag.h:115
static UE_FORCEINLINE_HINT const FPropertyTag * GetCurrentPropertyTag()
Definition PropertyTag.h:120
FPropertyTagScope(const FPropertyTag *InCurrentPropertyTag)
Definition PropertyTag.h:109
Definition PropertyTag.h:38
uint8 BoolVal
Definition PropertyTag.h:65
EPropertyTagSerializeType SerializeType
Definition PropertyTag.h:66
UE::FPropertyTypeName GetType() const
Definition PropertyTag.h:91
friend FArchive & operator<<(FArchive &Ar, FPropertyTag &Tag)
Definition PropertyTag.cpp:430
EOverriddenPropertyOperation OverrideOperation
Definition PropertyTag.h:67
friend void SerializePropertyTagAsText(FStructuredArchive::FSlot Slot, FPropertyTag &Tag)
Definition PropertyTag.cpp:404
friend void LoadPropertyTagNoFullType(FStructuredArchive::FSlot Slot, FPropertyTag &Tag)
Definition PropertyTag.cpp:195
void SetType(UE::FPropertyTypeName TypeName)
Definition PropertyTag.cpp:87
FGuid PropertyGuid
Definition PropertyTag.h:63
PRAGMA_ENABLE_DEPRECATION_WARNINGS FProperty * GetProperty() const
Definition PropertyTag.h:81
int64 SizeOffset
Definition PropertyTag.h:60
uint8 HasPropertyGuid
Definition PropertyTag.h:64
int32 Size
Definition PropertyTag.h:58
UE_DEPRECATED(5.4, "Prop has been deprecated. Use GetProperty()/SetProperty().") FProperty *Prop
void SetPropertyGuid(const FGuid &InPropertyGuid)
Definition PropertyTag.cpp:81
void SetProperty(FProperty *Property)
Definition PropertyTag.cpp:74
bool bExperimentalOverridableLogic
Definition PropertyTag.h:68
FName Name
Definition PropertyTag.h:49
int32 ArrayIndex
Definition PropertyTag.h:59
void SerializeTaggedProperty(FArchive &Ar, FProperty *Property, uint8 *Value, const uint8 *Defaults) const
Definition PropertyTag.cpp:548
FName Type
Definition PropertyTag.h:48