mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Use only section-based ini reading.
This commit is contained in:
@ -436,61 +436,6 @@ bool IniFile::Save(const std::string& filename)
|
||||
return File::RenameSync(temp, filename);
|
||||
}
|
||||
|
||||
bool IniFile::Get(const std::string& sectionName, const std::string& key, std::vector<std::string>* values)
|
||||
{
|
||||
Section *section = GetSection(sectionName);
|
||||
if (!section)
|
||||
return false;
|
||||
return section->Get(key, values);
|
||||
}
|
||||
|
||||
bool IniFile::Get(const std::string& sectionName, const std::string& key, int* value, int defaultValue)
|
||||
{
|
||||
Section *section = GetSection(sectionName);
|
||||
if (!section) {
|
||||
*value = defaultValue;
|
||||
return false;
|
||||
} else {
|
||||
return section->Get(key, value, defaultValue);
|
||||
}
|
||||
}
|
||||
|
||||
bool IniFile::Get(const std::string& sectionName, const std::string& key, u32* value, u32 defaultValue)
|
||||
{
|
||||
Section *section = GetSection(sectionName);
|
||||
if (!section) {
|
||||
*value = defaultValue;
|
||||
return false;
|
||||
} else {
|
||||
return section->Get(key, value, defaultValue);
|
||||
}
|
||||
}
|
||||
|
||||
bool IniFile::Get(const std::string& sectionName, const std::string& key, bool* value, bool defaultValue)
|
||||
{
|
||||
Section *section = GetSection(sectionName);
|
||||
if (!section) {
|
||||
*value = defaultValue;
|
||||
return false;
|
||||
} else {
|
||||
return section->Get(key, value, defaultValue);
|
||||
}
|
||||
}
|
||||
|
||||
bool IniFile::Get(const std::string& sectionName, const std::string& key, std::string* value, const std::string& defaultValue)
|
||||
{
|
||||
Section* section = GetSection(sectionName);
|
||||
if (!section) {
|
||||
if (&defaultValue != &NULL_STRING) {
|
||||
*value = defaultValue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return section->Get(key, value, defaultValue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Unit test. TODO: Move to the real unit test framework.
|
||||
/*
|
||||
int main()
|
||||
|
Reference in New Issue
Block a user