2017-10-30 16:22:37 +00:00
|
|
|
// Copyright 2016 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2017-10-30 16:22:37 +00:00
|
|
|
|
2021-12-10 02:22:16 +00:00
|
|
|
#include "Common/Config/ConfigInfo.h"
|
|
|
|
|
2017-10-30 17:09:05 +00:00
|
|
|
#include <cstring>
|
2017-10-30 16:22:37 +00:00
|
|
|
|
2017-10-30 17:09:05 +00:00
|
|
|
#include "Common/CommonFuncs.h"
|
2017-10-30 16:22:37 +00:00
|
|
|
|
|
|
|
namespace Config
|
|
|
|
{
|
2020-05-02 12:39:40 +00:00
|
|
|
bool Location::operator==(const Location& other) const
|
2017-10-30 16:22:37 +00:00
|
|
|
{
|
2017-10-30 17:09:05 +00:00
|
|
|
return system == other.system && strcasecmp(section.c_str(), other.section.c_str()) == 0 &&
|
|
|
|
strcasecmp(key.c_str(), other.key.c_str()) == 0;
|
2017-10-30 16:22:37 +00:00
|
|
|
}
|
|
|
|
|
2020-05-02 12:39:40 +00:00
|
|
|
bool Location::operator!=(const Location& other) const
|
2017-10-30 16:22:37 +00:00
|
|
|
{
|
|
|
|
return !(*this == other);
|
|
|
|
}
|
|
|
|
|
2020-05-02 12:39:40 +00:00
|
|
|
bool Location::operator<(const Location& other) const
|
2017-10-30 16:22:37 +00:00
|
|
|
{
|
2017-10-30 17:09:05 +00:00
|
|
|
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;
|
2017-10-30 16:22:37 +00:00
|
|
|
}
|
2019-05-05 23:48:12 +00:00
|
|
|
} // namespace Config
|