diff options
| author | dapetcu21 <dapetcu21@gmail.com> | 2010-07-19 10:36:30 +0000 |
|---|---|---|
| committer | dapetcu21 <dapetcu21@gmail.com> | 2010-07-19 10:36:30 +0000 |
| commit | 9074df896a18d288632a2e45bbee2d5f70c0d773 (patch) | |
| tree | 8f48f937eea15ecd69f8a09d16cf8f734a5d5634 /Source/Core/Common | |
| parent | a2b1f829cb1064ff57ee0a3f6d41a7fd1b672dab (diff) | |
UDPWii: Broadcasting it's presence on IPv4 to 255.255.255.255 once every 1.5 seconds. 3-arg Set()-s only worked on strings and doubles :P . Added int and bool variants.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5916 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/Src/IniFile.cpp | 16 | ||||
| -rw-r--r-- | Source/Core/Common/Src/IniFile.h | 4 |
2 files changed, 20 insertions, 0 deletions
diff --git a/Source/Core/Common/Src/IniFile.cpp b/Source/Core/Common/Src/IniFile.cpp index 244d06a161..325b87278a 100644 --- a/Source/Core/Common/Src/IniFile.cpp +++ b/Source/Core/Common/Src/IniFile.cpp @@ -119,6 +119,22 @@ void IniFile::Section::Set(const char* key, const float newValue, const float de Delete(key); } +void IniFile::Section::Set(const char* key, int newValue, int defaultValue) +{ + if (newValue != defaultValue) + Set(key, newValue); + else + Delete(key); +} + +void IniFile::Section::Set(const char* key, bool newValue, bool defaultValue) +{ + if (newValue != defaultValue) + Set(key, newValue); + else + Delete(key); +} + void IniFile::Section::Set(const char* key, const std::vector<std::string>& newValues) { std::string temp; diff --git a/Source/Core/Common/Src/IniFile.h b/Source/Core/Common/Src/IniFile.h index 1b214edf86..05eff76cdd 100644 --- a/Source/Core/Common/Src/IniFile.h +++ b/Source/Core/Common/Src/IniFile.h @@ -56,9 +56,13 @@ public: void Set(const char* key, double newValue) { Set(key, StringFromFormat("%f", newValue).c_str()); } + + void Set(const char* key, int newValue, int defaultValue); void Set(const char* key, int newValue) { Set(key, StringFromInt(newValue).c_str()); } + + void Set(const char* key, bool newValue, bool defaultValue); void Set(const char* key, bool newValue) { Set(key, StringFromBool(newValue).c_str()); } |
