UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ConfigAccessData.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6
7#if UE_WITH_CONFIG_TRACKING || WITH_EDITOR
12#include "Interfaces/ITargetPlatform.h"
13#include "Templates/TypeHash.h"
14
16{
17
23{
24 FNameEntryId ConfigPlatform;
25 FNameEntryId FileName;
26 FNameEntryId SectionName;
27 FMinimalName ValueName;
28 const ITargetPlatform* RequestingPlatform = nullptr;
29 ELoadType LoadType = ELoadType::Uninitialized;
30
31 FConfigAccessData() = default;
37
39 FName GetFileName() const;
40 FName GetSectionName() const;
41 FName GetValueName() const;
42
45 CORE_API FString FullPathToString() const;
47
53
54 friend uint32 GetTypeHash(const FConfigAccessData& Data);
55 bool IsSameConfigFile(const FConfigAccessData& Other) const;
56 bool operator==(const FConfigAccessData& Other) const;
57 bool operator!=(const FConfigAccessData& Other) const;
58 bool operator<(const FConfigAccessData& Other) const;
59};
60
64
65constexpr FStringView PlatformAgnosticName = TEXTVIEW("<Editor>");
66
67}
68
70const TCHAR* LexToString(UE::ConfigAccessTracking::ELoadType LoadType);
71
73void LexFromString(UE::ConfigAccessTracking::ELoadType& OutLoadType, FStringView Text);
74
76// Inline implementations
78
80{
81
82inline FConfigAccessData::FConfigAccessData(ELoadType InLoadType, FName InConfigPlatform, FName InFileName,
84 : FConfigAccessData(InLoadType, InConfigPlatform.GetComparisonIndex(), InFileName.GetComparisonIndex(),
86{
87}
88
89inline FName FConfigAccessData::GetConfigPlatform() const
90{
91 return FName(ConfigPlatform, ConfigPlatform, NAME_NO_NUMBER_INTERNAL);
92}
93
94inline FName FConfigAccessData::GetFileName() const
95{
96 return FName(FileName, FileName, NAME_NO_NUMBER_INTERNAL);
97}
98
99inline FName FConfigAccessData::GetSectionName() const
100{
101 return FName(SectionName, SectionName, NAME_NO_NUMBER_INTERNAL);
102}
103
104inline FName FConfigAccessData::GetValueName() const
105{
106 return FName(ValueName);
107}
108
109inline uint32 GetTypeHash(const UE::ConfigAccessTracking::FConfigAccessData& Data)
110{
111 uint32 Hash = static_cast<uint32>(Data.LoadType);
112 Hash = HashCombineFast(Hash, Data.ConfigPlatform.ToUnstableInt());
113 Hash = HashCombineFast(Hash, Data.FileName.ToUnstableInt());
114 Hash = HashCombineFast(Hash, Data.SectionName.ToUnstableInt());
116 Hash = HashCombineFast(Hash, GetTypeHash(Data.RequestingPlatform));
117 return Hash;
118}
119
120inline bool FConfigAccessData::IsSameConfigFile(const FConfigAccessData& Other) const
121{
122 return LoadType == Other.LoadType && ConfigPlatform == Other.ConfigPlatform && FileName == Other.FileName;
123}
124
125inline bool FConfigAccessData::operator==(const FConfigAccessData& Other) const
126{
127 return LoadType == Other.LoadType && ConfigPlatform == Other.ConfigPlatform &&
128 FileName == Other.FileName && SectionName == Other.SectionName && ValueName == Other.ValueName &&
129 RequestingPlatform == Other.RequestingPlatform;
130}
131
132inline bool FConfigAccessData::operator!=(const FConfigAccessData& Other) const
133{
134 return !(*this == Other);
135}
136
137inline bool FConfigAccessData::operator<(const FConfigAccessData& Other) const
138{
139 if (LoadType != Other.LoadType)
140 {
141 return static_cast<uint32>(LoadType) < static_cast<uint32>(Other.LoadType);
142 }
143 if (ConfigPlatform != Other.ConfigPlatform)
144 {
145 return ConfigPlatform.LexicalLess(Other.ConfigPlatform);
146 }
147 if (FileName != Other.FileName)
148 {
149 return FileName.LexicalLess(Other.FileName);
150 }
151 if (SectionName != Other.SectionName)
152 {
153 return SectionName.LexicalLess(Other.SectionName);
154 }
155 if (ValueName != Other.ValueName)
156 {
157 return FName(ValueName).LexicalLess(FName(Other.ValueName));
158 }
159 if (RequestingPlatform != Other.RequestingPlatform)
160 {
161 if (RequestingPlatform == nullptr)
162 {
163 return true;
164 }
165 if (Other.RequestingPlatform == nullptr)
166 {
167 return false;
168 }
169 return RequestingPlatform->PlatformName() < Other.RequestingPlatform->PlatformName();
170 }
171 return false;
172}
173
174} // namespace UE::ConfigAccessTracking
175
176#endif // UE_WITH_CONFIG_TRACKING || WITH_EDITOR
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
const TCHAR * LexToString(EAnalyticsRecordEventMode Mode)
Definition IAnalyticsProvider.cpp:5
void LexFromString(EAudioFeature &OutFeature, const TCHAR *String)
Definition IOSAppDelegate.cpp:163
bool operator<(const FTextFormatString &LHS, const FTextFormatString &RHS)
Definition ITextFormatArgumentModifier.h:147
UE_FORCEINLINE_HINT bool operator!=(const FIndexedPointer &Other) const
Definition LockFreeList.h:76
#define NAME_NO_NUMBER_INTERNAL
Definition NameTypes.h:157
#define TEXTVIEW(str)
Definition StringView.h:553
constexpr uint32 HashCombineFast(uint32 A, uint32 B)
Definition TypeHash.h:74
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition NameTypes.h:617
FORCEINLINE bool LexicalLess(const FName &Other) const
Definition NameTypes.h:821
Definition ArrayView.h:139
GeometryCollection::Facades::FMuscleActivationData Data
Definition MuscleActivationConstraints.h:15
uint32 GetTypeHash(const FKey &Key)
Definition BlackboardKey.h:35
bool operator==(const FCachedAssetKey &A, const FCachedAssetKey &B)
Definition AssetDataMap.h:501
Definition ConfigAccessTracking.h:154
TValueOrError< FDocument, FParseError > Parse(const FStringView JsonText)
Definition RapidJsonUtils.cpp:233
CUTF8String GetFileName(const CUTF8StringView &Path)
Definition FilePathUtils.cpp:87
Definition NameTypes.h:439
Definition NameTypes.h:69