summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Config/Section.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/Config/Section.cpp')
-rw-r--r--Source/Core/Common/Config/Section.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/Core/Common/Config/Section.cpp b/Source/Core/Common/Config/Section.cpp
index 7db2c557ea..bb9fcef0e3 100644
--- a/Source/Core/Common/Config/Section.cpp
+++ b/Source/Core/Common/Config/Section.cpp
@@ -54,6 +54,11 @@ void Section::Set(const std::string& key, const std::string& value)
}
}
+void Section::Set(const std::string& key, u16 newValue)
+{
+ Section::Set(key, StringFromFormat("0x%04x", newValue));
+}
+
void Section::Set(const std::string& key, u32 newValue)
{
Section::Set(key, StringFromFormat("0x%08x", newValue));
@@ -124,6 +129,18 @@ bool Section::Get(const std::string& key, int* value, int defaultValue) const
return false;
}
+bool Section::Get(const std::string& key, u16* value, u16 defaultValue) const
+{
+ std::string temp;
+ bool retval = Get(key, &temp);
+
+ if (retval && TryParse(temp, value))
+ return true;
+
+ *value = defaultValue;
+ return false;
+}
+
bool Section::Get(const std::string& key, u32* value, u32 defaultValue) const
{
std::string temp;