Fling Engine  0.00.1
Fling Engine is a game engine written in Vulkan
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes
Fling::FlingConfig Class Reference

Provide simple access to engine configuration options from an INI file #TODO Parse command line options as well. More...

#include <FlingConfig.h>

Inherits Fling::Singleton< FlingConfig >.

Public Member Functions

virtual void Init () override
 
virtual void Shutdown () override
 
bool LoadConfigFile (const std::string &t_File)
 Attempt to load a config file (.ini) for the engine. More...
 
UINT32 LoadCommandLineOpts (int argc, char *argv[])
 Load in the command line options and store them somewhere that is globally accessible. More...
 

Static Public Member Functions

static std::string GetString (const std::string &t_Section, const std::string &t_Key)
 
static int GetInt (const std::string &t_Section, const std::string &t_Key, const int t_DefaultVal=-1)
 
static bool GetBool (const std::string &t_Section, const std::string &t_Key, const bool t_DefaultVal=false)
 
static float GetFloat (const std::string &t_Section, const std::string &t_Key, const float t_DefaultVal=0.0f)
 
static double GetDouble (const std::string &t_Section, const std::string &t_Key, const double t_DefaultVal=0.0)
 
- Static Public Member Functions inherited from Fling::Singleton< FlingConfig >
static FlingConfigGet ()
 

Private Member Functions

std::string GetStringImpl (const std::string &t_Section, const std::string &t_Key) const
 
int GetIntImpl (const std::string &t_Section, const std::string &t_Key, const int t_DefaultVal=-1) const
 
bool GetBoolImpl (const std::string &t_Section, const std::string &t_Key, const bool t_DefaultVal=false) const
 
float GetFloatImpl (const std::string &t_Section, const std::string &t_Key, const float t_DefaultVal=0.0f) const
 
double GetDoubleImpl (const std::string &t_Section, const std::string &t_Key, const double t_DefaultVal=0.0) const
 

Static Private Attributes

static INIReader m_IniReader
 Ini config file reader. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Fling::Singleton< FlingConfig >
 Singleton ()=default
 Every singleton must have a default constructor so that explicit creation and destruction of them is maintained. More...
 

Detailed Description

Provide simple access to engine configuration options from an INI file #TODO Parse command line options as well.

Member Function Documentation

◆ GetBool()

static bool Fling::FlingConfig::GetBool ( const std::string &  t_Section,
const std::string &  t_Key,
const bool  t_DefaultVal = false 
)
inlinestatic

◆ GetBoolImpl()

bool Fling::FlingConfig::GetBoolImpl ( const std::string &  t_Section,
const std::string &  t_Key,
const bool  t_DefaultVal = false 
) const
private

◆ GetDouble()

static double Fling::FlingConfig::GetDouble ( const std::string &  t_Section,
const std::string &  t_Key,
const double  t_DefaultVal = 0.0 
)
inlinestatic

◆ GetDoubleImpl()

double Fling::FlingConfig::GetDoubleImpl ( const std::string &  t_Section,
const std::string &  t_Key,
const double  t_DefaultVal = 0.0 
) const
private

◆ GetFloat()

static float Fling::FlingConfig::GetFloat ( const std::string &  t_Section,
const std::string &  t_Key,
const float  t_DefaultVal = 0.0f 
)
inlinestatic

◆ GetFloatImpl()

float Fling::FlingConfig::GetFloatImpl ( const std::string &  t_Section,
const std::string &  t_Key,
const float  t_DefaultVal = 0.0f 
) const
private

◆ GetInt()

static int Fling::FlingConfig::GetInt ( const std::string &  t_Section,
const std::string &  t_Key,
const int  t_DefaultVal = -1 
)
inlinestatic

◆ GetIntImpl()

int Fling::FlingConfig::GetIntImpl ( const std::string &  t_Section,
const std::string &  t_Key,
const int  t_DefaultVal = -1 
) const
private

◆ GetString()

static std::string Fling::FlingConfig::GetString ( const std::string &  t_Section,
const std::string &  t_Key 
)
inlinestatic

◆ GetStringImpl()

std::string Fling::FlingConfig::GetStringImpl ( const std::string &  t_Section,
const std::string &  t_Key 
) const
private

◆ Init()

void Fling::FlingConfig::Init ( )
overridevirtual

Reimplemented from Fling::Singleton< FlingConfig >.

◆ LoadCommandLineOpts()

UINT32 Fling::FlingConfig::LoadCommandLineOpts ( int  argc,
char *  argv[] 
)

Load in the command line options and store them somewhere that is globally accessible.

Parameters
argcArgument count
argvCommand line args
Returns
Number of options loaded

◆ LoadConfigFile()

bool Fling::FlingConfig::LoadConfigFile ( const std::string &  t_File)

Attempt to load a config file (.ini) for the engine.

Parameters
t_FileFile path to the config file
Returns
True if file was read successfully

◆ Shutdown()

void Fling::FlingConfig::Shutdown ( )
overridevirtual

Reimplemented from Fling::Singleton< FlingConfig >.

Field Documentation

◆ m_IniReader

INIReader Fling::FlingConfig::m_IniReader
staticprivate

Ini config file reader.


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