UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FConfigBranch Class Reference

#include <ConfigCacheIni.h>

Public Types

using DynamicLayerList = TDoubleLinkedList< FConfigCommandStream * >
 

Public Member Functions

 FConfigBranch ()
 
 FConfigBranch (const FConfigFile &ExistingFile)
 
CORE_API bool AddDynamicLayerToHierarchy (const FString &Filename, FConfigModificationTracker *ModificationTracker=nullptr, TSet< FString > *GlobalConfigFileCache=nullptr, TSet< FString > *PluginConfigFileCache=nullptr)
 
CORE_API bool AddDynamicLayersToHierarchy (const TArray< FDynamicLayerInfo > &Layers, FConfigModificationTracker *ModificationTracker=nullptr, TSet< FString > *GlobalConfigFileCache=nullptr, TSet< FString > *PluginConfigFileCache=nullptr, bool bForceFullDynamicLayerUpdate=false)
 
CORE_API bool AddDynamicLayersToHierarchy (const TArray< FString > &Filenames, FName Tag=NAME_None, DynamicLayerPriority Priority=DynamicLayerPriority::Unknown, FConfigModificationTracker *ModificationTracker=nullptr)
 
CORE_API bool AddDynamicLayerStringToHierarchy (const FString &Filename, const FString &Contents, FName Tag=NAME_None, DynamicLayerPriority Priority=DynamicLayerPriority::Unknown, FConfigModificationTracker *ModificationTracker=nullptr)
 
CORE_API bool RemoveDynamicLayerFromHierarchy (const FString &Filename, FConfigModificationTracker *ModificationTracker=nullptr)
 
CORE_API bool RemoveDynamicLayersFromHierarchy (const TArray< FString > &Filenames, FConfigModificationTracker *ModificationTracker=nullptr)
 
CORE_API void SafeUnload ()
 
CORE_API void SafeReload ()
 
CORE_API void ReapplyLayers ()
 
CORE_API bool MergeStaticLayersUpTo (const FString &LayerNameSubstring, FConfigFile &OutFile) const
 
CORE_API bool MergeStaticLayersUpToAndIncluding (const FString &LayerNameSubstring, FConfigFile &OutFile) const
 
CORE_API const FConfigCommandStreamGetStaticLayer (const FString &LayerSubstring) const
 
CORE_API bool RemoveSection (const TCHAR *Section)
 
CORE_API bool Delete ()
 
CORE_API void Flush ()
 
CORE_API void Shrink ()
 
CORE_API void Dump (FOutputDevice &Ar)
 
CORE_API void RunOnEachFile (TFunction< void(FConfigFile &File, const FString &Name)> Func)
 
CORE_API void RunOnEachCommandStream (TFunction< void(FConfigCommandStream &File, const FString &Name)> Func)
 

Public Attributes

FName IniName
 
FString IniPath
 
FName Platform
 
FString SourceEngineConfigDir
 
FString SourceProjectConfigDir
 
bool bIsSafeUnloaded
 
bool bIsHierarchical
 
bool bAllowedToRemove = true
 
EBranchReplayMethod ReplayMethod = EBranchReplayMethod::NoReplay
 
FConfigFileHierarchy Hierarchy
 
TMap< FString, FConfigCommandStreamStaticLayers
 
DynamicLayerList DynamicLayers
 
FConfigCommandStream SavedLayer
 
FConfigFile CombinedStaticLayers
 
FConfigFile FinalCombinedLayers
 
FConfigCommandStream CommandLineOverrides
 
FConfigFile InMemoryFile
 
FConfigCommandStream RuntimeChanges
 

Friends

class FConfigCacheIni
 
FArchiveoperator<< (FArchive &Ar, FConfigBranch &ConfigBranch)
 

Member Typedef Documentation

◆ DynamicLayerList

Constructor & Destructor Documentation

◆ FConfigBranch() [1/2]

FConfigBranch::FConfigBranch ( )

◆ FConfigBranch() [2/2]

FConfigBranch::FConfigBranch ( const FConfigFile ExistingFile)

Member Function Documentation

◆ AddDynamicLayersToHierarchy() [1/2]

bool FConfigBranch::AddDynamicLayersToHierarchy ( const TArray< FDynamicLayerInfo > &  Layers,
FConfigModificationTracker ModificationTracker = nullptr,
TSet< FString > *  GlobalConfigFileCache = nullptr,
TSet< FString > *  PluginConfigFileCache = nullptr,
bool  bForceFullDynamicLayerUpdate = false 
)

◆ AddDynamicLayersToHierarchy() [2/2]

bool FConfigBranch::AddDynamicLayersToHierarchy ( const TArray< FString > &  Filenames,
FName  Tag = NAME_None,
DynamicLayerPriority  Priority = DynamicLayerPriority::Unknown,
FConfigModificationTracker ModificationTracker = nullptr 
)

◆ AddDynamicLayerStringToHierarchy()

bool FConfigBranch::AddDynamicLayerStringToHierarchy ( const FString &  Filename,
const FString &  Contents,
FName  Tag = NAME_None,
DynamicLayerPriority  Priority = DynamicLayerPriority::Unknown,
FConfigModificationTracker ModificationTracker = nullptr 
)

◆ AddDynamicLayerToHierarchy()

bool FConfigBranch::AddDynamicLayerToHierarchy ( const FString &  Filename,
FConfigModificationTracker ModificationTracker = nullptr,
TSet< FString > *  GlobalConfigFileCache = nullptr,
TSet< FString > *  PluginConfigFileCache = nullptr 
)

