mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-08 00:59:44 +00:00
Use only section-based ini reading.
This commit is contained in:
parent
7416b9cdb4
commit
f05d3f6e5d
24 changed files with 742 additions and 661 deletions
|
@ -95,34 +95,11 @@ public:
|
|||
// Returns true if key exists in section
|
||||
bool Exists(const std::string& sectionName, const std::string& key) const;
|
||||
|
||||
// TODO: Get rid of these, in favor of the Section ones.
|
||||
void Set(const std::string& sectionName, const std::string& key, const std::string& newValue) {
|
||||
GetOrCreateSection(sectionName)->Set(key, newValue);
|
||||
}
|
||||
void Set(const std::string& sectionName, const std::string& key, int newValue) {
|
||||
GetOrCreateSection(sectionName)->Set(key, newValue);
|
||||
}
|
||||
void Set(const std::string& sectionName, const std::string& key, u32 newValue) {
|
||||
GetOrCreateSection(sectionName)->Set(key, newValue);
|
||||
}
|
||||
void Set(const std::string& sectionName, const std::string& key, bool newValue) {
|
||||
GetOrCreateSection(sectionName)->Set(key, newValue);
|
||||
}
|
||||
void Set(const std::string& sectionName, const std::string& key, const std::vector<std::string>& newValues) {
|
||||
GetOrCreateSection(sectionName)->Set(key, newValues);
|
||||
}
|
||||
|
||||
// TODO: Get rid of these, in favor of the Section ones.
|
||||
bool Get(const std::string& sectionName, const std::string& key, int* value, int defaultValue = 0);
|
||||
bool Get(const std::string& sectionName, const std::string& key, u32* value, u32 defaultValue = 0);
|
||||
bool Get(const std::string& sectionName, const std::string& key, bool* value, bool defaultValue = false);
|
||||
bool Get(const std::string& sectionName, const std::string& key, std::vector<std::string>* values);
|
||||
bool Get(const std::string& sectionName, const std::string& key, std::string* value, const std::string& defaultValue = NULL_STRING);
|
||||
|
||||
template<typename T> bool GetIfExists(const std::string& sectionName, const std::string& key, T value)
|
||||
{
|
||||
if (Exists(sectionName, key))
|
||||
return Get(sectionName, key, value);
|
||||
return GetOrCreateSection(sectionName)->Get(key, value);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue