From: Jacob Lifshay Date: Thu, 29 Jun 2017 06:01:18 +0000 (-0700) Subject: fix path with string comparison X-Git-Tag: gsoc-2017~81 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=18cde47e1de1282cfa383ce7bec5c3f3e38d1e29;p=kazan.git fix path with string comparison --- 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);