diff options
author | B Stack <bgstack15@gmail.com> | 2018-12-15 08:58:32 -0500 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2018-12-15 08:58:32 -0500 |
commit | d2c4bc7276ea099ee8fc53ddb918c0f3458b4bb5 (patch) | |
tree | 597a84bf090173bfc5f406e9009263875218707d /zen/zstring.h | |
parent | Merge branch '10.6' into 'master' (diff) | |
download | FreeFileSync-d2c4bc7276ea099ee8fc53ddb918c0f3458b4bb5.tar.gz FreeFileSync-d2c4bc7276ea099ee8fc53ddb918c0f3458b4bb5.tar.bz2 FreeFileSync-d2c4bc7276ea099ee8fc53ddb918c0f3458b4bb5.zip |
10.7
Diffstat (limited to 'zen/zstring.h')
-rwxr-xr-x | zen/zstring.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/zen/zstring.h b/zen/zstring.h index 9fecdce3..a511e4e0 100755 --- a/zen/zstring.h +++ b/zen/zstring.h @@ -32,11 +32,14 @@ Zstring makeUpperCopy(const Zstring& str); //Windows, Linux: precomposed //macOS: decomposed Zstring getUnicodeNormalForm(const Zstring& str); - -Zstring replaceCpyAsciiNoCase(const Zstring& str, const Zstring& oldTerm, const Zstring& newTerm); +// "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 inbetween, as different." +// http://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);} }; +Zstring replaceCpyAsciiNoCase(const Zstring& str, const Zstring& oldTerm, const Zstring& newTerm); + //------------------------------------------------------------------------------------------ inline bool equalNoCase(const Zstring& lhs, const Zstring& rhs) { return makeUpperCopy(lhs) == makeUpperCopy(rhs); } @@ -53,7 +56,7 @@ inline bool operator<(const ZstringNoCase& lhs, const ZstringNoCase& rhs) { retu //Compare *local* file paths: // Windows: igore case // Linux: byte-wise comparison -// macOS: igore case + Unicode normalization forms +// macOS: ignore case + Unicode normalization forms int compareNativePath(const Zstring& lhs, const Zstring& rhs); inline bool equalNativePath(const Zstring& lhs, const Zstring& rhs) { return compareNativePath(lhs, rhs) == 0; } @@ -66,10 +69,6 @@ int compareNatural(const Zstring& lhs, const Zstring& rhs); struct LessNaturalSort { bool operator()(const Zstring& lhs, const Zstring rhs) const { return compareNatural(lhs, rhs) < 0; } }; //------------------------------------------------------------------------------------------ -warn_static("get rid:") -inline bool equalFilePath(const Zstring& lhs, const Zstring& rhs) { return compareNativePath(lhs, rhs) == 0; } -//------------------------------------------------------------------------------------------ - inline |