diff options
author | B Stack <bgstack15@gmail.com> | 2020-10-02 14:42:30 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-10-02 14:42:30 -0400 |
commit | 8aaf029ab6046eb8cbe600a548d176c1418bd99a (patch) | |
tree | d8a89392817379e3036c42eedebf33d4fb372dfd /zen/zstring.h | |
parent | Merge branch '11.1' into 'master' (diff) | |
download | FreeFileSync-8aaf029ab6046eb8cbe600a548d176c1418bd99a.tar.gz FreeFileSync-8aaf029ab6046eb8cbe600a548d176c1418bd99a.tar.bz2 FreeFileSync-8aaf029ab6046eb8cbe600a548d176c1418bd99a.zip |
add upstream 11.2
Diffstat (limited to 'zen/zstring.h')
-rw-r--r-- | zen/zstring.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/zen/zstring.h b/zen/zstring.h index 607d3859..09aa43b9 100644 --- a/zen/zstring.h +++ b/zen/zstring.h @@ -33,9 +33,9 @@ Zstring getUpperCase(const Zstring& str); //Windows, Linux: precomposed //macOS: decomposed Zstring getUnicodeNormalForm(const Zstring& str); -// "In fact, Unicode declares that there is an equivalence relationship between decomposed and composed sequences, -// and conformant software should not treat canonically equivalent sequences, whether composed or decomposed or something in between, as different." -// https://www.win.tue.nl/~aeb/linux/uc/nfc_vs_nfd.html +/* "In fact, Unicode declares that there is an equivalence relationship between decomposed and composed sequences, + and conformant software should not treat canonically equivalent sequences, whether composed or decomposed or something in between, as different." + https://www.win.tue.nl/~aeb/linux/uc/nfc_vs_nfd.html */ struct LessUnicodeNormal { bool operator()(const Zstring& lhs, const Zstring& rhs) const { return getUnicodeNormalForm(lhs) < getUnicodeNormalForm(rhs); } }; @@ -55,20 +55,20 @@ struct ZstringNoCase //use as STL container key: avoid needless upper-case conve //------------------------------------------------------------------------------------------ -//Compare *local* file paths: -// Windows: igore case -// Linux: byte-wise comparison -// macOS: ignore case + Unicode normalization forms -int compareNativePath(const Zstring& lhs, const Zstring& rhs); +/* Compare *local* file paths: + Windows: igore case + Linux: byte-wise comparison + macOS: ignore case + Unicode normalization forms */ +std::weak_ordering compareNativePath(const Zstring& lhs, const Zstring& rhs); -inline bool equalNativePath(const Zstring& lhs, const Zstring& rhs) { return compareNativePath(lhs, rhs) == 0; } +inline bool equalNativePath(const Zstring& lhs, const Zstring& rhs) { return std::is_eq(compareNativePath(lhs, rhs)); } -struct LessNativePath { bool operator()(const Zstring& lhs, const Zstring& rhs) const { return compareNativePath(lhs, rhs) < 0; } }; +struct LessNativePath { bool operator()(const Zstring& lhs, const Zstring& rhs) const { return std::is_lt(compareNativePath(lhs, rhs)); } }; //------------------------------------------------------------------------------------------ -int compareNatural(const Zstring& lhs, const Zstring& rhs); +std::weak_ordering compareNatural(const Zstring& lhs, const Zstring& rhs); -struct LessNaturalSort { bool operator()(const Zstring& lhs, const Zstring& rhs) const { return compareNatural(lhs, rhs) < 0; } }; +struct LessNaturalSort { bool operator()(const Zstring& lhs, const Zstring& rhs) const { return std::is_lt(compareNatural(lhs, rhs)); } }; //------------------------------------------------------------------------------------------ |