summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Config/ConfigInfo.cpp
diff options
context:
space:
mode:
authorLeo Lam <leolino.lam@gmail.com>2017-11-17 15:01:56 +0100
committerGitHub <noreply@github.com>2017-11-17 15:01:56 +0100
commit84ca9a4aec0048e5ac01caea8f8be9210eb947f6 (patch)
tree9bc42cfe376101b040527ee254a527f05320a853 /Source/Core/Common/Config/ConfigInfo.cpp
parent1e33fd0d3540e288f124c1c41891a768103f6290 (diff)
parent37419b9a579fbcb1633caa9295a39da405e93904 (diff)
Merge pull request #6154 from MerryMage/config-cleanup
Cleanup implementation of onion configuration
Diffstat (limited to 'Source/Core/Common/Config/ConfigInfo.cpp')
-rw-r--r--Source/Core/Common/Config/ConfigInfo.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/Source/Core/Common/Config/ConfigInfo.cpp b/Source/Core/Common/Config/ConfigInfo.cpp
new file mode 100644
index 0000000000..47d2e25c84
--- /dev/null
+++ b/Source/Core/Common/Config/ConfigInfo.cpp
@@ -0,0 +1,35 @@
+// Copyright 2016 Dolphin Emulator Project
+// Licensed under GPLv2+
+// Refer to the license.txt file included.
+
+#include <cstring>
+
+#include "Common/CommonFuncs.h"
+#include "Common/Config/ConfigInfo.h"
+
+namespace Config
+{
+bool ConfigLocation::operator==(const ConfigLocation& other) const
+{
+ return system == other.system && strcasecmp(section.c_str(), other.section.c_str()) == 0 &&
+ strcasecmp(key.c_str(), other.key.c_str()) == 0;
+}
+
+bool ConfigLocation::operator!=(const ConfigLocation& other) const
+{
+ return !(*this == other);
+}
+
+bool ConfigLocation::operator<(const ConfigLocation& other) const
+{
+ if (system != other.system)
+ return system < other.system;
+
+ const int section_compare = strcasecmp(section.c_str(), other.section.c_str());
+ if (section_compare != 0)
+ return section_compare < 0;
+
+ const int key_compare = strcasecmp(key.c_str(), other.key.c_str());
+ return key_compare < 0;
+}
+}