summaryrefslogtreecommitdiff
path: root/zen/zstring.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <shieldwed@outlook.com>2018-12-16 08:01:40 +0000
committerDaniel Wilhelm <shieldwed@outlook.com>2018-12-16 08:01:40 +0000
commit00c412ab7731cb1dfb505485bcbdb87076a046b9 (patch)
tree597a84bf090173bfc5f406e9009263875218707d /zen/zstring.h
parentMerge branch '10.6' into 'master' (diff)
parent10.7 (diff)
downloadFreeFileSync-00c412ab7731cb1dfb505485bcbdb87076a046b9.tar.gz
FreeFileSync-00c412ab7731cb1dfb505485bcbdb87076a046b9.tar.bz2
FreeFileSync-00c412ab7731cb1dfb505485bcbdb87076a046b9.zip
Merge branch '10.7' into 'master'10.7
10.7 See merge request opensource-tracking/FreeFileSync!4
Diffstat (limited to 'zen/zstring.h')
-rwxr-xr-xzen/zstring.h13
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
bgstack15