Colobot
Public Member Functions | List of all members
CConfigFile Class Reference

Class for loading config file. More...

#include <config_file.h>

Inheritance diagram for CConfigFile:
Inheritance graph
[legend]

Public Member Functions

void SetUseCurrentDirectory (bool useCurrentDirectory)
 
bool Init ()
 
bool Save ()
 
bool SetStringProperty (std::string section, std::string key, std::string value)
 
bool GetStringProperty (std::string section, std::string key, std::string &value)
 
bool SetIntProperty (std::string section, std::string key, int value)
 
bool SetBoolProperty (std::string section, std::string key, bool value)
 
bool GetIntProperty (std::string section, std::string key, int &value)
 
bool SetFloatProperty (std::string section, std::string key, float value)
 
bool GetFloatProperty (std::string section, std::string key, float &value)
 
bool GetBoolProperty (std::string section, std::string key, bool &value)
 

Additional Inherited Members

- Static Public Member Functions inherited from CSingleton< CConfigFile >
static CConfigFileGetInstance ()
 
static CConfigFileGetInstancePointer ()
 
static bool IsCreated ()
 
- Static Protected Attributes inherited from CSingleton< CConfigFile >
static CConfigFilem_instance = nullptr
 

Detailed Description

Class for loading config file.

Member Function Documentation

bool CConfigFile::GetBoolProperty ( std::string  section,
std::string  key,
bool &  value 
)

Gets bool value in section under specified key value will only be changed if key exists

Returns
return true on success
bool CConfigFile::GetFloatProperty ( std::string  section,
std::string  key,
float &  value 
)

Gets float value in section under specified key value will only be changed if key exists

Returns
return true on success
bool CConfigFile::GetIntProperty ( std::string  section,
std::string  key,
int &  value 
)

Gets int value in section under specified key value will only be changed if key exists

Returns
return true on success
bool CConfigFile::GetStringProperty ( std::string  section,
std::string  key,
std::string &  value 
)

Gets string value in section under specified key

Returns
return true on success
bool CConfigFile::Init ( )

Loads colobot.ini

Returns
return true on success
bool CConfigFile::Save ( )

Saves colobot.ini

Returns
return true on success
bool CConfigFile::SetBoolProperty ( std::string  section,
std::string  key,
bool  value 
)

Sets bool value in section under specified key

Returns
return true on success
bool CConfigFile::SetFloatProperty ( std::string  section,
std::string  key,
float  value 
)

Sets float value in section under specified key value will only be changed if key exists

Returns
return true on success
bool CConfigFile::SetIntProperty ( std::string  section,
std::string  key,
int  value 
)

Sets int value in section under specified key

Returns
return true on success
bool CConfigFile::SetStringProperty ( std::string  section,
std::string  key,
std::string  value 
)

Sets string value in section under specified key

Returns
return true on success
void CConfigFile::SetUseCurrentDirectory ( bool  useCurrentDirectory)

Set flag to force using ini file from current directory


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