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