UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PropertyPathName.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
6#include "Containers/Array.h"
9#include "UObject/NameTypes.h"
11
12#define UE_API COREUOBJECT_API
13
14class FJsonValue;
15
16namespace UE
17{
18
50
57{
58 static_assert(NAME_NO_NUMBER == INDEX_NONE);
59
60 struct FSegment
61 {
62 FName NameWithIndex;
64
65 inline FPropertyPathNameSegment Unpack() const
66 {
67 return FPropertyPathNameSegment().SetNameWithIndex(NameWithIndex).SetType(Type);
68 }
69
70 inline static FSegment Pack(const FPropertyPathNameSegment& Segment)
71 {
72 return {Segment.PackNameWithIndex(), Segment.Type};
73 }
74
75 bool operator==(const FSegment& Segment) const;
76 bool operator<(const FSegment& Segment) const;
77 int32 Compare(const FSegment& Segment) const;
78 };
79
80public:
82 inline int32 GetSegmentCount() const
83 {
84 return Segments.Num();
85 }
86
89 {
90 return Segments[Index].Unpack();
91 }
92
95 {
96 Segments[Index] = FSegment::Pack(Segment);
97 }
98
101 {
102 Segments.Emplace(FSegment::Pack(Segment));
103 }
104
106 inline void Pop()
107 {
108 Segments.Pop(EAllowShrinking::No);
109 }
110
112 inline void SetIndex(int32 Index)
113 {
114 if (!Segments.IsEmpty())
115 {
116 Segments.Last().NameWithIndex.SetNumber(NAME_EXTERNAL_TO_INTERNAL(Index));
117 }
118 }
119
120 inline bool IsEmpty() const { return Segments.IsEmpty(); }
121 inline void Empty() { Segments.Empty(); }
122 inline void Reset() { Segments.Reset(); }
123
124 UE_API bool operator==(const FPropertyPathName& Path) const;
125 UE_API bool operator<(const FPropertyPathName& Path) const;
126
127 inline bool operator!=(const FPropertyPathName& Path) const { return !(*this == Path); }
128 inline bool operator<=(const FPropertyPathName& Path) const { return !(Path < *this); }
129 inline bool operator>=(const FPropertyPathName& Path) const { return !(*this < Path); }
130 inline bool operator>(const FPropertyPathName& Path) const { return (Path < *this); }
131
133 {
134 Path.ToString(Builder);
135 return Builder;
136 }
137
138 UE_API void ToString(FStringBuilderBase& Out, FStringView Separator = TEXTVIEW(" -> ")) const;
139
142
143 UE_API friend uint32 GetTypeHash(const FPropertyPathName& Path);
144
145private:
146 TArray<FSegment> Segments;
147};
148
149} // UE
150
151#undef UE_API
@ INDEX_NONE
Definition CoreMiscDefines.h:150
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
bool operator<(const FTextFormatString &LHS, const FTextFormatString &RHS)
Definition ITextFormatArgumentModifier.h:147
#define NAME_NO_NUMBER
Definition NameTypes.h:164
#define NAME_NO_NUMBER_INTERNAL
Definition NameTypes.h:157
#define NAME_EXTERNAL_TO_INTERNAL(x)
Definition NameTypes.h:161
#define NAME_INTERNAL_TO_EXTERNAL(x)
Definition NameTypes.h:160
#define UE_API
Definition SColorGradingComponentViewer.h:12
#define TEXTVIEW(str)
Definition StringView.h:553
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition JsonValue.h:22
Definition NameTypes.h:617
FORCEINLINE int32 GetNumber() const
Definition NameTypes.h:644
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT ElementType & Last(SizeType IndexFromTheEnd=0) UE_LIFETIMEBOUND
Definition Array.h:1263
void Reset(SizeType NewSize=0)
Definition Array.h:2246
UE_REWRITE bool IsEmpty() const
Definition Array.h:1133
UE_FORCEINLINE_HINT SizeType Emplace(ArgsType &&... Args)
Definition Array.h:2561
ElementType Pop(EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:1196
void Empty(SizeType Slack=0)
Definition Array.h:2273
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition PropertyPathName.h:57
bool operator<=(const FPropertyPathName &Path) const
Definition PropertyPathName.h:128
void Empty()
Definition PropertyPathName.h:121
UE_API bool operator==(const FPropertyPathName &Path) const
Definition PropertyPathName.cpp:34
void Reset()
Definition PropertyPathName.h:122
void Push(const FPropertyPathNameSegment &Segment)
Definition PropertyPathName.h:100
UE_API friend uint32 GetTypeHash(const FPropertyPathName &Path)
Definition PropertyPathName.cpp:133
int32 GetSegmentCount() const
Definition PropertyPathName.h:82
static UE_API bool FromJsonValue(const TSharedPtr< FJsonValue > &JsonValue, FPropertyPathName &OutPath)
Definition PropertyPathName.cpp:111
friend FStringBuilderBase & operator<<(FStringBuilderBase &Builder, const FPropertyPathName &Path)
Definition PropertyPathName.h:132
UE_API TSharedRef< FJsonValue > ToJsonValue() const
Definition PropertyPathName.cpp:99
bool operator>(const FPropertyPathName &Path) const
Definition PropertyPathName.h:130
void SetIndex(int32 Index)
Definition PropertyPathName.h:112
UE_API bool operator<(const FPropertyPathName &Path) const
Definition PropertyPathName.cpp:53
FPropertyPathNameSegment GetSegment(int32 Index) const
Definition PropertyPathName.h:88
void Pop()
Definition PropertyPathName.h:106
bool operator>=(const FPropertyPathName &Path) const
Definition PropertyPathName.h:129
bool IsEmpty() const
Definition PropertyPathName.h:120
bool operator!=(const FPropertyPathName &Path) const
Definition PropertyPathName.h:127
void SetSegment(int32 Index, const FPropertyPathNameSegment &Segment)
Definition PropertyPathName.h:94
Definition PropertyTypeName.h:46
Definition AdvancedWidgetsModule.cpp:13
U16 Index
Definition radfft.cpp:71
CORE_API FString ToString() const
Definition Color.cpp:584
Definition PropertyPathName.h:23
FName Name
Definition PropertyPathName.h:25
static UE_API bool FromJsonValue(const TSharedPtr< FJsonValue > &JsonValue, FPropertyPathNameSegment &OutSegment)
Definition PropertyPathName.cpp:156
FPropertyTypeName Type
Definition PropertyPathName.h:27
FPropertyPathNameSegment SetNameWithIndex(FName NameWithIndex) const
Definition PropertyPathName.h:37
FName PackNameWithIndex() const
Definition PropertyPathName.h:32
FPropertyPathNameSegment SetType(FPropertyTypeName NewType) const
Definition PropertyPathName.h:42
UE_API TSharedRef< FJsonValue > ToJsonValue() const
Definition PropertyPathName.cpp:144