summaryrefslogtreecommitdiff
path: root/zen/utf.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-09-07 18:55:24 +0000
committerB. Stack <bgstack15@gmail.com>2022-09-07 18:55:24 +0000
commit1e582c4e99fe08c70c75fef7cd8ed22343253297 (patch)
treeb0047c655d52e4e479ceb73c713414f8d0744c38 /zen/utf.h
parentMerge branch 'b11.24' into 'master' (diff)
parentadd upstream 11.25 (diff)
downloadFreeFileSync-1e582c4e99fe08c70c75fef7cd8ed22343253297.tar.gz
FreeFileSync-1e582c4e99fe08c70c75fef7cd8ed22343253297.tar.bz2
FreeFileSync-1e582c4e99fe08c70c75fef7cd8ed22343253297.zip
Merge branch 'b11.25' into 'master'11.25
add upstream 11.25 See merge request opensource-tracking/FreeFileSync!48
Diffstat (limited to 'zen/utf.h')
-rw-r--r--zen/utf.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/zen/utf.h b/zen/utf.h
index ca231602..56b1ff55 100644
--- a/zen/utf.h
+++ b/zen/utf.h
@@ -222,15 +222,9 @@ private:
//----------------------------------------------------------------------------------------------------------------
-template <class Function> inline void codePointToUtf(CodePoint cp, Function writeOutput, std::integral_constant<int, 1>) { codePointToUtf8 (cp, writeOutput); } //UTF8-char
-template <class Function> inline void codePointToUtf(CodePoint cp, Function writeOutput, std::integral_constant<int, 2>) { codePointToUtf16(cp, writeOutput); } //Windows: UTF16-wchar_t
-template <class Function> inline void codePointToUtf(CodePoint cp, Function writeOutput, std::integral_constant<int, 4>) { writeOutput(cp); } //other OS: UTF32-wchar_t
-
-template <class CharType, class Function> inline
-void codePointToUtf(CodePoint cp, Function writeOutput) //"writeOutput" is a unary function taking a CharType
-{
- return codePointToUtf(cp, writeOutput, std::integral_constant<int, sizeof(CharType)>());
-}
+template <class Function> inline void codePointToUtfImpl(CodePoint cp, Function writeOutput, std::integral_constant<int, 1>) { codePointToUtf8 (cp, writeOutput); } //UTF8-char
+template <class Function> inline void codePointToUtfImpl(CodePoint cp, Function writeOutput, std::integral_constant<int, 2>) { codePointToUtf16(cp, writeOutput); } //Windows: UTF16-wchar_t
+template <class Function> inline void codePointToUtfImpl(CodePoint cp, Function writeOutput, std::integral_constant<int, 4>) { writeOutput(cp); } //other OS: UTF32-wchar_t
//----------------------------------------------------------------------------------------------------------------
@@ -277,9 +271,18 @@ private:
};
}
+
template <class CharType>
using UtfDecoder = impl::UtfDecoderImpl<CharType, sizeof(CharType)>;
+
+template <class CharType, class Function> inline
+void codePointToUtf(impl::CodePoint cp, Function writeOutput) //"writeOutput" is a unary function taking a CharType
+{
+ return impl::codePointToUtfImpl(cp, writeOutput, std::integral_constant<int, sizeof(CharType)>());
+}
+
+
//-------------------------------------------------------------------------------------------
template <class UtfString> inline
bgstack15