From 18cde47e1de1282cfa383ce7bec5c3f3e38d1e29 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Wed, 28 Jun 2017 23:01:18 -0700 Subject: [PATCH] fix path with string comparison --- src/util/CMakeLists.txt | 2 +- src/util/filesystem.h | 96 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-) diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 43d6a8a..b27d6bf 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -33,4 +33,4 @@ set(sources bit_intrinsics.cpp variant.cpp void_t.cpp) add_library(util STATIC ${sources}) -add_executable(util_test ${sources} util_test.cpp) +add_executable(util_test EXCLUDE_FROM_ALL ${sources} util_test.cpp) diff --git a/src/util/filesystem.h b/src/util/filesystem.h index f268755..070c2f9 100644 --- a/src/util/filesystem.h +++ b/src/util/filesystem.h @@ -1776,6 +1776,102 @@ public: { return r.compare(l) < 0; } + friend bool operator==(const basic_path &l, string_type r) noexcept + { + return l.compare(r) == 0; + } + friend bool operator!=(const basic_path &l, string_type r) noexcept + { + return l.compare(r) != 0; + } + friend bool operator<=(const basic_path &l, string_type r) noexcept + { + return l.compare(r) <= 0; + } + friend bool operator>=(const basic_path &l, string_type r) noexcept + { + return l.compare(r) >= 0; + } + friend bool operator<(const basic_path &l, string_type r) noexcept + { + return l.compare(r) < 0; + } + friend bool operator>(const basic_path &l, string_type r) noexcept + { + return l.compare(r) > 0; + } + friend bool operator==(string_type l, const basic_path &r) noexcept + { + return r.compare(l) == 0; + } + friend bool operator!=(string_type l, const basic_path &r) noexcept + { + return r.compare(l) != 0; + } + friend bool operator<=(string_type l, const basic_path &r) noexcept + { + return r.compare(l) >= 0; + } + friend bool operator>=(string_type l, const basic_path &r) noexcept + { + return r.compare(l) <= 0; + } + friend bool operator<(string_type l, const basic_path &r) noexcept + { + return r.compare(l) > 0; + } + friend bool operator>(string_type l, const basic_path &r) noexcept + { + return r.compare(l) < 0; + } + friend bool operator==(const basic_path &l, const Char_type *r) noexcept + { + return l.compare(r) == 0; + } + friend bool operator!=(const basic_path &l, const Char_type *r) noexcept + { + return l.compare(r) != 0; + } + friend bool operator<=(const basic_path &l, const Char_type *r) noexcept + { + return l.compare(r) <= 0; + } + friend bool operator>=(const basic_path &l, const Char_type *r) noexcept + { + return l.compare(r) >= 0; + } + friend bool operator<(const basic_path &l, const Char_type *r) noexcept + { + return l.compare(r) < 0; + } + friend bool operator>(const basic_path &l, const Char_type *r) noexcept + { + return l.compare(r) > 0; + } + friend bool operator==(const Char_type *l, const basic_path &r) noexcept + { + return r.compare(l) == 0; + } + friend bool operator!=(const Char_type *l, const basic_path &r) noexcept + { + return r.compare(l) != 0; + } + friend bool operator<=(const Char_type *l, const basic_path &r) noexcept + { + return r.compare(l) >= 0; + } + friend bool operator>=(const Char_type *l, const basic_path &r) noexcept + { + return r.compare(l) <= 0; + } + friend bool operator<(const Char_type *l, const basic_path &r) noexcept + { + return r.compare(l) > 0; + } + friend bool operator>(const Char_type *l, const basic_path &r) noexcept + { + return r.compare(l) < 0; + } iterator begin() const noexcept { return iterator(this, 0); -- 2.30.2