Class for loading profile (currently for loading ini config file)
More...
#include <profile.h>
|
bool | InitCurrentDirectory () |
|
bool | SaveCurrentDirectory () |
|
bool | SetLocalProfileString (std::string section, std::string key, std::string value) |
|
bool | GetLocalProfileString (std::string section, std::string key, std::string &buffer) |
|
bool | SetLocalProfileInt (std::string section, std::string key, int value) |
|
bool | GetLocalProfileInt (std::string section, std::string key, int &value) |
|
bool | SetLocalProfileFloat (std::string section, std::string key, float value) |
|
bool | GetLocalProfileFloat (std::string section, std::string key, float &value) |
|
std::vector< std::string > | GetLocalProfileSection (std::string section, std::string key) |
|
void | SetUserDir (std::string dir) |
|
std::string | GetUserBasedPath (std::string dir, std::string default_dir) |
|
bool | CopyFileToTemp (std::string filename) |
|
|
static CProfile & | GetInstance () |
|
static CProfile * | GetInstancePointer () |
|
static bool | IsCreated () |
|
static CProfile * | m_instance = nullptr |
|
Class for loading profile (currently for loading ini config file)
bool CProfile::CopyFileToTemp |
( |
std::string |
filename | ) |
|
opy a file into the temporary folder.
- Parameters
-
- Returns
- true on success
bool CProfile::GetLocalProfileFloat |
( |
std::string |
section, |
|
|
std::string |
key, |
|
|
float & |
value |
|
) |
| |
Gets float value in section under specified key
- Parameters
-
- Returns
- return true on success
bool CProfile::GetLocalProfileInt |
( |
std::string |
section, |
|
|
std::string |
key, |
|
|
int & |
value |
|
) |
| |
Gets int value in section under specified key
- Parameters
-
- Returns
- return true on success
std::vector< std::string > CProfile::GetLocalProfileSection |
( |
std::string |
section, |
|
|
std::string |
key |
|
) |
| |
Gets all values in section under specified key
- Parameters
-
- Returns
- vector of values
bool CProfile::GetLocalProfileString |
( |
std::string |
section, |
|
|
std::string |
key, |
|
|
std::string & |
buffer |
|
) |
| |
Gets string value in section under specified key
- Parameters
-
- Returns
- return true on success
std::string CProfile::GetUserBasedPath |
( |
std::string |
dir, |
|
|
std::string |
default_dir |
|
) |
| |
Returns path based on current user. Replaces user% in path with current user dir or uses default_dir param if no user dir is specified
- Parameters
-
- Returns
- path
bool CProfile::InitCurrentDirectory |
( |
| ) |
|
Loads colobot.ini from current directory
- Returns
- return true on success
bool CProfile::SaveCurrentDirectory |
( |
| ) |
|
Saves colobot.ini to current directory
- Returns
- return true on success
bool CProfile::SetLocalProfileFloat |
( |
std::string |
section, |
|
|
std::string |
key, |
|
|
float |
value |
|
) |
| |
Sets float value in section under specified key
- Parameters
-
- Returns
- return true on success
bool CProfile::SetLocalProfileInt |
( |
std::string |
section, |
|
|
std::string |
key, |
|
|
int |
value |
|
) |
| |
Sets int value in section under specified key
- Parameters
-
- Returns
- return true on success
bool CProfile::SetLocalProfileString |
( |
std::string |
section, |
|
|
std::string |
key, |
|
|
std::string |
value |
|
) |
| |
Sets string value in section under specified key
- Parameters
-
- Returns
- return true on success
void CProfile::SetUserDir |
( |
std::string |
dir | ) |
|
Sets current user directory
- Parameters
-
The documentation for this class was generated from the following files:
- /build/buildd/colobot-0.1.3/src/common/profile.h
- /build/buildd/colobot-0.1.3/src/common/profile.cpp