summaryrefslogtreecommitdiffstats
path: root/src/common/profile.cpp
diff options
context:
space:
mode:
authorerihel <erihel@gmail.com>2012-08-12 15:00:37 +0200
committererihel <erihel@gmail.com>2012-08-12 15:00:37 +0200
commit5e271e550dbb88f0bbea5f46aad9f0fd1d750eb3 (patch)
treed0e4c7bb68a6b07019574b5621fb086e8a07557c /src/common/profile.cpp
parent9946459c0cd65c3b66719a2aefc42c7ab2a29c04 (diff)
downloadcolobot-5e271e550dbb88f0bbea5f46aad9f0fd1d750eb3.tar.gz
colobot-5e271e550dbb88f0bbea5f46aad9f0fd1d750eb3.tar.bz2
colobot-5e271e550dbb88f0bbea5f46aad9f0fd1d750eb3.zip
* New CPluginManager class for managing plugins based on colobot.ini
* Moved sound plugin into sound dir * Minor changes in logger and profile
Diffstat (limited to 'src/common/profile.cpp')
-rw-r--r--src/common/profile.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/common/profile.cpp b/src/common/profile.cpp
index 467e991..29a68e1 100644
--- a/src/common/profile.cpp
+++ b/src/common/profile.cpp
@@ -27,6 +27,7 @@ CProfile::CProfile()
{
m_ini = new CSimpleIniA();
m_ini->SetUnicode();
+ m_ini->SetMultiKey();
}
@@ -39,8 +40,8 @@ CProfile::~CProfile()
bool CProfile::InitCurrentDirectory()
{
- m_ini->LoadFile("colobot.ini");
- return true;
+ bool result = m_ini->LoadFile("colobot.ini") == SI_OK;
+ return result;
}
@@ -86,3 +87,19 @@ bool CProfile::GetLocalProfileFloat(std::string section, std::string key, float
value = m_ini->GetDoubleValue(section.c_str(), key.c_str(), 0.0d);
return true;
}
+
+
+std::vector< std::string > CProfile::GetLocalProfileSection(std::string section, std::string key)
+{
+ std::vector< std::string > ret_list;
+
+ CSimpleIniA::TNamesDepend values;
+ m_ini->GetAllValues(section.c_str(), key.c_str(), values);
+ values.sort(CSimpleIniA::Entry::LoadOrder());
+
+ for (auto item : values) {
+ ret_list.push_back(item.pItem);
+ }
+
+ return ret_list;
+}