CARLA
Static Private Member Functions | Private Attributes | List of all members
FIniFile Class Reference

Wrapper around Unreal's INI file. More...

#include <IniFile.h>

+ Inheritance diagram for FIniFile:
+ Collaboration diagram for FIniFile:

Public Member Functions

Constructor
 FIniFile ()=default
 
 FIniFile (const FString &FileName)
 
Other functions
bool Combine (const FString &FileName)
 
void ProcessInputFileContents (const FString &INIFileContents)
 
bool HasSection (const FString &Section) const
 
void AddSectionIfMissing (const FString &Section)
 
bool Write (const FString &Filename)
 Write contents to disk. More...
 
const FConfigFile & GetFConfigFile () const
 Retrieve Unreal's FConfigFile. More...
 
Get functions
template<typename T >
void GetInt (const TCHAR *Section, const TCHAR *Key, T &Target) const
 
void GetString (const TCHAR *Section, const TCHAR *Key, FString &Target) const
 
void GetBool (const TCHAR *Section, const TCHAR *Key, bool &Target) const
 
void GetFloat (const TCHAR *Section, const TCHAR *Key, float &Target, const float Factor=1.0f) const
 
void GetLinearColor (const TCHAR *Section, const TCHAR *Key, FLinearColor &Target) const
 
Set functions
void SetInt (const TCHAR *Section, const TCHAR *Key, const int64 Value)
 
void SetString (const TCHAR *Section, const TCHAR *Key, const TCHAR *Value)
 
void SetString (const TCHAR *Section, const TCHAR *Key, const FString &Value)
 
void SetBool (const TCHAR *Section, const TCHAR *Key, const bool Value)
 
void SetFloat (const TCHAR *Section, const TCHAR *Key, const float Value)
 
void SetLinearColor (const TCHAR *Section, const TCHAR *Key, const FLinearColor &Value)
 

Static Private Member Functions

template<typename TARGET , typename SOURCE >
static void SafeCastTo (SOURCE source, TARGET &target)
 

Private Attributes

FConfigFile ConfigFile
 

Additional Inherited Members

- Private Member Functions inherited from NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
void operator= (const NonCopyable &)=delete
 

Detailed Description

Wrapper around Unreal's INI file.

In get functions, Target value is only set if it was present in the INI file, otherwise it keeps its value.

Definition at line 15 of file IniFile.h.

Constructor & Destructor Documentation

◆ FIniFile() [1/2]

FIniFile::FIniFile ( )
default

◆ FIniFile() [2/2]

FIniFile::FIniFile ( const FString &  FileName)
inlineexplicit

Definition at line 39 of file IniFile.h.

Member Function Documentation

◆ AddSectionIfMissing()

void FIniFile::AddSectionIfMissing ( const FString &  Section)
inline

Definition at line 65 of file IniFile.h.

◆ Combine()

bool FIniFile::Combine ( const FString &  FileName)
inline

Definition at line 50 of file IniFile.h.

◆ GetBool()

void FIniFile::GetBool ( const TCHAR *  Section,
const TCHAR *  Key,
bool &  Target 
) const
inline

Definition at line 107 of file IniFile.h.

Referenced by LoadSettingsFromConfig().

+ Here is the caller graph for this function:

◆ GetFConfigFile()

const FConfigFile& FIniFile::GetFConfigFile ( ) const
inline

Retrieve Unreal's FConfigFile.

Definition at line 79 of file IniFile.h.

◆ GetFloat()

void FIniFile::GetFloat ( const TCHAR *  Section,
const TCHAR *  Key,
float &  Target,
const float  Factor = 1.0f 
) const
inline

Definition at line 115 of file IniFile.h.

◆ GetInt()

template<typename T >
void FIniFile::GetInt ( const TCHAR *  Section,
const TCHAR *  Key,
T &  Target 
) const
inline

Definition at line 91 of file IniFile.h.

Referenced by LoadSettingsFromConfig().

+ Here is the caller graph for this function:

◆ GetLinearColor()

void FIniFile::GetLinearColor ( const TCHAR *  Section,
const TCHAR *  Key,
FLinearColor &  Target 
) const
inline

Definition at line 123 of file IniFile.h.

◆ GetString()

void FIniFile::GetString ( const TCHAR *  Section,
const TCHAR *  Key,
FString &  Target 
) const
inline

Definition at line 99 of file IniFile.h.

Referenced by LoadSettingsFromConfig().

+ Here is the caller graph for this function:

◆ HasSection()

bool FIniFile::HasSection ( const FString &  Section) const
inline

Definition at line 60 of file IniFile.h.

◆ ProcessInputFileContents()

void FIniFile::ProcessInputFileContents ( const FString &  INIFileContents)
inline

Definition at line 55 of file IniFile.h.

Referenced by UCarlaSettings::LoadSettingsFromString().

+ Here is the caller graph for this function:

◆ SafeCastTo()

template<typename TARGET , typename SOURCE >
static void FIniFile::SafeCastTo ( SOURCE  source,
TARGET &  target 
)
inlinestaticprivate

Definition at line 20 of file IniFile.h.

◆ SetBool()

void FIniFile::SetBool ( const TCHAR *  Section,
const TCHAR *  Key,
const bool  Value 
)
inline

Definition at line 152 of file IniFile.h.

◆ SetFloat()

void FIniFile::SetFloat ( const TCHAR *  Section,
const TCHAR *  Key,
const float  Value 
)
inline

Definition at line 157 of file IniFile.h.

◆ SetInt()

void FIniFile::SetInt ( const TCHAR *  Section,
const TCHAR *  Key,
const int64  Value 
)
inline

Definition at line 137 of file IniFile.h.

◆ SetLinearColor()

void FIniFile::SetLinearColor ( const TCHAR *  Section,
const TCHAR *  Key,
const FLinearColor &  Value 
)
inline

Definition at line 162 of file IniFile.h.

◆ SetString() [1/2]

void FIniFile::SetString ( const TCHAR *  Section,
const TCHAR *  Key,
const TCHAR *  Value 
)
inline

Definition at line 142 of file IniFile.h.

◆ SetString() [2/2]

void FIniFile::SetString ( const TCHAR *  Section,
const TCHAR *  Key,
const FString &  Value 
)
inline

Definition at line 147 of file IniFile.h.

◆ Write()

bool FIniFile::Write ( const FString &  Filename)
inline

Write contents to disk.

Definition at line 73 of file IniFile.h.

Member Data Documentation

◆ ConfigFile

FConfigFile FIniFile::ConfigFile
private

Definition at line 171 of file IniFile.h.


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