summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/IniFile.cpp
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2010-07-23 05:22:12 +0000
committerJordan Woyak <jordan.woyak@gmail.com>2010-07-23 05:22:12 +0000
commita3e31556787c87fd708dfd4a6a194a5d62a60c59 (patch)
tree36913cbab1c961344ba44f04f4fed399902b3432 /Source/Core/Common/Src/IniFile.cpp
parent2e6c5b36ab895fcdb5d62d3a04ac895d1797bb05 (diff)
Added a button to the "Gecko Codes" panel to download/parse codes from geckocodes.org. Codes that require modifiers (the XXXX business) will still not work properly, though they should load/save fine. A few more code types should work now. (All non-ASM type codes should at least attempt to run :p) Hacked a param into IniFile::GetLines to disable removal of text after # chars, so codes with # in the name/notes should load fine.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5949 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/IniFile.cpp')
-rw-r--r--Source/Core/Common/Src/IniFile.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/Source/Core/Common/Src/IniFile.cpp b/Source/Core/Common/Src/IniFile.cpp
index 325b87278a..85a88bc7fc 100644
--- a/Source/Core/Common/Src/IniFile.cpp
+++ b/Source/Core/Common/Src/IniFile.cpp
@@ -350,7 +350,7 @@ bool IniFile::GetKeys(const char* sectionName, std::vector<std::string>& keys) c
}
// Return a list of all lines in a section
-bool IniFile::GetLines(const char* sectionName, std::vector<std::string>& lines) const
+bool IniFile::GetLines(const char* sectionName, std::vector<std::string>& lines, const bool remove_comments) const
{
const Section* section = GetSection(sectionName);
if (!section)
@@ -360,15 +360,19 @@ bool IniFile::GetLines(const char* sectionName, std::vector<std::string>& lines)
for (std::vector<std::string>::const_iterator iter = section->lines.begin(); iter != section->lines.end(); ++iter)
{
std::string line = StripSpaces(*iter);
- int commentPos = (int)line.find('#');
- if (commentPos == 0)
- {
- continue;
- }
- if (commentPos != (int)std::string::npos)
+ if (remove_comments)
{
- line = StripSpaces(line.substr(0, commentPos));
+ int commentPos = (int)line.find('#');
+ if (commentPos == 0)
+ {
+ continue;
+ }
+
+ if (commentPos != (int)std::string::npos)
+ {
+ line = StripSpaces(line.substr(0, commentPos));
+ }
}
lines.push_back(line);