Appends a new INI file to the SourceIniHierarchy and combines it with the current contents Additonally, returns the FConfigFIle object that contains just the loaded sections Can return the modified sections if the callers wants to reloadconfig on classes

◆ Delete()

bool FConfigBranch::Delete ( )

Deletes the final saved branch file, such as "Saved/Config/Windows/Engine.ini".

Returns
Whether the file was successfully deleted.

◆ Dump()

void FConfigBranch::Dump ( FOutputDevice Ar)

◆ Flush()

void FConfigBranch::Flush ( )

◆ GetStaticLayer()

const FConfigCommandStream * FConfigBranch::GetStaticLayer ( const FString &  LayerSubstring) const

Find the static layer that first matches the substring (or full) name of the layer filename

◆ MergeStaticLayersUpTo()

bool FConfigBranch::MergeStaticLayersUpTo ( const FString &  LayerNameSubstring,
FConfigFile OutFile 
) const

Apply all static layers up, but not including, the given layer name substring (so passing "DefaultEngine" will give all values before the DefaultEngine layer) This only works if static layers are being tracked (generally in the editor and not client builds - see EBranchReplayMethod::FullReplay)

Returns
true if the layer was found, or false if the layer name was not found (which means all static layers will be combined and returned)

◆ MergeStaticLayersUpToAndIncluding()

bool FConfigBranch::MergeStaticLayersUpToAndIncluding ( const FString &  LayerNameSubstring,
FConfigFile OutFile 
) const

Same as MergeStaticLayersUpTo, but includes the passed in layer

◆ ReapplyLayers()

void FConfigBranch::ReapplyLayers ( )

Recalculate the usable values from all static and dynamic layers. Useful if you update a layer and need to see results in the InMemoryFile (ie what GConfig->GetXXX returns)

◆ RemoveDynamicLayerFromHierarchy()

bool FConfigBranch::RemoveDynamicLayerFromHierarchy ( const FString &  Filename,
FConfigModificationTracker ModificationTracker = nullptr 
)

Removes a dyanmic file from the hierarchy and recalculates the branch's IniMemoryFile Can return the modified sections if the callers wants to reloadconfig on classes

◆ RemoveDynamicLayersFromHierarchy()

bool FConfigBranch::RemoveDynamicLayersFromHierarchy ( const TArray< FString > &  Filenames,
FConfigModificationTracker ModificationTracker = nullptr 
)

◆ RemoveSection()

bool FConfigBranch::RemoveSection ( const TCHAR Section)

Removes the section completely from all layers of this branch This is destructive! It will not reload on demand (like SafeUnload does). Use this only when you know you will never need the values in the section again!

Returns
true if anything was removed

◆ RunOnEachCommandStream()

void FConfigBranch::RunOnEachCommandStream ( TFunction< void(FConfigCommandStream &File, const FString &Name)>  Func)

◆ RunOnEachFile()

void FConfigBranch::RunOnEachFile ( TFunction< void(FConfigFile &File, const FString &Name)>  Func)

Run a function on every file in the branch

◆ SafeReload()

void FConfigBranch::SafeReload ( )

◆ SafeUnload()

void FConfigBranch::SafeUnload ( )

Frees up the static layer memory, which can be useful if a branch is loaded from, cached, and never used again. However, if something does try to access it, it will reload in-place (can hitch your game, so be aware)

◆ Shrink()

void FConfigBranch::Shrink ( )

Friends And Related Symbol Documentation

◆ FConfigCacheIni

friend class FConfigCacheIni
friend

◆ operator<<

FArchive & operator<< ( FArchive Ar,
FConfigBranch ConfigBranch 
)
friend

Member Data Documentation

◆ bAllowedToRemove

bool FConfigBranch::bAllowedToRemove = true

◆ bIsHierarchical

bool FConfigBranch::bIsHierarchical

◆ bIsSafeUnloaded

bool FConfigBranch::bIsSafeUnloaded

◆ CombinedStaticLayers

FConfigFile FConfigBranch::CombinedStaticLayers

◆ CommandLineOverrides

FConfigCommandStream FConfigBranch::CommandLineOverrides

◆ DynamicLayers

DynamicLayerList FConfigBranch::DynamicLayers

◆ FinalCombinedLayers

FConfigFile FConfigBranch::FinalCombinedLayers

◆ Hierarchy

FConfigFileHierarchy FConfigBranch::Hierarchy

◆ IniName

FName FConfigBranch::IniName

◆ IniPath

FString FConfigBranch::IniPath

◆ InMemoryFile

FConfigFile FConfigBranch::InMemoryFile

◆ Platform

FName FConfigBranch::Platform

◆ ReplayMethod

EBranchReplayMethod FConfigBranch::ReplayMethod = EBranchReplayMethod::NoReplay

◆ RuntimeChanges

FConfigCommandStream FConfigBranch::RuntimeChanges

◆ SavedLayer

FConfigCommandStream FConfigBranch::SavedLayer

◆ SourceEngineConfigDir

FString FConfigBranch::SourceEngineConfigDir

◆ SourceProjectConfigDir

FString FConfigBranch::SourceProjectConfigDir

◆ StaticLayers

TMap<FString, FConfigCommandStream> FConfigBranch::StaticLayers

The documentation for this class was generated from the following files: