FConfigFile

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Misc/ConfigCacheIni.h

Include

#include "Misc/ConfigCacheIni.h"

Syntax

class FConfigFile : public TMap< FString, FConfigSection >

Variables

Name Description

Public variable

bool

 

bHasPlatformName

Public variable

FString

 

CacheKey

Key to the cache to speed up ini parsing

Public variable

TArray< FConfig...

 

CommandlineOptions

The collection of overrides which stemmed from the commandline

Public variable

bool

 

Dirty

Public variable

FName

 

Name

The name of this config file

Public variable

bool

 

NoSave

Public variable

FString

 

PlatformName

Public variable

FConfigFile ...

 

SourceConfigFile

The untainted config file which contains the coalesced base/default options. I.e. No Saved/ options

Public variable

FString

 

SourceEngineConfigDir

Locations where this file may have come from - used to merge with non-standard ini locations.

Public variable

FConfigFileHier...

 

SourceIniHierarchy

The collection of source files which were used to generate this file.

Public variable

FString

 

SourceProjectConfigDir

Constructors

Name Description

Public function

FConfigFile()

Public function

FConfigFile

(
    int32
)

Destructors

Name Description

Public function

~FConfigFile()

Functions

Name Description

Public function

void

 

AddDynamicLayerToHierarchy

(
    const FString& Filename
)

Appends a new INI file to the SourceIniHierarchy and combines it with the current contents

Public function

void

 

AddMissingProperties

(
    const FConfigFile& InSourceFile
)

Adds any properties that exist in InSourceFile that this config file is missing

Public function Static

void

 

AppendExportedPropertyLine

(
    FString& Out,
    const FString& PropertyName,
    const FString& PropertyValue
)

Append a correctly escaped line to add to the config file for the given property

Public function

bool

 

Combine

(
    const FString& Filename
)

Public function

void

 

CombineFromBuffer

(
    const FString& Buffer
)

Public function

void

 

Dump

(
    FOutputDevice& Ar
)

Public function

FConfigSecti...

 

FindOrAddSection

(
    const FString& Name
)

Looks for a section by name, and creates an empty one if it can't be found

Public function Static

FString

 

GenerateExportedPropertyLine

(
    const FString& PropertyName,
    const FString& PropertyValue
)

Generate a correctly escaped line to add to the config file for the given property

Public function Const

int32

 

GetArray

(
    const TCHAR* Section,
    const TCHAR* Key,
    TArray< FString >& Value
)

Public function Const

bool

 

GetBool

(
    const TCHAR* Section,
    const TCHAR* Key,
    bool& Value
)

Public function Const

bool

 

GetDouble

(
    const TCHAR* Section,
    const TCHAR* Key,
    double& Value
)

Public function Const

bool

 

GetFloat

(
    const TCHAR* Section,
    const TCHAR* Key,
    float& Value
)

Public function Const

bool

 

GetInt

(
    const TCHAR* Section,
    const TCHAR* Key,
    int32& Value
)

Public function Const

bool

 

GetInt64

(
    const TCHAR* Section,
    const TCHAR* Key,
    int64& Value
)

Public function Const

bool

 

GetString

(
    const TCHAR* Section,
    const TCHAR* Key,
    FString& Value
)

Public function Const

bool

 

GetText

(
    const TCHAR* Section,
    const TCHAR* Key,
    FText& Value
)

Public function Const

bool

 

GetValue

(
    const TCHAR* Section,
    const TCHAR* Key,
    int64& Value
)

Public function Const

bool

 

GetValue

(
    const TCHAR* Section,
    const TCHAR* Key,
    double& Value
)

Public function Const

bool

 

GetValue

(
    const TCHAR* Section,
    const TCHAR* Key,
    float& Value
)

Public function Const

bool

 

GetValue

(
    const TCHAR* Section,
    const TCHAR* Key,
    int32& Value
)

Public function Const

bool

 

GetValue

(
    const TCHAR* Section,
    const TCHAR* Key,
    FText& Value
)

Public function Const

bool

 

GetValue

(
    const TCHAR* Section,
    const TCHAR* Key,
    FString& Value
)

Generic versions for use with templates

Public function Const

int32

 

GetValue

(
    const TCHAR* Section,
    const TCHAR* Key,
    TArray< FString >& Value
)

Public function Const

bool

 

GetValue

(
    const TCHAR* Section,
    const TCHAR* Key,
    bool& Value
)

Public function Static

bool

 

OverrideFileFromCommandline

(
    FString& Filename
)

Checks the command line for any overridden config file settings

Public function Static

void

 

OverrideFromCommandline

(
    FConfigFile* File,
    const FString& Filename
)

Checks the command line for any overridden config settings

Public function

void

 

ProcessInputFileContents

(
    FStringView Contents
)

Process the contents of an .ini file that has been read into an FString

Public function

void

 

ProcessSourceAndCheckAgainstBackup()

Check the source hierarchy which was loaded without any user changes from the Config/Saved dir.

Public function

void

 

Read

(
    const FString& Filename
)

Public function

void

 

SetArray

(
    const TCHAR* Section,
    const TCHAR* Key,
    const TArray< FString >& Value
)

Public function

void

 

SetBool

(
    const TCHAR* Section,
    const TCHAR* Key,
    bool Value
)

Public function

void

 

SetDouble

(
    const TCHAR* Section,
    const TCHAR* Key,
    double Value
)

Public function

void

 

SetFloat

(
    const TCHAR* Section,
    const TCHAR* Key,
    float Value
)

Public function

void

 

SetInt64

(
    const TCHAR* Section,
    const TCHAR* Key,
    const int64 Value
)

Public function

void

 

SetString

(
    const TCHAR* Section,
    const TCHAR* Key,
    const TCHAR* Value
)

Public function

void

 

SetText

(
    const TCHAR* Section,
    const TCHAR* Key,
    const FText& Value
)

Public function Static

bool

 

ShouldExportQuotedString

(
    const FString& PropertyValue
)

Checks if the PropertyValue should be exported in quotes when writing the ini to disk.

Public function

void

 

UpdateSections

(
    const TCHAR* DiskFilename,
    const TCHAR* IniRootName,
    const TCHAR* OverridePlatform
)

Saves only the sections in this FConfigFile into the given file.

Public function

bool

 

UpdateSinglePropertyInSection

(
    const TCHAR* DiskFilename,
    const TCHAR* PropertyName,
    const TCHAR* SectionName
)

Update a single property in the config file, for the section that is specified.

Public function

bool

 

Write

(
    const FString& Filename,
    bool bDoRemoteWrite,
    const FString& PrefixText
)

Write this ConfigFile to the given Filename, constructed the text from the config sections in *this, prepended by the optional PrefixText

Public function Static

bool

 

WriteTempFileThenMove()

Whether to write a temp file then move it to it's destination when saving.

Public function

void

 

WriteToString

(
    FString& InOutText,
    const FString& SimulatedFilename,
    const FString& PrefixText
)

Write this ConfigFile to the given string, constructed the text from the config sections in *this, prepended by the optional PrefixText

Operators

Name Description

Public function Const

bool

 

operator!=

(
    const FConfigFile& Other
)

Public function Const

bool

 

operator==

(
    const FConfigFile& Other
)

Deprecated Functions

Name Description

Public function

void

 

AddDynamicLayerToHeirarchy

(
    const FString& Filename
)

Call AddDynamicLayerToHierarchy. You also may need to call GetConfigFilename to get the right FConfigFile