diff options
| author | nakeee <nakeee@gmail.com> | 2009-03-20 11:51:22 +0000 |
|---|---|---|
| committer | nakeee <nakeee@gmail.com> | 2009-03-20 11:51:22 +0000 |
| commit | f22af37320d71a4f78b3f5a7138bc00be57fc1a8 (patch) | |
| tree | b2a6e517ff5462566f3995dcc6da197b4d060415 /Source/Core/Common/Src/IniFile.cpp | |
| parent | eff7b1aa14c02017fb92ad05028d8ba06a40a3f4 (diff) | |
Trying to make gameini support some gl options
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2687 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/IniFile.cpp')
| -rw-r--r-- | Source/Core/Common/Src/IniFile.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/Core/Common/Src/IniFile.cpp b/Source/Core/Common/Src/IniFile.cpp index 121736fe1a..7c39cb2200 100644 --- a/Source/Core/Common/Src/IniFile.cpp +++ b/Source/Core/Common/Src/IniFile.cpp @@ -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); |
