From f22af37320d71a4f78b3f5a7138bc00be57fc1a8 Mon Sep 17 00:00:00 2001 From: nakeee Date: Fri, 20 Mar 2009 11:51:22 +0000 Subject: Trying to make gameini support some gl options git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2687 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/IniFile.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'Source/Core/Common/Src/IniFile.cpp') 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::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 &lines) { Section* section = GetOrCreateSection(sectionName); -- cgit v1.2.3