UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ConfigCacheIni.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*-----------------------------------------------------------------------------
4 Config cache.
5-----------------------------------------------------------------------------*/
6
7#pragma once
8
9#include "Algo/Reverse.h"
10#include "Containers/Array.h"
11#include "Containers/Map.h"
12#include "Containers/Set.h"
13#include "Containers/List.h"
17#include "CoreGlobals.h"
18#include "CoreTypes.h"
19#include "Delegates/Delegate.h"
20#include "HAL/PlatformCrt.h"
23#include "Logging/LogMacros.h"
24#include "Math/Color.h"
25#include "Math/MathFwd.h"
26#include "Math/Rotator.h"
27#include "Math/Vector.h"
28#include "Math/Vector2D.h"
29#include "Math/Vector4.h"
30#include "Misc/Build.h"
32#include "Misc/ConfigTypes.h"
33#include "Misc/Paths.h"
34#include "Misc/ScopeRWLock.h"
40#include "Templates/Function.h"
42#include "UObject/NameTypes.h"
43
44class FConfigCacheIni;
45class FConfigFile;
46class FOutputDevice;
48struct FColor;
49
51
52// Server builds should be tweakable even in Shipping
53#define ALLOW_INI_OVERRIDE_FROM_COMMANDLINE (UE_SERVER || !(UE_BUILD_SHIPPING))
54#define CONFIG_CAN_SAVE_COMMENTS (WITH_EDITOR)
55
56
58// Info about the deprecation of functions returning non-const FConfigSections:
59// In a future change, we will be tracking operations done to config files (via GConfig, etc) for improved saving and allowing for plugin unloading.
60// To prepare for this, we need to remove the ability for code to directly modify config sections because then we can't track them. So, functions
61// that return non-cont FConfigSections have been deprecated - continuing to use them may cause these directly-modified settings to not be saved correctly
62//
63// If you are receiving deprecation messages, you should update your code ASAP. The deprecation messages will tell you how to fix that line, but if you
64// were counting on modifying a section directly, or you were iterating over an FConfigFile with a ranged-for iterator ("for (auto& Pair : File)") you will need to
65// make some additional code changes:
66//
67// Modifying:
68// * Replace your direct modification with calls to SetString, SetBool, etc for non-array values
69// * Replace your direct modifications of array type values with AddToSection, AddUniqueToSection, RemoveKeyFromSection, RemoveFromSection
70// * Fully construct a local new FConfigSection and then add that fully into the FConfigFile with Add
71//
72// Iterating over key/value pairs:
73// * Replace FConfigSection::TIterator with FConfigSection::TConstIterator
74//
75// Iterating over sections in a file:
76// * Ranged-for will need to use a const FConfigFile, to force the compiler to use the iterator that returns a const FConfigSection:
77// * for (auto& Pair : AsConst(MyFile))
78// * FConfigFile::TIterator did not seem to be used, but if you did use it, you should replace it with the above ranged-for version
80
81
82
83
85//
86// This is the master list of known ini files that are used and processed
87// on all platforms (specifically for runtime/binary speedups. Other, editor-
88// specific inis, or non-hierarchical ini files will still work with the
89// old system, but they won't have any optimizations applied
90//
91// These should be listed in the order of highest to lowest use, for optimization
92//
94
95#define ENUMERATE_KNOWN_INI_FILES(op) \
96 op(Engine) \
97 op(Game) \
98 op(Input) \
99 op(DeviceProfiles) \
100 op(GameUserSettings) \
101 op(Scalability) \
102 op(RuntimeOptions) \
103 op(InstallBundle) \
104 op(Hardware) \
105 op(GameplayTags)
106
107
108#define KNOWN_INI_ENUM(IniName) IniName,
110{
111 // make an enum entry for each known ini above
113
114 // convenient counter for the above list
116};
117
118class FConfigContext;
119#if UE_WITH_CONFIG_TRACKING
120UE::ConfigAccessTracking::FSection* GetSectionAccess(const FConfigSection* InSection);
121#endif
122
124{
125public:
126 enum class EValueType : uint8
127 {
128 // Foo=Bar
129 Set,
130 // .Foo=Bar
131 ArrayAdd,
132 // +Foo=Bar
134 // -Foo=Bar
135 Remove,
136 // !Foo=ClearArray
137 Clear,
138 // ^Array=Empty, means that this will clear any existing entries from an array property, unlike
139 // Clear which will leave the array propperty untouched (as nothing is in GConfig for the key)
141 // @Array=StructKey
143 // *Array=PerObjectConfigStructKey
145 // Virtual type, meaning it is the final combined result of set operations
146 Combined,
147 // Virtual type, meaning it is the final combined result of array operations
149 };
150
151
153 : FConfigValue(nullptr, NAME_None)
154 {}
155
164
168
170 : SavedValue(InValue)
171 , ValueType(Type)
174 , ValueName(InValueName)
175#endif
176 {
177 SavedValueHash = FTextLocalizationResource::HashString(SavedValue);
178 bExpandOnDemand = NeedsToExpandValue();
179 }
180
182 : FConfigValue(nullptr, NAME_None, InValue, Type)
183 {}
184
186 : SavedValue(InValue)
187 , ValueType(Type)
190 , ValueName(InValueName)
191#endif
192 {
193 SavedValueHash = FTextLocalizationResource::HashString(SavedValue);
194 bExpandOnDemand = NeedsToExpandValue();
195 }
196
200
202 : SavedValue(MoveTemp(InValue))
203 , ValueType(Type)
206 , ValueName(InValueName)
207#endif
208 {
209 SavedValueHash = FTextLocalizationResource::HashString(SavedValue);
210 bExpandOnDemand = NeedsToExpandValue();
211 }
212
214 : SavedValue(InConfigValue.SavedValue)
215 , SavedValueHash(InConfigValue.SavedValueHash)
217 , bExpandOnDemand(InConfigValue.bExpandOnDemand)
220 , ValueName(InConfigValue.ValueName)
221#endif
222 {
223 // shouldn't need to expand value it's assumed that the other FConfigValue has done this already
224 }
225
227 : SavedValue(MoveTemp(InConfigValue.SavedValue))
228 , SavedValueHash(InConfigValue.SavedValueHash)
230 , bExpandOnDemand(InConfigValue.bExpandOnDemand)
233 , ValueName(InConfigValue.ValueName)
234#endif
235 {
236 // shouldn't need to expand value it's assumed that the other FConfigValue has done this already
237 }
238
240 {
241 SavedValue = MoveTemp(RHS.SavedValue);
242 SavedValueHash = RHS.SavedValueHash;
243 ValueType = RHS.ValueType;
244 bExpandOnDemand = RHS.bExpandOnDemand;
245#if UE_WITH_CONFIG_TRACKING
246 SectionAccess = MoveTemp(RHS.SectionAccess);
247 ValueName = RHS.ValueName;
248#endif
249
250 return *this;
251 }
252
254 {
255 SavedValue = RHS.SavedValue;
256 SavedValueHash = RHS.SavedValueHash;
257 ValueType = RHS.ValueType;
258 bExpandOnDemand = RHS.bExpandOnDemand;
259#if UE_WITH_CONFIG_TRACKING
260 SectionAccess = RHS.SectionAccess;
261 ValueName = RHS.ValueName;
262#endif
263
264 return *this;
265 }
266
268 {
269 *this = FString(RHS);
270 return *this;
271 }
272 FConfigValue& operator=(const FString& RHS)
273 {
274 *this = FString(RHS);
275 return *this;
276 }
277 FConfigValue& operator=(FString&& RHS)
278 {
279 SavedValue = MoveTemp(RHS);
280 SavedValueHash = FTextLocalizationResource::HashString(SavedValue);
281 bExpandOnDemand = NeedsToExpandValue();
282 return *this;
283 }
284
285 // Returns the ini setting with any macros expanded out
286 inline FString GetValue() const
287 {
288#if UE_WITH_CONFIG_TRACKING
289 UE::ConfigAccessTracking::Private::OnConfigValueRead(SectionAccess, ValueName, *this);
290#endif
291 return bExpandOnDemand ? ExpandValue(SavedValue) : SavedValue;
292 }
293
294 // Returns the original ini setting without macro expansion
295 const FString& GetSavedValue() const
296 {
297#if UE_WITH_CONFIG_TRACKING
298 UE::ConfigAccessTracking::Private::OnConfigValueRead(SectionAccess, ValueName, *this);
299#endif
300 return SavedValue;
301 }
302#if UE_WITH_CONFIG_TRACKING
303 void SetSectionAccess(UE::ConfigAccessTracking::FSection* InSectionAccess)
304 {
306 }
307#endif
308
309 bool operator==(const FConfigValue& Other) const { return SavedValueHash == Other.SavedValueHash; }
310 bool operator!=(const FConfigValue& Other) const { return !(FConfigValue::operator==(Other)); }
311
317
319 {
320 Slot << ConfigValue.SavedValue;
321
322 if (Slot.GetUnderlyingArchive().IsLoading())
323 {
324 ConfigValue.bExpandOnDemand = ConfigValue.NeedsToExpandValue();
325 }
326 }
327
336 CORE_API static bool ExpandValue(const FString& InCollapsedValue, FString& OutExpandedValue);
337
345 CORE_API static FString ExpandValue(const FString& InCollapsedValue);
346
355 CORE_API static bool CollapseValue(const FString& InExpandedValue, FString& OutCollapsedValue);
356
364 CORE_API static FString CollapseValue(const FString& InExpandedValue);
365
366#if CONFIG_CAN_SAVE_COMMENTS
367 FString Comment;
368#endif
369
372 {
373 return bExpandOnDemand ? ExpandValue(SavedValue) : SavedValue;
374 };
375
377 friend class FConfigCacheIni;
378 friend class FConfigFile;
379 friend class FConfigBranch;
381 const FString& GetSavedValueForWriting() const
382 {
383 return SavedValue;
384 };
385
386private:
388 CORE_API bool NeedsToExpandValue();
389
390 FString SavedValue;
391 uint32 SavedValueHash;
392public:
393 // Add, subtract, stc
395private:
396 bool bExpandOnDemand = false;
397#if UE_WITH_CONFIG_TRACKING
399 FMinimalName ValueName;
400#endif
401};
402
404
405// One section in a config file.
407{
408public:
410 : FConfigSection(nullptr)
411 {
412 }
413
414 FConfigSection(UE::ConfigAccessTracking::FSection* InSectionAccess)
415#if UE_WITH_CONFIG_TRACKING
417#endif
418 {
419 }
420
428 static bool HasQuotes( const FString& Test );
429 bool operator==( const FConfigSection& Other ) const;
430 bool operator!=( const FConfigSection& Other ) const;
431
432 // process the '+' and '.' commands, takingf into account ArrayOfStruct unique keys
434
435 bool HandleArrayOfKeyedStructsCommand(FName Key, FString&& Value);
436
437 template<typename Allocator>
438 void MultiFind(const FName Key, TArray<FConfigValue, Allocator>& OutValues, const bool bMaintainOrder = false) const
439 {
440 FConfigSectionMap::MultiFind(Key, OutValues, bMaintainOrder);
441 }
442
443 template<typename Allocator>
444 void MultiFind(const FName Key, TArray<FString, Allocator>& OutValues, const bool bMaintainOrder = false) const
445 {
446 for (typename ElementSetType::TConstKeyIterator It(Pairs, Key); It; ++It)
447 {
448 OutValues.Add(It->Value.GetValue());
449 }
450
451 if (bMaintainOrder)
452 {
454 }
455 }
456
457 CORE_API bool GetString(const TCHAR* Key, FString& Value) const;
458 CORE_API bool GetText(const TCHAR* Section, const TCHAR* Key, FText& Value) const;
459 CORE_API bool GetInt(const TCHAR* Key, int32& Value) const;
460 CORE_API bool GetUInt(const TCHAR* Key, uint32& Value) const;
461 CORE_API bool GetFloat(const TCHAR* Key, float& Value) const;
462 CORE_API bool GetDouble(const TCHAR* Key, double& Value) const;
463 CORE_API bool GetInt64(const TCHAR* Key, int64& Value) const;
464 CORE_API bool GetBool(const TCHAR* Key, bool& Value) const;
465 CORE_API int32 GetArray(const TCHAR* Key, TArray<FString>& Value) const;
466
467 // look for "array of struct" keys for overwriting single entries of an array
469#if UE_WITH_CONFIG_TRACKING
471#endif
472
473 // a set of (array) keys that have been initialized to empty - this is needed to we can tell the difference between
474 // wanting the array to be cleared out in LoadConfig, vs not being specified at all. a bool can be initialized to false
475 // or not specified at all, but an array has no way to differentiate without this
477
478 // dyanmic modification will disable saving for this section
479 bool bCanSave = true;
480
481 friend FArchive& operator<<(FArchive& Ar, FConfigSection& ConfigSection);
482
483private:
484 friend FConfigFile;
485 static bool AreSectionsEqualForWriting(const FConfigSection& A, const FConfigSection& B);
486};
487
488#if ALLOW_INI_OVERRIDE_FROM_COMMANDLINE
489// Options which stemmed from the commandline
494#endif // ALLOW_INI_OVERRIDE_FROM_COMMANDLINE
495
497
499{
500public:
502 {
503 // this must be an ECVF priority
505 // tag -> branch -> cvars
507 };
508
509 // input
511 bool bTrackLoadedFiles = false;
512
513 // output
516
517 // section -> tracker
519
520 // sometimes reloading all instances/subclasses of a class causes trouble, so we
523};
524
530
531// this ended up being the same as FConfigSection, but we use the different type to indicate these are always combined
532class FConfigCommandStream : public TMap<FString, FConfigCommandStreamSection>
533{
534public:
536
537 void ProcessCommand(SectionType* Section, FStringView SectionName, FConfigValue::EValueType Command, FName Key, FString&& Value);
538 FConfigCommandStreamSection* FindOrAddSectionInternal(const FString& SectionName);
539 bool FillFileFromDisk(const FString& Filename, bool bHandleSymbolCommands);
540
541 void Shrink();
542
543 // This holds per-object config class names, with their ArrayOfStructKeys. Since the POC sections are all unique,
544 // we can't track it just in that section. This is expected to be empty/small
546
547 class FConfigBranch* Branch = nullptr;
549
552
553 // used to determine if existing settings should be removed from a FConfigFile before applying this stream - used for compatibility with
554 // how Saved config files are stored (replace the static layers values fully if at least one key exists)
556
557 // we can't SafeUnload layers that come from a string, because we can't reload (Hotfixes, in particular)
559
561 FString Filename;
562};
563
564// One config file.
566{
567public:
569
570 bool Dirty : 1; // = false;
571 bool NoSave : 1; // = false;
572 bool bHasPlatformName : 1; // = false;
573 bool bPythonConfigParserMode : 1; // = false;
574
575 // by default, we allow saving - this is going to be applied to config files that are not loaded from disk
576 // (when loading, this will get set to false, and then the ini sections will be checked)
577 bool bCanSaveAllSections : 1; // = true;
578#if UE_WITH_CONFIG_TRACKING
579 UE::ConfigAccessTracking::ELoadType LoadType = UE::ConfigAccessTracking::ELoadType::Uninitialized;
580#endif
581
585
586 // Optional tag, (can tag files per plugin, etc)
588
589 // this will point to the owning branch for the InMemoryFile only
590 friend class FConfigBranch;
591 class FConfigBranch* Branch = nullptr;
592
593#if ALLOW_INI_OVERRIDE_FROM_COMMANDLINE
596#endif // ALLOW_INI_OVERRIDE_FROM_COMMANDLINE
597
598private:
599 // This holds per-object config class names, with their ArrayOfStructKeys. Since the POC sections are all unique,
600 // we can't track it just in that section. This is expected to be empty/small
601 TMap<FString, TMap<FName, FString> > PerObjectConfigArrayOfStructKeys;
602
603 // if this is set, then we track changes made to sections for saving or replaying later (currently unused)
604 FConfigCommandStream* ChangeTracker = nullptr;
605
606#if UE_WITH_CONFIG_TRACKING
608#endif
609
610public:
612 FConfigFile( int32 ) {} // @todo UE-DLL: Workaround for instantiated TMap template during DLLExport (TMap::FindRef)
618
619 // looks for a section by name, and creates an empty one if it can't be found
620 CORE_API const FConfigSection* FindOrAddConfigSection(const FString& Name);
621
622 inline const FConfigSection* FindSection(const FString& SectionName) const
623 {
624 UE::TReadScopeLock ScopeLock(ConfigFileMapLock);
625 return FConfigFileMap::Find(SectionName);
626 }
627
628 inline int32 Num() const
629 {
630 UE::TReadScopeLock ScopeLock(ConfigFileMapLock);
631 return FConfigFileMap::Num();
632 }
633
634 inline bool IsEmpty() const
635 {
636 UE::TReadScopeLock ScopeLock(ConfigFileMapLock);
637 return FConfigFileMap::IsEmpty();
638 }
639
641 {
642 UE::TWriteScopeLock ScopeLock(ConfigFileMapLock);
643 FConfigFileMap::Empty(ExpectedNumElements);
644 }
645
646 inline bool Contains(const FString& SectionName) const
647 {
648 UE::TReadScopeLock ScopeLock(ConfigFileMapLock);
649 return FConfigFileMap::Contains(SectionName);
650 }
651
652 inline int32 GetKeys(TArray<FString>& Keys) const
653 {
654 UE::TReadScopeLock ScopeLock(ConfigFileMapLock);
655 return FConfigFileMap::GetKeys(Keys);
656 }
657
658 inline int32 GetKeys(TSet<FString>& Keys) const
659 {
660 UE::TReadScopeLock ScopeLock(ConfigFileMapLock);
661 return FConfigFileMap::GetKeys(Keys);
662 }
663
664 inline int32 Remove(KeyConstPointerType InKey)
665 {
666 UE::TWriteScopeLock ScopeLock(ConfigFileMapLock);
667 return FConfigFileMap::Remove(InKey);
668 }
669
670 inline ValueType& Add(const KeyType& InKey, const ValueType& InValue)
671 {
672 UE::TWriteScopeLock ScopeLock(ConfigFileMapLock);
673 return FConfigFileMap::Add(InKey, InValue);
674 }
675
676 inline ValueType& Add(const KeyType& InKey, ValueType&& InValue)
677 {
678 UE::TWriteScopeLock ScopeLock(ConfigFileMapLock);
679 return FConfigFileMap::Add(InKey, MoveTempIfPossible(InValue));
680 }
681
682 inline ValueType& Add(KeyType&& InKey, const ValueType& InValue)
683 {
684 UE::TWriteScopeLock ScopeLock(ConfigFileMapLock);
685 return FConfigFileMap::Add(MoveTempIfPossible(InKey), InValue);
686 }
687
688 inline ValueType& Add(KeyType&& InKey, ValueType&& InValue)
689 {
690 UE::TWriteScopeLock ScopeLock(ConfigFileMapLock);
691 return FConfigFileMap::Add(MoveTempIfPossible(InKey), MoveTempIfPossible(InValue));
692 }
693
695 {
696 UE::TWriteScopeLock ScopeLock(ConfigFileMapLock);
697 FConfigFileMap::Append(MoveTemp(Other));
698 }
699
700 inline void Reset()
701 {
702 UE::TWriteScopeLock ScopeLock(ConfigFileMapLock);
703 FConfigFileMap::Reset();
704 }
705
706 inline TRangedForConstIterator begin() const
707 {
708 UE::TReadScopeLock ScopeLock(ConfigFileMapLock);
709 return TRangedForConstIterator(Pairs.begin());
710 }
711
712 inline TRangedForConstIterator end() const
713 {
714 UE::TReadScopeLock ScopeLock(ConfigFileMapLock);
715 return TRangedForConstIterator(Pairs.end());
716 }
717
719
720 bool operator==( const FConfigFile& Other ) const;
721 bool operator!=( const FConfigFile& Other ) const;
722
723 CORE_API bool Combine(const FString& Filename);
724 CORE_API void CombineFromBuffer(const FString& Buffer, const FString& FileHint);
725 CORE_API void Read( const FString& Filename );
726
732
734 CORE_API static bool WriteTempFileThenMove();
735
737 CORE_API bool Write( const FString& Filename, bool bDoRemoteWrite=true, const FString& PrefixText=FString());
738
742 CORE_API void WriteToString(FString& InOutText, const FString& SimulatedFilename = FString(), const FString& PrefixText = FString());
743
744private:
746 bool IsADefaultIniWrite(const FString& Filename, int32& OutIniCombineThreshold) const;
747
760 bool WriteInternal(const FString& Filename, bool bDoRemoteWrite, TMap<FString, FString>& InOutSectionTexts, const TArray<FString>& InSectionOrder);
761
776
779 void Cleanup();
780
781 void Shrink();
782
784 bool FillFileFromDisk(const FString& Filename, bool bHandleSymbolCommands);
785 void ProcessCommand(FConfigSection* Section, FStringView SectionName, FConfigValue::EValueType Command, FName Key, FString&& Value);
786
787 FConfigSection* FindOrAddSectionInternal(const FString& SectionName);
788
789 inline FConfigSection* FindInternal(const FString& SectionName)
790 {
791 UE::TReadScopeLock ScopeLock(ConfigFileMapLock);
792 return FConfigFileMap::Find(SectionName);
793 };
794
795 // allow the templated helper to access FindOrAddSectionInternal
796 template<typename FileType>
797 friend void FillFileFromBuffer(FileType* File, FStringView Buffer, bool bHandleSymbolCommands, const FString& FileHint);
798
799public:
800 CORE_API void Dump(FOutputDevice& Ar);
801
802 bool GetString(const TCHAR* Section, const TCHAR* Key, FString& Value) const
803 {
804 if (const FConfigSection* ConfigSection = FindSection(Section))
805 {
806 return ConfigSection->GetString(Key, Value);
807 }
808 return false;
809 }
810
811 bool GetText(const TCHAR* Section, const TCHAR* Key, FText& Value) const
812 {
813 if (const FConfigSection* ConfigSection = FindSection(Section))
814 {
815 return ConfigSection->GetText(Section, Key, Value);
816 }
817 return false;
818 }
819
820 bool GetInt(const TCHAR* Section, const TCHAR* Key, int32& Value) const
821 {
822 if (const FConfigSection* ConfigSection = FindSection(Section))
823 {
824 return ConfigSection->GetInt(Key, Value);
825 }
826 return false;
827 }
828
829 bool GetUInt(const TCHAR* Section, const TCHAR* Key, uint32& Value) const
830 {
831 if (const FConfigSection* ConfigSection = FindSection(Section))
832 {
833 return ConfigSection->GetUInt(Key, Value);
834 }
835 return false;
836 }
837
838 bool GetFloat(const TCHAR* Section, const TCHAR* Key, float& Value) const
839 {
840 if (const FConfigSection* ConfigSection = FindSection(Section))
841 {
842 return ConfigSection->GetFloat(Key, Value);
843 }
844 return false;
845 }
846
847 bool GetDouble(const TCHAR* Section, const TCHAR* Key, double& Value) const
848 {
849 if (const FConfigSection* ConfigSection = FindSection(Section))
850 {
851 return ConfigSection->GetDouble(Key, Value);
852 }
853 return false;
854 }
855
856 bool GetInt64(const TCHAR* Section, const TCHAR* Key, int64& Value) const
857 {
858 if (const FConfigSection* ConfigSection = FindSection(Section))
859 {
860 return ConfigSection->GetInt64(Key, Value);
861 }
862 return false;
863 }
864
865 bool GetBool(const TCHAR* Section, const TCHAR* Key, bool& Value) const
866 {
867 if (const FConfigSection* ConfigSection = FindSection(Section))
868 {
869 return ConfigSection->GetBool(Key, Value);
870 }
871 return false;
872 }
873
874 CORE_API int32 GetArray(const TCHAR* Section, const TCHAR* Key, TArray<FString>& Value) const;
875
876 /* Generic versions for use with templates */
877 bool GetValue(const TCHAR* Section, const TCHAR* Key, FString& Value) const
878 {
879 return GetString(Section, Key, Value);
880 }
881 bool GetValue(const TCHAR* Section, const TCHAR* Key, FText& Value) const
882 {
883 return GetText(Section, Key, Value);
884 }
885 bool GetValue(const TCHAR* Section, const TCHAR* Key, int32& Value) const
886 {
887 return GetInt(Section, Key, Value);
888 }
889 bool GetValue(const TCHAR* Section, const TCHAR* Key, float& Value) const
890 {
891 return GetFloat(Section, Key, Value);
892 }
893 bool GetValue(const TCHAR* Section, const TCHAR* Key, double& Value) const
894 {
895 return GetDouble(Section, Key, Value);
896 }
897 bool GetValue(const TCHAR* Section, const TCHAR* Key, int64& Value) const
898 {
899 return GetInt64(Section, Key, Value);
900 }
901 bool GetValue(const TCHAR* Section, const TCHAR* Key, bool& Value) const
902 {
903 return GetBool(Section, Key, Value);
904 }
905 int32 GetValue(const TCHAR* Section, const TCHAR* Key, TArray<FString>& Value) const
906 {
907 return GetArray(Section, Key, Value);
908 }
909
910 CORE_API bool DoesSectionExist(const TCHAR* Section) const;
911
912 CORE_API void SetString(const TCHAR* Section, const TCHAR* Key, const TCHAR* Value);
913 CORE_API void SetText(const TCHAR* Section, const TCHAR* Key, const FText& Value);
914 CORE_API void SetFloat(const TCHAR* Section, const TCHAR* Key, float Value);
915 CORE_API void SetDouble(const TCHAR* Section, const TCHAR* Key, double Value);
916 CORE_API void SetBool(const TCHAR* Section, const TCHAR* Key, bool Value);
917 CORE_API void SetInt64(const TCHAR* Section, const TCHAR* Key, const int64 Value);
918 CORE_API void SetArray(const TCHAR* Section, const TCHAR* Key, const TArray<FString>& Value);
919
920
925 CORE_API bool SetInSection(const TCHAR* SectionName, FName Key, const FString& Value);
926
932 CORE_API bool AddToSection(const TCHAR* Section, FName Key, const FString& Value);
933
939 CORE_API bool AddUniqueToSection(const TCHAR* Section, FName Key, const FString& Value);
940
946 CORE_API bool RemoveKeyFromSection(const TCHAR* Section, FName Key);
947
953 CORE_API bool RemoveFromSection(const TCHAR* Section, FName Key, const FString& Value);
954
962 CORE_API bool ResetKeyInSection(const TCHAR* Section, FName Key);
963
970 CORE_API void ProcessInputFileContents(FStringView Contents, const FString& FileHint);
971
974
987 CORE_API void UpdateSections(const TCHAR* DiskFilename, const TCHAR* IniRootName=nullptr, const TCHAR* OverridePlatform=nullptr);
988
992 CORE_API bool UpdateSinglePropertyInSection(const TCHAR* DiskFilename, const TCHAR* PropertyName, const TCHAR* SectionName);
993
994
1001
1003 static bool ShouldExportQuotedString(const FString& PropertyValue);
1004
1006 static FString GenerateExportedPropertyLine(const FString& PropertyName, const FString& PropertyValue);
1007
1009 static void AppendExportedPropertyLine(FString& Out, const FString& PropertyName, const FString& PropertyValue);
1010
1012 CORE_API static void OverrideFromCommandline(FConfigFile* File, const FString& Filename);
1013 CORE_API static void OverrideFromCommandline(FConfigCommandStream* File, const FString& Filename);
1014
1016 CORE_API static bool OverrideFileFromCommandline(FString& Filename);
1017
1019// UE_DEPRECATED(5.4, "Use FConfigCacheIni::FindBranch (recommended) or FConfigFile.Branch (quick fix) to call AddDynamicLayerToHierarchy (or the other functions to add plugins to configs) ")
1020 CORE_API void AddDynamicLayerToHierarchy(const FString& Filename);
1021
1022 friend FArchive& operator<<(FArchive& Ar, FConfigFile& ConfigFile);
1023
1024#if UE_WITH_CONFIG_TRACKING
1026 CORE_API UE::ConfigAccessTracking::FFile* GetFileAccess() const;
1027#endif
1028
1029private:
1033 void SaveSourceToBackupFile();
1034
1045 void ProcessPropertyAndWriteForDefaults(int32 IniCombineThreshold, const TArray<const FConfigValue*>& InCompletePropertyToProcess, FString& OutText, const FString& SectionName, const FString& PropertyName);
1046
1054 void AddStaticLayersToHierarchy(const TCHAR* InBaseIniName, const TCHAR* InPlatformName, const TCHAR* EngineConfigDir, const TCHAR* SourceConfigDir);
1055 static void AddStaticLayersToHierarchy(FConfigContext& Context);
1056
1057 // for AddStaticLayersToHierarchy
1058 friend class FConfigCacheIni;
1059 friend FConfigContext;
1060
1061 static CORE_API FTransactionallySafeRWLock ConfigFileMapLock;
1062};
1063
1068
1070{
1071 // this type of config cache will write its files to disk during Flush (i.e. GConfig)
1072 DiskBacked,
1073 // this type of config cache is temporary and will never write to disk (only load from disk)
1074 Temporary,
1075};
1076
1078{
1079 // every file in the branch is saved with valuetypes, allowing for replay from beginning to end
1080 FullReplay,
1081 // store a copy of the staticlayers combined together, as a baseline for replaying dynamic layers after (useful for plugins to be removed)
1083 // store only the final version of static + dynamic + saved
1084 NoReplay,
1085};
1086
1087
1088// NOTE: These are currently unused - here for future use
1090{
1091 Unknown = 0,
1092 Plugin = 20,
1093 GameFeature = 50,
1094 Hotfix = 80,
1095};
1096
1097// A set of config files with the same "base name" like Engine, Input, or GameUserSettings. Contains the hierarchy of
1098// all possible files that will be searched for and the files that actually exist and can be loaded.
1100{
1101public:
1102 // Standard branch that will be used by, say, GConfig to hold the inis for Engine, Game, etc
1103 FConfigBranch();
1104
1105 // A "dummy" branch used to manage a single external FConfigFile
1106 FConfigBranch(const FConfigFile& ExistingFile);
1107
1108
1109 // base name of the branch, like "Engine"
1111
1112 // "final" path for the branch like "Saved/Config/Windows/Engine.ini"
1113 FString IniPath;
1114
1116
1117 // Locations where this file may have come from - used to merge with non-standard ini locations
1120
1123 // If set true, this ConfigBranch will be allowed to be unloaded.
1124 bool bAllowedToRemove = true;
1125
1127
1129
1134
1135 // cache the static layers so when remaking dynamic layers after removing a dynamic layer it's faster
1137
1138 // this contains everything read from disk - when saving the diff between this and InMemoryFile is written out
1140
1142
1143 // this is the file that maps to the old FConfigFiles stored in the FConfigCacheIni
1145
1146 // tracks runtime changes for optimal saving
1148
1150
1157
1158 UE_DEPRECATED(5.6, "Use AddDynamicLayersToHierarchy that takes a FDynamicLayerInfo list")
1160
1161 // Add a preloaded string as a dynamic layer (useful for hotfixing)
1163
1169
1174 CORE_API void SafeUnload();
1175 CORE_API void SafeReload();
1176
1180 CORE_API void ReapplyLayers();
1181
1188
1193
1197 CORE_API const FConfigCommandStream* GetStaticLayer(const FString& LayerSubstring) const;
1198
1205 CORE_API bool RemoveSection(const TCHAR* Section);
1206
1211 CORE_API bool Delete();
1212
1213 CORE_API void Flush();
1214
1215 CORE_API void Shrink();
1216
1217 CORE_API void Dump(FOutputDevice& Ar);
1218
1219
1223 CORE_API void RunOnEachFile(TFunction<void(FConfigFile& File, const FString& Name)> Func);
1224 CORE_API void RunOnEachCommandStream(TFunction<void(FConfigCommandStream& File, const FString& Name)> Func);
1225
1226private:
1227 void InitFiles();
1228
1229 void RemoveTagsFromHierarchy(const TArray<FName>& Tags, FConfigModificationTracker* ModificationTracker);
1230
1232
1233 // when we last Found the branch to pull data from it, this is used to unload after it's been unused for some time
1234 TSAN_ATOMIC(double) InactiveTimer;
1235};
1236
1237
1238// Set of all cached config files.
1240{
1241public:
1242 // Basic functions.
1244
1247
1248 CORE_API virtual ~FConfigCacheIni();
1249
1253 CORE_API void DisableFileOperations();
1254
1258 CORE_API void EnableFileOperations();
1259
1263 CORE_API bool AreFileOperationsDisabled();
1264
1269 {
1270 return bIsReadyForUse;
1271 }
1272
1275 {
1276 return bGloballyRegistered;
1277 }
1278
1282 CORE_API void Tick(float DeltaSeconds);
1283
1302 CORE_API void Parse1ToNSectionOfStrings(const TCHAR* Section, const TCHAR* KeyOne, const TCHAR* KeyN, TMap<FString, TArray<FString> >& OutMap, const FString& Filename);
1303
1322 CORE_API void Parse1ToNSectionOfNames(const TCHAR* Section, const TCHAR* KeyOne, const TCHAR* KeyN, TMap<FName, TArray<FName> >& OutMap, const FString& Filename);
1323
1331 CORE_API FConfigFile* FindConfigFile(const FString& Filename);
1332
1340 CORE_API FConfigFile* Find(const FString& InFilename);
1341
1347 CORE_API bool ContainsConfigFile(const FConfigFile* ConfigFile) const;
1348
1350 CORE_API FConfigFile* FindConfigFileWithBaseName(FName BaseName);
1351
1352 CORE_API FConfigFile& Add(const FString& Filename, const FConfigFile& File);
1353
1355 CORE_API FConfigBranch* FindBranch(FName BaseIniName, const FString& Filename);
1356
1358 CORE_API FConfigBranch* FindBranchWithNoReload(FName BaseIniName, const FString& Filename);
1359
1361 CORE_API FConfigBranch& AddNewBranch(const FString& Filename);
1362
1363 CORE_API int32 Remove(const FString& Filename);
1364
1365 CORE_API TArray<FString> GetFilenames();
1366
1367
1368 CORE_API void Flush(bool bRemoveFromCache, const FString& Filename=TEXT(""));
1369
1370 CORE_API void LoadFile( const FString& InFilename, const FConfigFile* Fallback = NULL, const TCHAR* PlatformString = NULL );
1371 CORE_API void SetFile( const FString& InFilename, const FConfigFile* NewConfigFile );
1372 CORE_API void UnloadFile( const FString& Filename );
1373 CORE_API void Detach( const FString& Filename );
1374
1375 CORE_API bool GetString( const TCHAR* Section, const TCHAR* Key, FString& Value, const FString& Filename );
1376 CORE_API bool GetText( const TCHAR* Section, const TCHAR* Key, FText& Value, const FString& Filename );
1377 CORE_API bool GetSection( const TCHAR* Section, TArray<FString>& Result, const FString& Filename );
1378 CORE_API bool DoesSectionExist(const TCHAR* Section, const FString& Filename);
1379
1380 CORE_API const FConfigSection* GetSection( const TCHAR* Section, const bool Force, const FString& Filename );
1381 CORE_API void SetString( const TCHAR* Section, const TCHAR* Key, const TCHAR* Value, const FString& Filename );
1382 CORE_API void SetText( const TCHAR* Section, const TCHAR* Key, const FText& Value, const FString& Filename );
1383 CORE_API bool RemoveKey( const TCHAR* Section, const TCHAR* Key, const FString& Filename );
1384 CORE_API bool EmptySection( const TCHAR* Section, const FString& Filename );
1385 CORE_API bool EmptySectionsMatchingString( const TCHAR* SectionString, const FString& Filename );
1386
1395 CORE_API FString GetConfigFilename(const TCHAR* BaseIniName);
1396
1402 CORE_API void GetConfigFilenames(TArray<FString>& ConfigFilenames);
1403
1412 CORE_API bool GetSectionNames( const FString& Filename, TArray<FString>& out_SectionNames );
1413
1424 CORE_API bool GetPerObjectConfigSections( const FString& Filename, const FString& SearchClass, TArray<FString>& out_SectionNames, int32 MaxResults=1024 );
1425
1426 CORE_API void Exit();
1427
1434 CORE_API void Dump(FOutputDevice& Ar, const TCHAR* IniName=NULL);
1435
1441 CORE_API void ShowMemoryUsage( FOutputDevice& Ar );
1442
1448 CORE_API SIZE_T GetMaxMemoryUsage();
1449
1454 CORE_API bool ForEachEntry(const FKeyValueSink& Visitor, const TCHAR* Section, const FString& Filename);
1455
1456 // Derived functions.
1457 CORE_API FString GetStr
1458 (
1459 const TCHAR* Section,
1460 const TCHAR* Key,
1461 const FString& Filename
1462 );
1463 CORE_API bool GetInt
1464 (
1465 const TCHAR* Section,
1466 const TCHAR* Key,
1467 int32& Value,
1468 const FString& Filename
1469 );
1470 CORE_API bool GetInt64
1471 (
1472 const TCHAR* Section,
1473 const TCHAR* Key,
1474 int64& Value,
1475 const FString& Filename
1476 );
1477 CORE_API bool GetFloat
1478 (
1479 const TCHAR* Section,
1480 const TCHAR* Key,
1481 float& Value,
1482 const FString& Filename
1483 );
1484 CORE_API bool GetDouble
1485 (
1486 const TCHAR* Section,
1487 const TCHAR* Key,
1488 double& Value,
1489 const FString& Filename
1490 );
1491 CORE_API bool GetBool
1492 (
1493 const TCHAR* Section,
1494 const TCHAR* Key,
1495 bool& Value,
1496 const FString& Filename
1497 );
1498 CORE_API int32 GetArray
1499 (
1500 const TCHAR* Section,
1501 const TCHAR* Key,
1503 const FString& Filename
1504 );
1511 CORE_API int32 GetSingleLineArray
1512 (
1513 const TCHAR* Section,
1514 const TCHAR* Key,
1516 const FString& Filename
1517 );
1518 CORE_API bool GetColor
1519 (
1520 const TCHAR* Section,
1521 const TCHAR* Key,
1522 FColor& Value,
1523 const FString& Filename
1524 );
1525 CORE_API bool GetVector2D(
1526 const TCHAR* Section,
1527 const TCHAR* Key,
1529 const FString& Filename);
1530 CORE_API bool GetVector
1531 (
1532 const TCHAR* Section,
1533 const TCHAR* Key,
1534 FVector& Value,
1535 const FString& Filename
1536 );
1537 CORE_API bool GetVector4
1538 (
1539 const TCHAR* Section,
1540 const TCHAR* Key,
1541 FVector4& Value,
1542 const FString& Filename
1543 );
1544 CORE_API bool GetRotator
1545 (
1546 const TCHAR* Section,
1547 const TCHAR* Key,
1548 FRotator& Value,
1549 const FString& Filename
1550 );
1551
1552 /* Generic versions for use with templates */
1553 bool GetValue(const TCHAR* Section, const TCHAR* Key, FString& Value, const FString& Filename)
1554 {
1555 return GetString(Section, Key, Value, Filename);
1556 }
1557 bool GetValue(const TCHAR* Section, const TCHAR* Key, FText& Value, const FString& Filename)
1558 {
1559 return GetText(Section, Key, Value, Filename);
1560 }
1561 bool GetValue(const TCHAR* Section, const TCHAR* Key, int32& Value, const FString& Filename)
1562 {
1563 return GetInt(Section, Key, Value, Filename);
1564 }
1565 bool GetValue(const TCHAR* Section, const TCHAR* Key, float& Value, const FString& Filename)
1566 {
1567 return GetFloat(Section, Key, Value, Filename);
1568 }
1569 bool GetValue(const TCHAR* Section, const TCHAR* Key, bool& Value, const FString& Filename)
1570 {
1571 return GetBool(Section, Key, Value, Filename);
1572 }
1573 int32 GetValue(const TCHAR* Section, const TCHAR* Key, TArray<FString>& Value, const FString& Filename)
1574 {
1575 return GetArray(Section, Key, Value, Filename);
1576 }
1577
1578 // Return a config value if found, if not found return default value
1579 // does not indicate if return value came from config or the default value
1580 // useful for one-time init of static variables in code locations where config may be queried too often, like :
1581 // static int32 bMyConfigValue = GConfig->GetIntOrDefault(Section,Key,DefaultValue,ConfigFilename);
1582 int32 GetIntOrDefault(const TCHAR* Section, const TCHAR* Key, const int32 DefaultValue, const FString& Filename)
1583 {
1584 int32 Value = DefaultValue;
1585 GetInt(Section,Key,Value,Filename);
1586 return Value;
1587 }
1588 float GetFloatOrDefault(const TCHAR* Section, const TCHAR* Key, const float DefaultValue, const FString& Filename)
1589 {
1590 float Value = DefaultValue;
1591 GetFloat(Section,Key,Value,Filename);
1592 return Value;
1593 }
1594 bool GetBoolOrDefault(const TCHAR* Section, const TCHAR* Key, const bool DefaultValue, const FString& Filename)
1595 {
1596 bool Value = DefaultValue;
1597 GetBool(Section,Key,Value,Filename);
1598 return Value;
1599 }
1600 FString GetStringOrDefault(const TCHAR* Section, const TCHAR* Key, const FString & DefaultValue, const FString& Filename)
1601 {
1602 FString Value;
1603 if ( GetString(Section,Key,Value,Filename) )
1604 {
1605 return Value;
1606 }
1607 else
1608 {
1609 return DefaultValue;
1610 }
1611 }
1612 FText GetTextOrDefault(const TCHAR* Section, const TCHAR* Key, const FText & DefaultValue, const FString& Filename)
1613 {
1614 FText Value;
1615 if ( GetText(Section,Key,Value,Filename) )
1616 {
1617 return Value;
1618 }
1619 else
1620 {
1621 return DefaultValue;
1622 }
1623 }
1624
1625 CORE_API void SetInt
1626 (
1627 const TCHAR* Section,
1628 const TCHAR* Key,
1629 int32 Value,
1630 const FString& Filename
1631 );
1632 CORE_API void SetFloat
1633 (
1634 const TCHAR* Section,
1635 const TCHAR* Key,
1636 float Value,
1637 const FString& Filename
1638 );
1639 CORE_API void SetDouble
1640 (
1641 const TCHAR* Section,
1642 const TCHAR* Key,
1643 double Value,
1644 const FString& Filename
1645 );
1646 CORE_API void SetBool
1647 (
1648 const TCHAR* Section,
1649 const TCHAR* Key,
1650 bool Value,
1651 const FString& Filename
1652 );
1653 CORE_API void SetArray
1654 (
1655 const TCHAR* Section,
1656 const TCHAR* Key,
1657 const TArray<FString>& Value,
1658 const FString& Filename
1659 );
1666 CORE_API void SetSingleLineArray
1667 (
1668 const TCHAR* Section,
1669 const TCHAR* Key,
1670 const TArray<FString>& In_Arr,
1671 const FString& Filename
1672 );
1673 CORE_API void SetColor
1674 (
1675 const TCHAR* Section,
1676 const TCHAR* Key,
1677 FColor Value,
1678 const FString& Filename
1679 );
1680 CORE_API void SetVector2D(
1681 const TCHAR* Section,
1682 const TCHAR* Key,
1684 const FString& Filename);
1685 CORE_API void SetVector
1686 (
1687 const TCHAR* Section,
1688 const TCHAR* Key,
1689 FVector Value,
1690 const FString& Filename
1691 );
1692 CORE_API void SetVector4
1693 (
1694 const TCHAR* Section,
1695 const TCHAR* Key,
1696 const FVector4& Value,
1697 const FString& Filename
1698 );
1699 CORE_API void SetRotator
1700 (
1701 const TCHAR* Section,
1702 const TCHAR* Key,
1704 const FString& Filename
1705 );
1706
1707
1712 CORE_API bool SetInSection(const TCHAR* Section, FName Key, const FString& Value, const FString& Filename);
1713 CORE_API bool SetInSectionOfStaticLayer(const TCHAR* Section, FName Key, const FString& Value, const FString& BranchName, const FString& LayerSubstring, bool bWriteFile);
1714
1720 CORE_API bool AddToSection(const TCHAR* Section, FName Key, const FString& Value, const FString& Filename);
1721 CORE_API bool AddToSectionOfStaticLayer(const TCHAR* Section, FName Key, const FString& Value, const FString& BranchName, const FString& LayerSubstring, bool bWriteFile);
1722
1728 CORE_API bool AddUniqueToSection(const TCHAR* Section, FName Key, const FString& Value, const FString& Filename);
1729 CORE_API bool AddUniqueToSectionOfStaticLayer(const TCHAR* Section, FName Key, const FString& Value, const FString& BranchName, const FString& LayerSubstring, bool bWriteFile);
1730
1736 CORE_API bool RemoveKeyFromSection(const TCHAR* Section, FName Key, const FString& Filename);
1737 CORE_API bool RemoveKeyFromSectionOfStaticLayer(const TCHAR* Section, FName Key, const FString& BranchName, const FString& LayerSubstring, bool bWriteFile);
1738
1744 CORE_API bool RemoveFromSection(const TCHAR* Section, FName Key, const FString& Value, const FString& Filename);
1745 CORE_API bool RemoveFromSectionOfStaticLayer(const TCHAR* Section, FName Key, const FString& Value, const FString& BranchName, const FString& LayerSubstring, bool bWriteFile);
1746
1754 CORE_API bool ResetKeyInSection(const TCHAR* Section, FName Key, const FString& Filename);
1755 CORE_API bool ResetKeyInSectionOfStaticLayer(const TCHAR* Section, FName Key, const FString& BranchName, const FString& LayerSubstring, bool bWriteFile);
1756
1757 CORE_API bool SetArrayInSectionOfStaticLayer(const TCHAR* Section, FName Key, const TArray<FString>& Values, bool bClearArray, const FString& BranchName, const FString& LayerSubstring, bool bWriteFile);
1758
1762 CORE_API bool SafeUnloadBranch(const TCHAR* Filename);
1763
1770 CORE_API bool RemoveSectionFromBranch(const TCHAR* Section, const TCHAR* Filename);
1771
1772 // Static helper functions
1773
1778 static CORE_API void InitializeConfigSystem();
1779
1785 static CORE_API const FString& GetCustomConfigString();
1786
1796 static CORE_API FString GetDestIniFilename(const TCHAR* BaseIniName, const TCHAR* PlatformName, const TCHAR* GeneratedConfigDir);
1797
1816 static CORE_API bool LoadGlobalIniFile(FString& FinalIniFilename, const TCHAR* BaseIniName, const TCHAR* Platform = NULL, bool bForceReload = false, bool bRequireDefaultIni = false, bool bAllowGeneratedIniWhenCooked = true, bool bAllowRemoteConfig = true, const TCHAR* GeneratedConfigDir = *FPaths::GeneratedConfigDir(), FConfigCacheIni* ConfigSystem=GConfig);
1817
1830 static CORE_API bool LoadLocalIniFile(FConfigFile& ConfigFile, const TCHAR* IniName, bool bIsBaseIniName, const TCHAR* Platform=NULL, bool bForceReload=false);
1831
1849 static CORE_API bool LoadExternalIniFile(FConfigFile& ConfigFile, const TCHAR* IniName, const TCHAR* EngineConfigDir, const TCHAR* SourceConfigDir, bool bIsBaseIniName, const TCHAR* Platform=NULL, bool bForceReload=false, bool bWriteDestIni=false, bool bAllowGeneratedIniWhenCooked = true, const TCHAR* GeneratedConfigDir = *FPaths::GeneratedConfigDir());
1850
1856 static CORE_API void LoadConsoleVariablesFromINI();
1857
1886 static CORE_API FString NormalizeConfigIniPath(const FString& NonNormalizedPath);
1887
1897 static CORE_API FConfigFile* FindOrLoadPlatformConfig(FConfigFile& LocalFile, const TCHAR* IniName, const TCHAR* Platform = NULL);
1898
1906 static CORE_API FConfigFile* FindPlatformConfig(const TCHAR* IniName, const TCHAR* Platform);
1907
1911 CORE_API void SaveCurrentStateForBootstrap(const TCHAR* Filename);
1912
1913 CORE_API void Serialize(FArchive& Ar);
1914
1915
1917 {
1919
1920 // Write out this for binary config serialization
1922
1923 // setup GEngineIni based on this structure's values
1925
1926 // given an name ("Engine") return the FConfigFile for it
1927 const FConfigFile* GetFile(FName Name);
1928 // given an name ("Engine") return the modifiable FConfigFile for it
1929 FConfigFile* GetMutableFile(FName Name);
1930
1931 // given an name ("Engine") return the modifiable FConfigBranch
1932 FConfigBranch* GetBranch(FName Name);
1933
1934 // get the disk-based filename for the given known ini name
1935 const FString& GetFilename(FName Name);
1936
1937 // the list of the known inis (Engine, Game, etc) See the top of this file for the list
1939 };
1940
1948 static CORE_API bool InitializeKnownConfigFiles(FConfigContext& Context);
1949
1954 CORE_API bool IsKnownConfigName(FName ConfigName);
1955
1959 static CORE_API bool CreateGConfigFromSaved(const TCHAR* Filename);
1960
1965 static CORE_API FConfigCacheIni* ForPlatform(FName PlatformName);
1966
1970 static CORE_API void ClearOtherPlatformConfigs();
1971
1975 static CORE_API void RegisterPlugin(FName PluginName, const FString& PluginDir, const TArray<FString>& ChildPluginDirs, DynamicLayerPriority Priority, bool bIncludePluginNameInBranchName);
1976
1977 static CORE_API void AddPluginToAllBranches(FName PluginName, FConfigModificationTracker* ModificationTracker=nullptr);
1978 static CORE_API void AddMultiplePluginsToAllBranches(const TArray<FName>& PluginName, FConfigModificationTracker* ModificationTracker=nullptr);
1979 static CORE_API void RemoveTagFromAllBranches(FName Tag, FConfigModificationTracker* ModificationTracker=nullptr);
1980 static CORE_API void RemoveMultipleTagsFromAllBranches(const TArray<FName>& Tags, FConfigModificationTracker* ModificationTracker=nullptr);
1981
1986 static CORE_API void PreInitializePlatformPlugins();
1987
1992 CORE_API const TSet<FString>* GetStagedPluginConfigCache(FName PluginName) const;
1993
1997 CORE_API const TSet<FString>* GetStagedGlobalConfigCache() const;
1998
1999private:
2000#if WITH_EDITOR
2003#endif
2004
2006 CORE_API void SerializeStateForBootstrap_Impl(FArchive& Ar);
2007
2008
2009 void AddPluginsToBranches(const TArray<FName>& PluginNames, FConfigModificationTracker* ModificationTracker);
2010 void RemoveTagsFromBranches(const TArray<FName>& Tags, FConfigModificationTracker* ModificationTracker);
2011
2013 bool IsConfigBranchNameInNeverUnloadList(const FName& ConfigBranchName);
2014
2016 bool bAreFileOperationsDisabled;
2017
2019 bool bIsReadyForUse;
2020
2021 bool bGloballyRegistered;
2022
2024 EConfigCacheType Type;
2025
2027 FName PlatformName;
2028
2030 FKnownConfigFiles KnownFiles;
2031
2033 mutable FTransactionallySafeCriticalSection OtherFilesLock;
2034
2036 TArray<FString> OtherFileNames;
2037
2038 struct FPluginInfo
2039 {
2040 FString PluginDir;
2041 TArray<FString> ChildPluginDirs;
2043 // packing in with priority
2044 uint8 bIncludePluginNameInBranchName : 1;
2045 };
2046 static TMap<FName, FPluginInfo*> RegisteredPlugins;
2047 TArray<FName> PendingModificationPlugins;
2048 static FTransactionallySafeCriticalSection RegisteredPluginsLock;
2049
2050 // a cache discovered at staging time and loaded from BinaryConfig.ini
2051 TSet<FString>* StagedGlobalConfigCache = nullptr;
2052 TMap<FName, TSet<FString>> StagedPluginConfigCache;
2053 friend bool MakeBinaryConfig(const TCHAR* CmdLine);// @todo remove this and move the code that fills this out, maybe
2054
2055
2056#if ALLOW_OTHER_PLATFORM_CONFIG
2059#endif
2060
2062 TArray<FString> ConfigBranchNamesToNeverUnload;
2063
2064 friend FConfigContext;
2065};
2066
2067
2068#if UE_WITH_CONFIG_TRACKING
2069inline UE::ConfigAccessTracking::FSection* GetSectionAccess(const FConfigSection* InSection)
2070{
2071 return InSection ? InSection->SectionAccess.GetReference() : nullptr;
2072}
2073#endif
#define NULL
Definition oodle2base.h:134
#define UE_WITH_CONFIG_TRACKING
Definition ConfigAccessTracking.h:13
bool FillFileFromDisk(FileType *File, const FString &Filename, bool bHandleSymbolCommands)
Definition ConfigCacheIni.cpp:2090
DynamicLayerPriority
Definition ConfigCacheIni.h:1090
#define ENUMERATE_KNOWN_INI_FILES(op)
Definition ConfigCacheIni.h:95
TMap< FString, FConfigSection > FConfigFileMap
Definition ConfigCacheIni.h:496
EConfigCacheType
Definition ConfigCacheIni.h:1070
#define KNOWN_INI_ENUM(IniName)
Definition ConfigCacheIni.h:108
EKnownIniFile
Definition ConfigCacheIni.h:110
TMultiMap< FName, FConfigValue > FConfigSectionMap
Definition ConfigCacheIni.h:403
EBranchReplayMethod
Definition ConfigCacheIni.h:1078
FConfigCacheIni * GConfig
Definition CoreGlobals.cpp:54
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TSAN_ATOMIC(Type)
Definition CoreMiscDefines.h:147
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::SIZE_T SIZE_T
An unsigned integer the same size as a pointer, the same as UPTRINT.
Definition Platform.h:1150
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
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
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
#define DECLARE_DELEGATE_TwoParams(DelegateName, Param1Type, Param2Type)
Definition DelegateCombinations.h:57
FArchive & operator<<(FArchive &Ar, FEnvQueryDebugProfileData::FStep &Data)
Definition EnvQueryTypes.cpp:489
#define DECLARE_LOG_CATEGORY_EXTERN(CategoryName, DefaultVerbosity, CompileTimeVerbosity)
Definition LogMacros.h:361
FString GetConfigFilename(UObject *SourceObject)
Definition Obj.cpp:2276
::FCriticalSection FTransactionallySafeCriticalSection
Definition TransactionallySafeCriticalSection.h:16
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTempIfPossible(T &&Obj) noexcept
Definition UnrealTemplate.h:538
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
if(Failed) console_printf("Failed.\n")
uint8_t uint8
Definition binka_ue_file_header.h:8
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
UE_FORCEINLINE_HINT bool IsLoading() const
Definition Archive.h:236
Definition ConfigCacheIni.h:1100
FConfigFile CombinedStaticLayers
Definition ConfigCacheIni.h:1136
DynamicLayerList DynamicLayers
Definition ConfigCacheIni.h:1132
CORE_API void Shrink()
Definition ConfigCacheIni.cpp:3937
FName IniName
Definition ConfigCacheIni.h:1110
bool bAllowedToRemove
Definition ConfigCacheIni.h:1124
CORE_API bool MergeStaticLayersUpTo(const FString &LayerNameSubstring, FConfigFile &OutFile) const
Definition ConfigCacheIni.cpp:3865
CORE_API void ReapplyLayers()
Definition ConfigCacheIni.cpp:3840
FName Platform
Definition ConfigCacheIni.h:1115
CORE_API bool RemoveDynamicLayerFromHierarchy(const FString &Filename, FConfigModificationTracker *ModificationTracker=nullptr)
Definition ConfigCacheIni.cpp:3689
FConfigCommandStream RuntimeChanges
Definition ConfigCacheIni.h:1147
CORE_API bool AddDynamicLayerToHierarchy(const FString &Filename, FConfigModificationTracker *ModificationTracker=nullptr, TSet< FString > *GlobalConfigFileCache=nullptr, TSet< FString > *PluginConfigFileCache=nullptr)
Definition ConfigCacheIni.cpp:3408
FConfigCommandStream SavedLayer
Definition ConfigCacheIni.h:1133
CORE_API bool Delete()
Definition ConfigCacheIni.cpp:3931
CORE_API bool MergeStaticLayersUpToAndIncluding(const FString &LayerNameSubstring, FConfigFile &OutFile) const
Definition ConfigCacheIni.cpp:3879
FConfigBranch()
Definition ConfigCacheIni.cpp:3330
FConfigFile FinalCombinedLayers
Definition ConfigCacheIni.h:1139
CORE_API void RunOnEachCommandStream(TFunction< void(FConfigCommandStream &File, const FString &Name)> Func)
Definition ConfigCacheIni.cpp:3390
TMap< FString, FConfigCommandStream > StaticLayers
Definition ConfigCacheIni.h:1130
CORE_API bool AddDynamicLayersToHierarchy(const TArray< FDynamicLayerInfo > &Layers, FConfigModificationTracker *ModificationTracker=nullptr, TSet< FString > *GlobalConfigFileCache=nullptr, TSet< FString > *PluginConfigFileCache=nullptr, bool bForceFullDynamicLayerUpdate=false)
Definition ConfigCacheIni.cpp:3429
FConfigFileHierarchy Hierarchy
Definition ConfigCacheIni.h:1128
FString SourceEngineConfigDir
Definition ConfigCacheIni.h:1118
FConfigCommandStream CommandLineOverrides
Definition ConfigCacheIni.h:1141
FString SourceProjectConfigDir
Definition ConfigCacheIni.h:1119
CORE_API void SafeUnload()
Definition ConfigCacheIni.cpp:3776
bool bIsSafeUnloaded
Definition ConfigCacheIni.h:1121
friend class FConfigCacheIni
Definition ConfigCacheIni.h:1231
bool bIsHierarchical
Definition ConfigCacheIni.h:1122
CORE_API void Dump(FOutputDevice &Ar)
Definition ConfigCacheIni.cpp:3955
friend FArchive & operator<<(FArchive &Ar, FConfigBranch &ConfigBranch)
Definition ConfigCacheIni.cpp:6240
CORE_API bool AddDynamicLayerStringToHierarchy(const FString &Filename, const FString &Contents, FName Tag=NAME_None, DynamicLayerPriority Priority=DynamicLayerPriority::Unknown, FConfigModificationTracker *ModificationTracker=nullptr)
Definition ConfigCacheIni.cpp:3584
EBranchReplayMethod ReplayMethod
Definition ConfigCacheIni.h:1126
FString IniPath
Definition ConfigCacheIni.h:1113
CORE_API void SafeReload()
Definition ConfigCacheIni.cpp:3797
CORE_API void RunOnEachFile(TFunction< void(FConfigFile &File, const FString &Name)> Func)
Definition ConfigCacheIni.cpp:3382
CORE_API void Flush()
Definition ConfigCacheIni.cpp:3950
FConfigFile InMemoryFile
Definition ConfigCacheIni.h:1144
CORE_API const FConfigCommandStream * GetStaticLayer(const FString &LayerSubstring) const
Definition ConfigCacheIni.cpp:3893
CORE_API bool RemoveDynamicLayersFromHierarchy(const TArray< FString > &Filenames, FConfigModificationTracker *ModificationTracker=nullptr)
Definition ConfigCacheIni.cpp:3694
Definition ConfigCacheIni.h:1240
bool GetValue(const TCHAR *Section, const TCHAR *Key, int32 &Value, const FString &Filename)
Definition ConfigCacheIni.h:1561
bool GetValue(const TCHAR *Section, const TCHAR *Key, FText &Value, const FString &Filename)
Definition ConfigCacheIni.h:1557
FText GetTextOrDefault(const TCHAR *Section, const TCHAR *Key, const FText &DefaultValue, const FString &Filename)
Definition ConfigCacheIni.h:1612
bool GetBoolOrDefault(const TCHAR *Section, const TCHAR *Key, const bool DefaultValue, const FString &Filename)
Definition ConfigCacheIni.h:1594
int32 GetValue(const TCHAR *Section, const TCHAR *Key, TArray< FString > &Value, const FString &Filename)
Definition ConfigCacheIni.h:1573
static CORE_API bool CreateGConfigFromSaved(const TCHAR *Filename)
friend bool MakeBinaryConfig(const TCHAR *CmdLine)
bool GetValue(const TCHAR *Section, const TCHAR *Key, FString &Value, const FString &Filename)
Definition ConfigCacheIni.h:1553
bool IsReadyForUse()
Definition ConfigCacheIni.h:1268
bool GetValue(const TCHAR *Section, const TCHAR *Key, bool &Value, const FString &Filename)
Definition ConfigCacheIni.h:1569
float GetFloatOrDefault(const TCHAR *Section, const TCHAR *Key, const float DefaultValue, const FString &Filename)
Definition ConfigCacheIni.h:1588
bool IsGloballyRegistered() const
Definition ConfigCacheIni.h:1274
FString GetStringOrDefault(const TCHAR *Section, const TCHAR *Key, const FString &DefaultValue, const FString &Filename)
Definition ConfigCacheIni.h:1600
bool GetValue(const TCHAR *Section, const TCHAR *Key, float &Value, const FString &Filename)
Definition ConfigCacheIni.h:1565
int32 GetIntOrDefault(const TCHAR *Section, const TCHAR *Key, const int32 DefaultValue, const FString &Filename)
Definition ConfigCacheIni.h:1582
Definition ConfigCacheIni.h:526
TMap< FName, FString > ArrayOfStructKeys
Definition ConfigCacheIni.h:528
Definition ConfigCacheIni.h:533
uint8 bPythonConfigParserMode
Definition ConfigCacheIni.h:551
uint8 Dirty
Definition ConfigCacheIni.h:550
FConfigCommandStreamSection * FindOrAddSectionInternal(const FString &SectionName)
Definition ConfigCacheIni.cpp:3295
TMap< FString, TMap< FName, FString > > PerObjectConfigArrayOfStructKeys
Definition ConfigCacheIni.h:545
uint16 Priority
Definition ConfigCacheIni.h:560
void Shrink()
Definition ConfigCacheIni.cpp:3300
FString Filename
Definition ConfigCacheIni.h:561
FName Tag
Definition ConfigCacheIni.h:548
void ProcessCommand(SectionType *Section, FStringView SectionName, FConfigValue::EValueType Command, FName Key, FString &&Value)
Definition ConfigCacheIni.cpp:3290
uint8 bIsSavedConfigFile
Definition ConfigCacheIni.h:555
bool FillFileFromDisk(const FString &Filename, bool bHandleSymbolCommands)
Definition ConfigCacheIni.cpp:3285
uint8 bNeverSafeUnload
Definition ConfigCacheIni.h:558
class FConfigBranch * Branch
Definition ConfigCacheIni.h:547
Definition ConfigContext.h:31
Definition ConfigTypes.h:14
Definition ConfigCacheIni.h:566
CORE_API bool AddUniqueToSection(const TCHAR *Section, FName Key, const FString &Value)
Definition ConfigCacheIni.cpp:3048
bool GetValue(const TCHAR *Section, const TCHAR *Key, double &Value) const
Definition ConfigCacheIni.h:893
ValueType & Add(const KeyType &InKey, ValueType &&InValue)
Definition ConfigCacheIni.h:676
friend FArchive & operator<<(FArchive &Ar, FConfigFile &ConfigFile)
Definition ConfigCacheIni.cpp:6682
static CORE_API bool OverrideFileFromCommandline(FString &Filename)
CORE_API bool AddToSection(const TCHAR *Section, FName Key, const FString &Value)
Definition ConfigCacheIni.cpp:3033
CORE_API void SetText(const TCHAR *Section, const TCHAR *Key, const FText &Value)
Definition ConfigCacheIni.cpp:2935
int32 Num() const
Definition ConfigCacheIni.h:628
static bool ShouldExportQuotedString(const FString &PropertyValue)
Definition ConfigCacheIni.cpp:2138
bool bHasPlatformName
Definition ConfigCacheIni.h:572
int32 GetKeys(TSet< FString > &Keys) const
Definition ConfigCacheIni.h:658
CORE_API void WriteToString(FString &InOutText, const FString &SimulatedFilename=FString(), const FString &PrefixText=FString())
Definition ConfigCacheIni.cpp:2547
CORE_API const FConfigSection * FindOrAddConfigSection(const FString &Name)
Definition ConfigCacheIni.cpp:1492
CORE_API void ProcessInputFileContents(FStringView Contents, const FString &FileHint)
Definition ConfigCacheIni.cpp:2128
CORE_API bool ResetKeyInSection(const TCHAR *Section, FName Key)
Definition ConfigCacheIni.cpp:3107
CORE_API bool UpdateSinglePropertyInSection(const TCHAR *DiskFilename, const TCHAR *PropertyName, const TCHAR *SectionName)
Definition ConfigCacheIni.cpp:6828
static FString GenerateExportedPropertyLine(const FString &PropertyName, const FString &PropertyValue)
Definition ConfigCacheIni.cpp:2199
CORE_API void SetString(const TCHAR *Section, const TCHAR *Key, const TCHAR *Value)
Definition ConfigCacheIni.cpp:2917
bool GetValue(const TCHAR *Section, const TCHAR *Key, float &Value) const
Definition ConfigCacheIni.h:889
int32 GetValue(const TCHAR *Section, const TCHAR *Key, TArray< FString > &Value) const
Definition ConfigCacheIni.h:905
bool GetBool(const TCHAR *Section, const TCHAR *Key, bool &Value) const
Definition ConfigCacheIni.h:865
CORE_API bool DoesSectionExist(const TCHAR *Section) const
Definition ConfigCacheIni.cpp:2912
bool Contains(const FString &SectionName) const
Definition ConfigCacheIni.h:646
bool GetFloat(const TCHAR *Section, const TCHAR *Key, float &Value) const
Definition ConfigCacheIni.h:838
bool GetString(const TCHAR *Section, const TCHAR *Key, FString &Value) const
Definition ConfigCacheIni.h:802
bool GetValue(const TCHAR *Section, const TCHAR *Key, FString &Value) const
Definition ConfigCacheIni.h:877
FName Tag
Definition ConfigCacheIni.h:587
TRangedForConstIterator end() const
Definition ConfigCacheIni.h:712
void Append(TMap< FString, FConfigSection > Other)
Definition ConfigCacheIni.h:694
TRangedForConstIterator begin() const
Definition ConfigCacheIni.h:706
bool GetValue(const TCHAR *Section, const TCHAR *Key, int32 &Value) const
Definition ConfigCacheIni.h:885
CORE_API void SetInt64(const TCHAR *Section, const TCHAR *Key, const int64 Value)
Definition ConfigCacheIni.cpp:2975
CORE_API void SetBool(const TCHAR *Section, const TCHAR *Key, bool Value)
Definition ConfigCacheIni.cpp:2970
static CORE_API void OverrideFromCommandline(FConfigFile *File, const FString &Filename)
Definition ConfigCacheIni.cpp:2330
CORE_API void AddMissingProperties(const FConfigFile &InSourceFile)
Definition ConfigCacheIni.cpp:2828
CORE_API void CombineFromBuffer(const FString &Buffer, const FString &FileHint)
Definition ConfigCacheIni.cpp:2118
CORE_API void SetDouble(const TCHAR *Section, const TCHAR *Key, double Value)
Definition ConfigCacheIni.cpp:2963
ValueType & Add(KeyType &&InKey, const ValueType &InValue)
Definition ConfigCacheIni.h:682
CORE_API void AddDynamicLayerToHierarchy(const FString &Filename)
bool Dirty
Definition ConfigCacheIni.h:570
int32 GetKeys(TArray< FString > &Keys) const
Definition ConfigCacheIni.h:652
ValueType & Add(KeyType &&InKey, ValueType &&InValue)
Definition ConfigCacheIni.h:688
bool bPythonConfigParserMode
Definition ConfigCacheIni.h:573
CORE_API FConfigFile()
Definition ConfigCacheIni.cpp:1287
CORE_API bool SetInSection(const TCHAR *SectionName, FName Key, const FString &Value)
Definition ConfigCacheIni.cpp:3016
CORE_API void SetFloat(const TCHAR *Section, const TCHAR *Key, float Value)
Definition ConfigCacheIni.cpp:2956
FName Name
Definition ConfigCacheIni.h:583
CORE_API bool RemoveKeyFromSection(const TCHAR *Section, FName Key)
Definition ConfigCacheIni.cpp:3069
ValueType & Add(const KeyType &InKey, const ValueType &InValue)
Definition ConfigCacheIni.h:670
TArray< FConfigCommandlineOverride > CommandlineOptions
Definition ConfigCacheIni.h:595
CORE_API void Dump(FOutputDevice &Ar)
Definition ConfigCacheIni.cpp:2865
bool GetDouble(const TCHAR *Section, const TCHAR *Key, double &Value) const
Definition ConfigCacheIni.h:847
bool NoSave
Definition ConfigCacheIni.h:571
class FConfigBranch * Branch
Definition ConfigCacheIni.h:591
bool IsEmpty() const
Definition ConfigCacheIni.h:634
int32 Remove(KeyConstPointerType InKey)
Definition ConfigCacheIni.h:664
CORE_API bool ApplyFile(const FConfigCommandStream *File)
Definition ConfigCacheIni.cpp:1701
friend void FillFileFromBuffer(FileType *File, FStringView Buffer, bool bHandleSymbolCommands, const FString &FileHint)
Definition ConfigCacheIni.cpp:1820
bool operator!=(const FConfigFile &Other) const
Definition ConfigCacheIni.cpp:1469
bool GetUInt(const TCHAR *Section, const TCHAR *Key, uint32 &Value) const
Definition ConfigCacheIni.h:829
static CORE_API bool WriteTempFileThenMove()
Definition ConfigCacheIni.cpp:2525
FString PlatformName
Definition ConfigCacheIni.h:584
void Reset()
Definition ConfigCacheIni.h:700
bool GetValue(const TCHAR *Section, const TCHAR *Key, bool &Value) const
Definition ConfigCacheIni.h:901
void Empty(int32 ExpectedNumElements=0)
Definition ConfigCacheIni.h:640
void ProcessSourceAndCheckAgainstBackup()
Definition ConfigCacheIni.cpp:3160
CORE_API int32 GetArray(const TCHAR *Section, const TCHAR *Key, TArray< FString > &Value) const
Definition ConfigCacheIni.cpp:2900
CORE_API void SetArray(const TCHAR *Section, const TCHAR *Key, const TArray< FString > &Value)
Definition ConfigCacheIni.cpp:2983
bool GetValue(const TCHAR *Section, const TCHAR *Key, int64 &Value) const
Definition ConfigCacheIni.h:897
CORE_API void UpdateSections(const TCHAR *DiskFilename, const TCHAR *IniRootName=nullptr, const TCHAR *OverridePlatform=nullptr)
Definition ConfigCacheIni.cpp:6710
bool GetInt(const TCHAR *Section, const TCHAR *Key, int32 &Value) const
Definition ConfigCacheIni.h:820
CORE_API FConfigFile & operator=(const FConfigFile &Other)
Definition ConfigCacheIni.cpp:1327
CORE_API bool RemoveFromSection(const TCHAR *Section, FName Key, const FString &Value)
Definition ConfigCacheIni.cpp:3092
bool bCanSaveAllSections
Definition ConfigCacheIni.h:577
const FConfigSection * FindSection(const FString &SectionName) const
Definition ConfigCacheIni.h:622
CORE_API ~FConfigFile()
Definition ConfigCacheIni.cpp:1298
static void AppendExportedPropertyLine(FString &Out, const FString &PropertyName, const FString &PropertyValue)
Definition ConfigCacheIni.cpp:2206
bool operator==(const FConfigFile &Other) const
Definition ConfigCacheIni.cpp:1450
bool GetValue(const TCHAR *Section, const TCHAR *Key, FText &Value) const
Definition ConfigCacheIni.h:881
bool GetInt64(const TCHAR *Section, const TCHAR *Key, int64 &Value) const
Definition ConfigCacheIni.h:856
bool GetText(const TCHAR *Section, const TCHAR *Key, FText &Value) const
Definition ConfigCacheIni.h:811
FConfigFile(int32)
Definition ConfigCacheIni.h:612
Definition ConfigCacheIni.h:499
bool bTrackModifiedSections
Definition ConfigCacheIni.h:510
TArray< FString > LoadedFiles
Definition ConfigCacheIni.h:515
TMap< FString, FCVarTracker > CVars
Definition ConfigCacheIni.h:518
bool bTrackLoadedFiles
Definition ConfigCacheIni.h:511
TArray< FString > ClassesToSkipInstances
Definition ConfigCacheIni.h:522
TArray< FString > ClassesToSkipSubclasses
Definition ConfigCacheIni.h:521
TMap< FName, TSet< FString > > ModifiedSectionsPerBranch
Definition ConfigCacheIni.h:514
Definition ConfigCacheIni.h:407
CORE_API bool GetUInt(const TCHAR *Key, uint32 &Value) const
Definition ConfigCacheIni.cpp:957
CORE_API bool GetDouble(const TCHAR *Key, double &Value) const
Definition ConfigCacheIni.cpp:979
bool HandleArrayOfKeyedStructsCommand(FName Key, FString &&Value)
Definition ConfigCacheIni.cpp:881
CORE_API bool GetBool(const TCHAR *Key, bool &Value) const
Definition ConfigCacheIni.cpp:1001
CORE_API int32 GetArray(const TCHAR *Key, TArray< FString > &Value) const
Definition ConfigCacheIni.cpp:1012
bool operator!=(const FConfigSection &Other) const
Definition ConfigCacheIni.cpp:791
static bool HasQuotes(const FString &Test)
Definition ConfigCacheIni.cpp:751
CORE_API bool GetInt(const TCHAR *Key, int32 &Value) const
Definition ConfigCacheIni.cpp:946
void CORE_API HandleAddCommand(FName ValueName, FString &&Value, bool bAppendValueIfNotArrayOfStructsKeyUsed)
Definition ConfigCacheIni.cpp:866
TSet< FName > EmptyInitializedKeys
Definition ConfigCacheIni.h:476
FConfigSection()
Definition ConfigCacheIni.h:409
FConfigSection(UE::ConfigAccessTracking::FSection *InSectionAccess)
Definition ConfigCacheIni.h:414
CORE_API bool GetText(const TCHAR *Section, const TCHAR *Key, FText &Value) const
Definition ConfigCacheIni.cpp:936
bool operator==(const FConfigSection &Other) const
Definition ConfigCacheIni.cpp:761
void MultiFind(const FName Key, TArray< FString, Allocator > &OutValues, const bool bMaintainOrder=false) const
Definition ConfigCacheIni.h:444
friend FArchive & operator<<(FArchive &Ar, FConfigSection &ConfigSection)
Definition ConfigCacheIni.cpp:825
TMap< FName, FString > ArrayOfStructKeys
Definition ConfigCacheIni.h:468
CORE_API bool GetFloat(const TCHAR *Key, float &Value) const
Definition ConfigCacheIni.cpp:968
CORE_API bool GetInt64(const TCHAR *Key, int64 &Value) const
Definition ConfigCacheIni.cpp:990
void MultiFind(const FName Key, TArray< FConfigValue, Allocator > &OutValues, const bool bMaintainOrder=false) const
Definition ConfigCacheIni.h:438
CORE_API bool GetString(const TCHAR *Key, FString &Value) const
Definition ConfigCacheIni.cpp:925
bool bCanSave
Definition ConfigCacheIni.h:479
Definition NameTypes.h:617
Definition OutputDevice.h:133
static CORE_API FString GeneratedConfigDir()
Definition Paths.cpp:549
Definition StructuredArchiveAdapters.h:13
CORE_API FStructuredArchiveSlot GetSlot()
Definition StructuredArchiveFromArchive.cpp:37
Definition StructuredArchiveSlots.h:52
static UE_FORCEINLINE_HINT uint32 HashString(const TCHAR *InStr, const uint32 InBaseHash=0)
Definition TextLocalizationResource.h:80
Definition Text.h:385
Definition IConsoleManager.h:558
Definition Array.h:670
Definition AndroidPlatformMisc.h:14
Definition UnrealString.h.inl:34
Definition RefCounting.h:454
Definition CriticalSection.h:14
CORE_API FArchive & GetUnderlyingArchive() const
Definition StructuredArchiveSlots.cpp:7
Definition ScopeRWLock.h:21
Definition ScopeRWLock.h:60
UE_REWRITE void Reverse(T(&Array)[ArraySize])
Definition Reverse.h:28
Definition TestUtils.cpp:8
Definition Color.h:486
Definition ConfigCacheIni.h:1917
Definition ConfigCacheIni.h:491
FString PropertyValue
Definition ConfigCacheIni.h:492
FString PropertyKey
Definition ConfigCacheIni.h:492
FString Section
Definition ConfigCacheIni.h:492
FString BaseFileName
Definition ConfigCacheIni.h:492
Definition ConfigCacheIni.h:502
TMap< FName, TMap< FName, FConfigSection > > CVarEntriesPerBranchPerTag
Definition ConfigCacheIni.h:506
int CVarPriority
Definition ConfigCacheIni.h:504
Definition ConfigCacheIni.h:124
const FString & GetSavedValue() const
Definition ConfigCacheIni.h:295
FConfigValue(const FConfigSection *InSection, FName InValueName, FString &&InValue, EValueType Type=EValueType::Combined)
Definition ConfigCacheIni.h:201
FConfigValue(FString &&InValue, EValueType Type=EValueType::Combined)
Definition ConfigCacheIni.h:197
EValueType ValueType
Definition ConfigCacheIni.h:394
friend void operator<<(FStructuredArchive::FSlot Slot, FConfigValue &ConfigValue)
Definition ConfigCacheIni.h:318
FConfigValue & operator=(FConfigValue &&RHS)
Definition ConfigCacheIni.h:239
FConfigValue & operator=(const TCHAR *RHS)
Definition ConfigCacheIni.h:267
FConfigValue & operator=(const FString &RHS)
Definition ConfigCacheIni.h:272
const FString & GetSavedValueForWriting() const
Definition ConfigCacheIni.h:381
FConfigValue()
Definition ConfigCacheIni.h:152
FConfigValue(const FString &InValue, EValueType Type=EValueType::Combined)
Definition ConfigCacheIni.h:181
FConfigValue & operator=(const FConfigValue &RHS)
Definition ConfigCacheIni.h:253
friend FArchive & operator<<(FArchive &Ar, FConfigValue &ConfigValue)
Definition ConfigCacheIni.h:312
UE_FORCEINLINE_HINT FString GetValueForWriting() const
Definition ConfigCacheIni.h:371
FConfigValue(FConfigValue &&InConfigValue)
Definition ConfigCacheIni.h:226
FConfigValue(const FConfigSection *InSection, FName InValueName, const FString &InValue, EValueType Type=EValueType::Combined)
Definition ConfigCacheIni.h:185
FConfigValue(const FConfigSection *InSection, FName InValueName, EValueType Type=EValueType::Combined)
Definition ConfigCacheIni.h:156
static CORE_API bool CollapseValue(const FString &InExpandedValue, FString &OutCollapsedValue)
Definition ConfigCacheIni.cpp:235
FConfigValue(const FConfigSection *InSection, FName InValueName, const TCHAR *InValue, EValueType Type=EValueType::Combined)
Definition ConfigCacheIni.h:169
bool operator!=(const FConfigValue &Other) const
Definition ConfigCacheIni.h:310
FString GetValue() const
Definition ConfigCacheIni.h:286
FConfigValue(const TCHAR *InValue, EValueType Type=EValueType::Combined)
Definition ConfigCacheIni.h:165
EValueType
Definition ConfigCacheIni.h:127
static CORE_API bool ExpandValue(const FString &InCollapsedValue, FString &OutExpandedValue)
Definition ConfigCacheIni.cpp:170
FConfigValue & operator=(FString &&RHS)
Definition ConfigCacheIni.h:277
bool operator==(const FConfigValue &Other) const
Definition ConfigCacheIni.h:309
FConfigValue(const FConfigValue &InConfigValue)
Definition ConfigCacheIni.h:213
Definition ConfigCacheIni.cpp:5763
Definition NameTypes.h:439