mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 13:57:57 -07:00
19da101164
Both structs are already in the Config namespace.
36 lines
907 B
C++
36 lines
907 B
C++
// 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 Location::operator==(const Location& 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 Location::operator!=(const Location& other) const
|
|
{
|
|
return !(*this == other);
|
|
}
|
|
|
|
bool Location::operator<(const Location& 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;
|
|
}
|
|
} // namespace Config
|