mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Trying to make gameini support some gl options
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2687 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -171,6 +171,27 @@ std::string* IniFile::GetLine(Section* section, const char* key, std::string* va
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool IniFile::Exists(const char* sectionName, const char* key)
|
||||
{
|
||||
|
||||
const Section* section = GetSection(sectionName);
|
||||
if (!section)
|
||||
return false;
|
||||
|
||||
for (std::vector<std::string>::const_iterator iter = section->lines.begin(); iter != section->lines.end(); ++iter)
|
||||
{
|
||||
std::string lineKey;
|
||||
ParseLine(*iter, &lineKey, NULL, NULL);
|
||||
|
||||
if (!strcasecmp(lineKey.c_str(), key))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void IniFile::SetLines(const char* sectionName, const std::vector<std::string> &lines)
|
||||
{
|
||||
Section* section = GetOrCreateSection(sectionName);
|
||||
|
@ -57,6 +57,9 @@ public:
|
||||
|
||||
void SetLines(const char* sectionName, const std::vector<std::string> &lines);
|
||||
|
||||
// Returns true if exists key in section
|
||||
bool Exists(const char* sectionName, const char* key);
|
||||
|
||||
// getter should be const
|
||||
bool Get(const char* sectionName, const char* key, std::string* value, const char* defaultValue = "");
|
||||
bool Get(const char* sectionName, const char* key, int* value, int defaultValue = 0);
|
||||
|
Reference in New Issue
Block a user