diff options
| author | hrydgard <hrydgard@gmail.com> | 2008-11-23 12:59:10 +0000 |
|---|---|---|
| committer | hrydgard <hrydgard@gmail.com> | 2008-11-23 12:59:10 +0000 |
| commit | f87c709aa920e9dd2d4dcce4ab53beb3835e0b31 (patch) | |
| tree | d721390ba009ca7fb5396ef352a1221ab99494ae /Source/Core/Common | |
| parent | e2345ba34045be672bdbf2e468857b5ad3f652d7 (diff) | |
Added speed hack engine (way to make block take more cycles). Added example speed hack for Metroid Prime 2 PAL. (Speedhacking is only useful on games with really stupid idle loops, like the Metroids).
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1271 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/Src/IniFile.cpp | 27 | ||||
| -rw-r--r-- | Source/Core/Common/Src/IniFile.h | 7 |
2 files changed, 18 insertions, 16 deletions
diff --git a/Source/Core/Common/Src/IniFile.cpp b/Source/Core/Common/Src/IniFile.cpp index dc3f8095dd..27114e6d3c 100644 --- a/Source/Core/Common/Src/IniFile.cpp +++ b/Source/Core/Common/Src/IniFile.cpp @@ -51,21 +51,22 @@ Section::Section(const Section& other) lines = other.lines;
}
+const Section* IniFile::GetSection(const char* sectionName) const
+{
+ for (std::vector<Section>::const_iterator iter = sections.begin(); iter != sections.end(); ++iter)
+ if (!strcmp(iter->name.c_str(), sectionName))
+ return (&(*iter));
+ return 0;
+}
Section* IniFile::GetSection(const char* sectionName)
{
for (std::vector<Section>::iterator iter = sections.begin(); iter != sections.end(); ++iter)
- {
if (!strcmp(iter->name.c_str(), sectionName))
- {
- return(&(*iter));
- }
- }
-
- return(0);
+ return (&(*iter));
+ return 0;
}
-
Section* IniFile::GetOrCreateSection(const char* sectionName)
{
Section* section = GetSection(sectionName);
@@ -102,7 +103,7 @@ bool IniFile::DeleteSection(const char* sectionName) }
-void IniFile::ParseLine(const std::string& line, std::string* keyOut, std::string* valueOut, std::string* commentOut)
+void IniFile::ParseLine(const std::string& line, std::string* keyOut, std::string* valueOut, std::string* commentOut) const
{
// allow many types of commenting
// These MUST be signed! Do not change to size_t
@@ -390,9 +391,9 @@ bool IniFile::Save(const char* filename) }
-bool IniFile::GetKeys(const char* sectionName, std::vector<std::string>& keys)
+bool IniFile::GetKeys(const char* sectionName, std::vector<std::string>& keys) const
{
- Section* section = GetSection(sectionName);
+ const Section* section = GetSection(sectionName);
if (!section)
{
@@ -412,9 +413,9 @@ bool IniFile::GetKeys(const char* sectionName, std::vector<std::string>& keys) }
-bool IniFile::GetLines(const char* sectionName, std::vector<std::string>& lines)
+bool IniFile::GetLines(const char* sectionName, std::vector<std::string>& lines) const
{
- Section* section = GetSection(sectionName);
+ const Section* section = GetSection(sectionName);
if (!section)
return false;
diff --git a/Source/Core/Common/Src/IniFile.h b/Source/Core/Common/Src/IniFile.h index de4c5836d0..9614bf8b46 100644 --- a/Source/Core/Common/Src/IniFile.h +++ b/Source/Core/Common/Src/IniFile.h @@ -64,20 +64,21 @@ public: bool Get(const char* sectionName, const char* key, bool* value, bool defaultValue = false);
bool Get(const char* sectionName, const char* key, std::vector<std::string>& values);
- bool GetKeys(const char* sectionName, std::vector<std::string>& keys);
- bool GetLines(const char* sectionName, std::vector<std::string>& lines);
+ bool GetKeys(const char* sectionName, std::vector<std::string>& keys) const;
+ bool GetLines(const char* sectionName, std::vector<std::string>& lines) const;
bool DeleteKey(const char* sectionName, const char* key);
bool DeleteSection(const char* sectionName);
void SortSections();
- void ParseLine(const std::string& line, std::string* keyOut, std::string* valueOut, std::string* commentOut);
+ void ParseLine(const std::string& line, std::string* keyOut, std::string* valueOut, std::string* commentOut) const;
std::string* GetLine(Section* section, const char* key, std::string* valueOut, std::string* commentOut);
private:
std::vector<Section>sections;
+ const Section* GetSection(const char* section) const;
Section* GetSection(const char* section);
Section* GetOrCreateSection(const char* section);
std::string* GetLine(const char* section, const char* key);
|
