diff options
author | B. Stack <bgstack15@gmail.com> | 2024-05-10 11:21:56 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2024-05-10 11:21:56 -0400 |
commit | 7a5f22cfe87f938ef58f92b48ac379dc1c4c81c7 (patch) | |
tree | 3ed84995318afbd82d5d98a2ba044f9ba58b57c6 /zen/utf.h | |
parent | add upstream 13.5 (diff) | |
download | FreeFileSync-7a5f22cfe87f938ef58f92b48ac379dc1c4c81c7.tar.gz FreeFileSync-7a5f22cfe87f938ef58f92b48ac379dc1c4c81c7.tar.bz2 FreeFileSync-7a5f22cfe87f938ef58f92b48ac379dc1c4c81c7.zip |
add upstream 13.613.6
Diffstat (limited to 'zen/utf.h')
-rw-r--r-- | zen/utf.h | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -25,8 +25,8 @@ bool isValidUtf(const UtfString& str); //check for UTF-8 encoding errors template <class UtfString> size_t unicodeLength(const UtfString& str); //return number of code points for UTF-encoded string -template <class UtfString> -UtfString getUnicodeSubstring(const UtfString& str, size_t uniPosFirst, size_t uniPosLast); +template <class UtfStringOut, class UtfStringIn> +UtfStringOut getUnicodeSubstring(const UtfStringIn& str, size_t uniPosFirst, size_t uniPosLast); @@ -310,14 +310,14 @@ size_t unicodeLength(const UtfString& str) //return number of code points (+ cor } -template <class UtfString> inline -UtfString getUnicodeSubstring(const UtfString& str, size_t uniPosFirst, size_t uniPosLast) //return position of unicode char in UTF-encoded string +template <class UtfStringOut, class UtfStringIn> inline +UtfStringOut getUnicodeSubstring(const UtfStringIn& str, size_t uniPosFirst, size_t uniPosLast) //return position of unicode char in UTF-encoded string { assert(uniPosFirst <= uniPosLast && uniPosLast <= unicodeLength(str)); using namespace impl; - using CharType = GetCharTypeT<UtfString>; + using CharType = GetCharTypeT<UtfStringIn>; - UtfString output; + UtfStringOut output; assert(uniPosFirst <= uniPosLast); if (uniPosFirst >= uniPosLast) //optimize for empty range return output; |