ConfigInfo.cpp 797 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2016 Dolphin Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "Common/Config/ConfigInfo.h"
  4. #include <cstring>
  5. #include "Common/CommonFuncs.h"
  6. namespace Config
  7. {
  8. bool Location::operator==(const Location& other) const
  9. {
  10. return system == other.system && strcasecmp(section.c_str(), other.section.c_str()) == 0 &&
  11. strcasecmp(key.c_str(), other.key.c_str()) == 0;
  12. }
  13. bool Location::operator<(const Location& other) const
  14. {
  15. if (system != other.system)
  16. return system < other.system;
  17. const int section_compare = strcasecmp(section.c_str(), other.section.c_str());
  18. if (section_compare != 0)
  19. return section_compare < 0;
  20. const int key_compare = strcasecmp(key.c_str(), other.key.c_str());
  21. return key_compare < 0;
  22. }
  23. } // namespace Config