Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
CProfile Class Reference

Class for loading profile (currently for loading ini config file) More...

#include <profile.h>

Inheritance diagram for CProfile:
Inheritance graph
[legend]

Public Member Functions

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)
 

Additional Inherited Members

- Static Public Member Functions inherited from CSingleton< CProfile >
static CProfileGetInstance ()
 
static CProfileGetInstancePointer ()
 
static bool IsCreated ()
 
- Static Protected Attributes inherited from CSingleton< CProfile >
static CProfilem_instance = nullptr
 

Detailed Description

Class for loading profile (currently for loading ini config file)

Member Function Documentation

bool CProfile::CopyFileToTemp ( std::string  filename)

opy a file into the temporary folder.

Parameters
filename
Returns
true on success
bool CProfile::GetLocalProfileFloat ( std::string  section,
std::string  key,
float &  value 
)

Gets float value in section under specified key

Parameters
section
key
value
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
section
key
value
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
section
key
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
section
key
buffer
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
dir
default_dir
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
section
key
value
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
section
key
value
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
section
key
value
Returns
return true on success
void CProfile::SetUserDir ( std::string  dir)

Sets current user directory

Parameters
dir

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