diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2018-06-03 14:18:58 +0200 |
|---|---|---|
| committer | Léo Lam <leo@innovatetechnologi.es> | 2018-06-03 14:53:56 +0200 |
| commit | cba32b12e77c8f023ca5efeda7c386b856ad3f47 (patch) | |
| tree | a3ef6f9f07fc85c4d5cc66ff3c2f6403c978baa5 /Source/Core/Common/IniFile.cpp | |
| parent | fc0193c4b108d9a914b841829b1c0f0306b609b9 (diff) | |
IniFile: Use templates for Set()
Diffstat (limited to 'Source/Core/Common/IniFile.cpp')
| -rw-r--r-- | Source/Core/Common/IniFile.cpp | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/Source/Core/Common/IniFile.cpp b/Source/Core/Common/IniFile.cpp index d28092261c..d24149b6da 100644 --- a/Source/Core/Common/IniFile.cpp +++ b/Source/Core/Common/IniFile.cpp @@ -57,55 +57,11 @@ void IniFile::Section::Set(const std::string& key, const std::string& newValue) } } -void IniFile::Section::Set(const std::string& key, const std::string& newValue, - const std::string& defaultValue) -{ - if (newValue != defaultValue) - Set(key, newValue); - else - Delete(key); -} - void IniFile::Section::Set(const std::string& key, const std::vector<std::string>& newValues) { Set(key, JoinStrings(newValues, ",")); } -void IniFile::Section::Set(const std::string& key, u32 newValue) -{ - Set(key, StringFromFormat("0x%08x", newValue)); -} - -void IniFile::Section::Set(const std::string& key, u64 new_value) -{ - Set(key, StringFromFormat("0x%016" PRIx64, new_value)); -} - -void IniFile::Section::Set(const std::string& key, float newValue) -{ - Set(key, StringFromFormat("%#.9g", newValue)); -} - -void IniFile::Section::Set(const std::string& key, double newValue) -{ - Set(key, StringFromFormat("%#.17g", newValue)); -} - -void IniFile::Section::Set(const std::string& key, int newValue) -{ - Set(key, std::to_string(newValue)); -} - -void IniFile::Section::Set(const std::string& key, s64 newValue) -{ - Set(key, StringFromFormat("%" PRId64, newValue)); -} - -void IniFile::Section::Set(const std::string& key, bool newValue) -{ - Set(key, ValueToString(newValue)); -} - bool IniFile::Section::Get(const std::string& key, std::string* value, const std::string& defaultValue) const { |
