diff options
author | B Stack <bgstack15@gmail.com> | 2020-10-03 01:04:14 +0000 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-10-03 01:04:14 +0000 |
commit | 0576c1a2ab5ff534348c879ea03bb9c9d9f7ac4c (patch) | |
tree | d8a89392817379e3036c42eedebf33d4fb372dfd /zen/zstring.h | |
parent | Merge branch '11.1' into 'master' (diff) | |
parent | add upstream 11.2 (diff) | |
download | FreeFileSync-0576c1a2ab5ff534348c879ea03bb9c9d9f7ac4c.tar.gz FreeFileSync-0576c1a2ab5ff534348c879ea03bb9c9d9f7ac4c.tar.bz2 FreeFileSync-0576c1a2ab5ff534348c879ea03bb9c9d9f7ac4c.zip |
Merge branch '11.2' into 'master'11.2
add upstream 11.2
See merge request opensource-tracking/FreeFileSync!26
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)); } }; //------------------------------------------------------------------------------------------ |