![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <ConfigCacheIni.h>
Inheritance diagram for FConfigFile:Public Types | |
| using | SectionType = FConfigSection |
Public Member Functions | |
| CORE_API | FConfigFile () |
| FConfigFile (int32) | |
| CORE_API | ~FConfigFile () |
| CORE_API | FConfigFile (const FConfigFile &Other) |
| CORE_API | FConfigFile (FConfigFile &&Other) |
| CORE_API FConfigFile & | operator= (const FConfigFile &Other) |
| CORE_API FConfigFile & | operator= (FConfigFile &&Other) |
| CORE_API const FConfigSection * | FindOrAddConfigSection (const FString &Name) |
| const FConfigSection * | FindSection (const FString &SectionName) const |
| int32 | Num () const |
| bool | IsEmpty () const |
| void | Empty (int32 ExpectedNumElements=0) |
| bool | Contains (const FString &SectionName) const |
| int32 | GetKeys (TArray< FString > &Keys) const |
| int32 | GetKeys (TSet< FString > &Keys) const |
| int32 | Remove (KeyConstPointerType InKey) |
| ValueType & | Add (const KeyType &InKey, const ValueType &InValue) |
| ValueType & | Add (const KeyType &InKey, ValueType &&InValue) |
| ValueType & | Add (KeyType &&InKey, const ValueType &InValue) |
| ValueType & | Add (KeyType &&InKey, ValueType &&InValue) |
| void | Append (TMap< FString, FConfigSection > Other) |
| void | Reset () |
| TRangedForConstIterator | begin () const |
| TRangedForConstIterator | end () const |
| bool | operator== (const FConfigFile &Other) const |
| bool | operator!= (const FConfigFile &Other) const |
| CORE_API bool | Combine (const FString &Filename) |
| CORE_API void | CombineFromBuffer (const FString &Buffer, const FString &FileHint) |
| CORE_API void | Read (const FString &Filename) |
| CORE_API bool | ApplyFile (const FConfigCommandStream *File) |
| CORE_API bool | Write (const FString &Filename, bool bDoRemoteWrite=true, const FString &PrefixText=FString()) |
| CORE_API void | WriteToString (FString &InOutText, const FString &SimulatedFilename=FString(), const FString &PrefixText=FString()) |
| CORE_API void | Dump (FOutputDevice &Ar) |
| bool | GetString (const TCHAR *Section, const TCHAR *Key, FString &Value) const |
| bool | GetText (const TCHAR *Section, const TCHAR *Key, FText &Value) const |
| bool | GetInt (const TCHAR *Section, const TCHAR *Key, int32 &Value) const |
| bool | GetUInt (const TCHAR *Section, const TCHAR *Key, uint32 &Value) const |
| bool | GetFloat (const TCHAR *Section, const TCHAR *Key, float &Value) const |
| bool | GetDouble (const TCHAR *Section, const TCHAR *Key, double &Value) const |
| bool | GetInt64 (const TCHAR *Section, const TCHAR *Key, int64 &Value) const |
| bool | GetBool (const TCHAR *Section, const TCHAR *Key, bool &Value) const |
| CORE_API int32 | GetArray (const TCHAR *Section, const TCHAR *Key, TArray< FString > &Value) const |
| bool | GetValue (const TCHAR *Section, const TCHAR *Key, FString &Value) const |
| bool | GetValue (const TCHAR *Section, const TCHAR *Key, FText &Value) const |
| bool | GetValue (const TCHAR *Section, const TCHAR *Key, int32 &Value) const |
| bool | GetValue (const TCHAR *Section, const TCHAR *Key, float &Value) const |
| bool | GetValue (const TCHAR *Section, const TCHAR *Key, double &Value) const |
| bool | GetValue (const TCHAR *Section, const TCHAR *Key, int64 &Value) const |
| bool | GetValue (const TCHAR *Section, const TCHAR *Key, bool &Value) const |
| int32 | GetValue (const TCHAR *Section, const TCHAR *Key, TArray< FString > &Value) const |
| CORE_API bool | DoesSectionExist (const TCHAR *Section) const |
| CORE_API void | SetString (const TCHAR *Section, const TCHAR *Key, const TCHAR *Value) |
| CORE_API void | SetText (const TCHAR *Section, const TCHAR *Key, const FText &Value) |
| CORE_API void | SetFloat (const TCHAR *Section, const TCHAR *Key, float Value) |
| CORE_API void | SetDouble (const TCHAR *Section, const TCHAR *Key, double Value) |
| CORE_API void | SetBool (const TCHAR *Section, const TCHAR *Key, bool Value) |
| CORE_API void | SetInt64 (const TCHAR *Section, const TCHAR *Key, const int64 Value) |
| CORE_API void | SetArray (const TCHAR *Section, const TCHAR *Key, const TArray< FString > &Value) |
| CORE_API bool | SetInSection (const TCHAR *SectionName, FName Key, const FString &Value) |
| CORE_API bool | AddToSection (const TCHAR *Section, FName Key, const FString &Value) |
| CORE_API bool | AddUniqueToSection (const TCHAR *Section, FName Key, const FString &Value) |
| CORE_API bool | RemoveKeyFromSection (const TCHAR *Section, FName Key) |
| CORE_API bool | RemoveFromSection (const TCHAR *Section, FName Key, const FString &Value) |
| CORE_API bool | ResetKeyInSection (const TCHAR *Section, FName Key) |
| CORE_API void | ProcessInputFileContents (FStringView Contents, const FString &FileHint) |
| CORE_API void | AddMissingProperties (const FConfigFile &InSourceFile) |
| CORE_API void | UpdateSections (const TCHAR *DiskFilename, const TCHAR *IniRootName=nullptr, const TCHAR *OverridePlatform=nullptr) |
| CORE_API bool | UpdateSinglePropertyInSection (const TCHAR *DiskFilename, const TCHAR *PropertyName, const TCHAR *SectionName) |
| void | ProcessSourceAndCheckAgainstBackup () |
| CORE_API void | AddDynamicLayerToHierarchy (const FString &Filename) |
Static Public Member Functions | |
| static CORE_API bool | WriteTempFileThenMove () |
| static bool | ShouldExportQuotedString (const FString &PropertyValue) |
| static FString | GenerateExportedPropertyLine (const FString &PropertyName, const FString &PropertyValue) |
| static void | AppendExportedPropertyLine (FString &Out, const FString &PropertyName, const FString &PropertyValue) |
| static CORE_API void | OverrideFromCommandline (FConfigFile *File, const FString &Filename) |
| static CORE_API void | OverrideFromCommandline (FConfigCommandStream *File, const FString &Filename) |
| static CORE_API bool | OverrideFileFromCommandline (FString &Filename) |
Public Attributes | |
| bool | Dirty: 1 |
| bool | NoSave: 1 |
| bool | bHasPlatformName: 1 |
| bool | bPythonConfigParserMode: 1 |
| bool | bCanSaveAllSections: 1 |
| FName | Name |
| FString | PlatformName |
| FName | Tag |
| class FConfigBranch * | Branch = nullptr |
| TArray< FConfigCommandlineOverride > | CommandlineOptions |
Friends | |
| class | FConfigBranch |
| class | FConfigCacheIni |
| template<typename FileType > | |
| void | FillFileFromBuffer (FileType *File, FStringView Buffer, bool bHandleSymbolCommands, const FString &FileHint) |
| FArchive & | operator<< (FArchive &Ar, FConfigFile &ConfigFile) |
| FConfigFile::FConfigFile | ( | ) |
|
inline |
| FConfigFile::~FConfigFile | ( | ) |
| FConfigFile::FConfigFile | ( | const FConfigFile & | Other | ) |
| FConfigFile::FConfigFile | ( | FConfigFile && | Other | ) |
|
inline |
|
inline |
|
inline |
|
inline |
Appends a new INI file to the SourceIniHierarchy and combines it with the current contents
| void FConfigFile::AddMissingProperties | ( | const FConfigFile & | InSourceFile | ) |
Adds any properties that exist in InSourceFile that this config file is missing
Adds the given key/value pair to the Section. This will always add this pair to the section, even if the pair already exists. This is equivalent to the . operator in .ini files
Adds the given key/value pair to the Section, if the pair didn't already exist This is equivalent to the + operator in .ini files
|
inline |
|
static |
Append a correctly escaped line to add to the config file for the given property
| bool FConfigFile::ApplyFile | ( | const FConfigCommandStream * | File | ) |
Apply the contents of the given file (which must have non-Combined ValueTypes stored in it, it is a logic error otherwise and will assert) The values in this file will be Combined type
|
inline |
| bool FConfigFile::Combine | ( | const FString & | Filename | ) |
| void FConfigFile::CombineFromBuffer | ( | const FString & | Buffer, |
| const FString & | FileHint | ||
| ) |
|
inline |
| void FConfigFile::Dump | ( | FOutputDevice & | Ar | ) |
|
inline |
| const FConfigSection * FConfigFile::FindOrAddConfigSection | ( | const FString & | Name | ) |
|
inline |
|
static |
Generate a correctly escaped line to add to the config file for the given property
| int32 FConfigFile::GetArray | ( | const TCHAR * | Section, |
| const TCHAR * | Key, | ||
| TArray< FString > & | Value | ||
| ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| bool FConfigFile::operator!= | ( | const FConfigFile & | Other | ) | const |
| FConfigFile & FConfigFile::operator= | ( | const FConfigFile & | Other | ) |
| FConfigFile & FConfigFile::operator= | ( | FConfigFile && | Other | ) |
| bool FConfigFile::operator== | ( | const FConfigFile & | Other | ) | const |
Checks the command line for any overridden config file settings
|
static |
Looks for any overrides on the commandline for this file
| File | Config to possibly modify |
| Filename | Name of the .ini file to look for overrides |
|
static |
Checks the command line for any overridden config settings
| void FConfigFile::ProcessInputFileContents | ( | FStringView | Contents, |
| const FString & | FileHint | ||
| ) |
Process the contents of an .ini file that has been read into an FString
| Filename | Name of the .ini file the contents came from |
| Contents | Contents of the .ini file |
Process the contents of an .ini file that has been read into an FString
| Contents | Contents of the .ini file |
| void FConfigFile::ProcessSourceAndCheckAgainstBackup | ( | ) |
Check the source hierarchy which was loaded without any user changes from the Config/Saved dir. If anything in the default/base options have changed, we need to ensure that these propagate through to the final config so they are not potentially ignored
| void FConfigFile::Read | ( | const FString & | Filename | ) |
|
inline |
Removes every entry in the Section that has the Key/Value pair This is equivalent to the - operator in .ini files (although it will remove all instances of the pair, not just a single one)
Removes every entry in the Section that has Key, no matter what the Value is This is equivalent to the ! operator in .ini files
|
inline |
Similar to RemvoeKeyFromSection, but if this File's changes are being tracked, then we remove all changes to the the key that have been tracked. This would be used to remove enries in a layer so that the values from previous layers are used, unmodified. "Reset To Defaults" This is equivalent to deleting the keys from a .ini file
| void FConfigFile::SetArray | ( | const TCHAR * | Section, |
| const TCHAR * | Key, | ||
| const TArray< FString > & | Value | ||
| ) |
Sets the given key/value pair to the Section in the given File. This will replace any existing values (as if ResetKeyInSection had been called)
|
static |
Checks if the PropertyValue should be exported in quotes when writing the ini to disk.
| void FConfigFile::UpdateSections | ( | const TCHAR * | DiskFilename, |
| const TCHAR * | IniRootName = nullptr, |
||
| const TCHAR * | OverridePlatform = nullptr |
||
| ) |
Saves only the sections in this FConfigFile into the given file. All other sections in the file are left alone. The sections in this file are completely replaced. If IniRootName is specified, the current section settings are diffed against the file in the hierarchy up to right before this file (so, if you are saving DefaultEngine.ini, and IniRootName is "Engine", then Base.ini and BaseEngine.ini will be loaded, and only differences against that will be saved into DefaultEngine.ini)
| IniRootName | the name (like "Engine") to use to load a .ini hierarchy to diff against |
| bool FConfigFile::UpdateSinglePropertyInSection | ( | const TCHAR * | DiskFilename, |
| const TCHAR * | PropertyName, | ||
| const TCHAR * | SectionName | ||
| ) |
Update a single property in the config file, for the section that is specified.
| bool FConfigFile::Write | ( | const FString & | Filename, |
| bool | bDoRemoteWrite = true, |
||
| const FString & | PrefixText = FString() |
||
| ) |
Write this ConfigFile to the given Filename, constructed the text from the config sections in *this, prepended by the optional PrefixText
|
static |
Whether to write a temp file then move it to it's destination when saving.
| void FConfigFile::WriteToString | ( | FString & | InOutText, |
| const FString & | SimulatedFilename = FString(), |
||
| const FString & | PrefixText = FString() |
||
| ) |
Write this ConfigFile to the given string, constructed the text from the config sections in *this, prepended by the optional PrefixText
| SimulatedFilename | - If writing a default hierarchal ini, can be used to correctly deduce position in the hierarchy |
|
friend |
|
friend |
|
friend |
|
friend |
| bool FConfigFile::bCanSaveAllSections |
| bool FConfigFile::bHasPlatformName |
| bool FConfigFile::bPythonConfigParserMode |
| class FConfigBranch* FConfigFile::Branch = nullptr |
| TArray<FConfigCommandlineOverride> FConfigFile::CommandlineOptions |
The collection of overrides which stemmed from the commandline
| bool FConfigFile::Dirty |
| FName FConfigFile::Name |
The name of this config file
| bool FConfigFile::NoSave |
| FString FConfigFile::PlatformName |
| FName FConfigFile::Tag |