Use only section-based ini reading.

This commit is contained in:
Lioncash
2014-06-16 01:12:43 -04:00
parent 7416b9cdb4
commit f05d3f6e5d
24 changed files with 742 additions and 661 deletions

View File

@ -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()