Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge pull request #6154 from MerryMage/config-cleanup
Cleanup implementation of onion configuration
- Loading branch information
Showing
22 changed files
with
360 additions
and
723 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // Copyright 2017 Dolphin Emulator Project | ||
| // Licensed under GPLv2+ | ||
| // Refer to the license.txt file included. | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <string> | ||
|
|
||
| #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 <typename T> | ||
| struct ConfigInfo | ||
| { | ||
| ConfigLocation location; | ||
| T default_value; | ||
| }; | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.