diff --git a/Source/Core/Common/CMakeLists.txt b/Source/Core/Common/CMakeLists.txt index 91eca8f2ae..5e5a220df7 100644 --- a/Source/Core/Common/CMakeLists.txt +++ b/Source/Core/Common/CMakeLists.txt @@ -4,6 +4,7 @@ set(SRCS ColorUtil.cpp CommonFuncs.cpp Config/Config.cpp + Config/ConfigInfo.cpp Config/Layer.cpp Config/Section.cpp Crypto/AES.cpp @@ -29,8 +30,8 @@ set(SRCS PcapFile.cpp PerformanceCounter.cpp Profiler.cpp - SettingsHandler.cpp SDCardUtil.cpp + SettingsHandler.cpp StringUtil.cpp SymbolDB.cpp SysConf.cpp diff --git a/Source/Core/Common/Config/Config.cpp b/Source/Core/Common/Config/Config.cpp index eb763c3632..abb2304749 100644 --- a/Source/Core/Common/Config/Config.cpp +++ b/Source/Core/Common/Config/Config.cpp @@ -126,21 +126,6 @@ const std::string& GetLayerName(LayerType layer) return layer_to_name.at(layer); } -bool ConfigLocation::operator==(const ConfigLocation& other) const -{ - return std::tie(system, section, key) == std::tie(other.system, other.section, other.key); -} - -bool ConfigLocation::operator!=(const ConfigLocation& other) const -{ - return !(*this == other); -} - -bool ConfigLocation::operator<(const ConfigLocation& other) const -{ - return std::tie(system, section, key) < std::tie(other.system, other.section, other.key); -} - LayerType GetActiveLayerForConfig(const ConfigLocation& config) { for (auto layer : SEARCH_ORDER) diff --git a/Source/Core/Common/Config/Config.h b/Source/Core/Common/Config/Config.h index 454fa3585e..69eac72203 100644 --- a/Source/Core/Common/Config/Config.h +++ b/Source/Core/Common/Config/Config.h @@ -9,30 +9,13 @@ #include #include +#include "Common/Config/ConfigInfo.h" #include "Common/Config/Enums.h" #include "Common/Config/Layer.h" #include "Common/Config/Section.h" namespace Config { -struct ConfigLocation -{ - System system; - std::string section; - std::string key; - - bool operator==(const ConfigLocation& other) const; - bool operator!=(const ConfigLocation& other) const; - bool operator<(const ConfigLocation& other) const; -}; - -template -struct ConfigInfo -{ - ConfigLocation location; - T default_value; -}; - using Layers = std::map>; using ConfigChangedCallback = std::function; diff --git a/Source/Core/Common/Config/ConfigInfo.cpp b/Source/Core/Common/Config/ConfigInfo.cpp new file mode 100644 index 0000000000..cc34a2d9f0 --- /dev/null +++ b/Source/Core/Common/Config/ConfigInfo.cpp @@ -0,0 +1,25 @@ +// Copyright 2016 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#include + +#include "Common/Config/ConfigInfo.h" + +namespace Config +{ +bool ConfigLocation::operator==(const ConfigLocation& other) const +{ + return std::tie(system, section, key) == std::tie(other.system, other.section, other.key); +} + +bool ConfigLocation::operator!=(const ConfigLocation& other) const +{ + return !(*this == other); +} + +bool ConfigLocation::operator<(const ConfigLocation& other) const +{ + return std::tie(system, section, key) < std::tie(other.system, other.section, other.key); +} +} diff --git a/Source/Core/Common/Config/ConfigInfo.h b/Source/Core/Common/Config/ConfigInfo.h new file mode 100644 index 0000000000..fc36ecee03 --- /dev/null +++ b/Source/Core/Common/Config/ConfigInfo.h @@ -0,0 +1,30 @@ +// Copyright 2017 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#pragma once + +#include + +#include "Common/Config/Enums.h" + +namespace Config +{ +struct ConfigLocation +{ + System system; + std::string section; + std::string key; + + bool operator==(const ConfigLocation& other) const; + bool operator!=(const ConfigLocation& other) const; + bool operator<(const ConfigLocation& other) const; +}; + +template +struct ConfigInfo +{ + ConfigLocation location; + T default_value; +}; +}