From 4ef8f5a884dab3398f73ea473c2811acaa28da58 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Mon, 15 Mar 2021 20:09:23 +0100 Subject: [PATCH] template changed to template --- utf8/utf8.h | 24 ++++++++++++------------ utf8/utf8_private.h | 4 ++-- utf8/utf8_templates.h | 24 ++++++++++++------------ 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/utf8/utf8.h b/utf8/utf8.h index 2cd5b72..a8c0362 100644 --- a/utf8/utf8.h +++ b/utf8/utf8.h @@ -92,17 +92,17 @@ bool UTF8ToWide(const char * utf8, std::wstring & res, bool cle bool UTF8ToWide(const std::string & utf8, std::wstring & res, bool clear = true, int mode = 1); bool UTF8ToWide(std::istream & utf8, std::wstring & res, bool clear = true, int mode = 1); -template -bool UTF8ToWide(const char * utf8, size_t utf8_len, TextStreamBase & res, bool clear = true, int mode = 1); // need to be tested +template +bool UTF8ToWide(const char * utf8, size_t utf8_len, StreamType & res, bool clear = true, int mode = 1); // need to be tested -template -bool UTF8ToWide(const char * utf8, TextStreamBase & res, bool clear = true, int mode = 1); // need to be tested +template +bool UTF8ToWide(const char * utf8, StreamType & res, bool clear = true, int mode = 1); // need to be tested -template -bool UTF8ToWide(const std::string & utf8, TextStreamBase & res, bool clear = true, int mode = 1); // need to be tested +template +bool UTF8ToWide(const std::string & utf8, StreamType & res, bool clear = true, int mode = 1); // need to be tested -template -bool UTF8ToWide(std::istream & utf8, TextStreamBase & res, bool clear = true, int mode = 1); // need to be tested +template +bool UTF8ToWide(std::istream & utf8, StreamType & res, bool clear = true, int mode = 1); // need to be tested @@ -156,11 +156,11 @@ bool WideToUTF8(const wchar_t * wide_string, char * utf8, siz bool WideToUTF8(const std::wstring & wide_string, char * utf8, size_t utf8_len, int mode = 1); // implement template -template -void WideToUTF8(TextStreamBase & buffer, std::string & utf8, bool clear = true, int mode = 1); // not tested +template +void WideStreamToUTF8(StreamType & buffer, std::string & utf8, bool clear = true, int mode = 1); // not tested -template -void WideToUTF8(TextStreamBase & buffer, std::ostream & utf8, int mode = 1); // not tested +template +void WideStreamToUTF8(StreamTypeIn & buffer, StreamTypeOut & utf8, int mode = 1); // not tested diff --git a/utf8/utf8_private.h b/utf8/utf8_private.h index d28e525..909d834 100644 --- a/utf8/utf8_private.h +++ b/utf8/utf8_private.h @@ -162,8 +162,8 @@ return !was_error; -template -void IntToWide(int c, TextStreamBase & res) +template +void IntToWide(int c, StreamType & res) { if( sizeof(wchar_t)==2 && c>0xffff ) { diff --git a/utf8/utf8_templates.h b/utf8/utf8_templates.h index bbf9ceb..7acde96 100644 --- a/utf8/utf8_templates.h +++ b/utf8/utf8_templates.h @@ -52,8 +52,8 @@ namespace PT (need to be tested) */ // need to be tested -template -bool UTF8ToWide(const char * utf8, size_t utf8_len, TextStreamBase & res, bool clear, int mode) +template +bool UTF8ToWide(const char * utf8, size_t utf8_len, StreamType & res, bool clear, int mode) { if( clear ) res.clear(); @@ -68,8 +68,8 @@ bool UTF8ToWide(const char * utf8, size_t utf8_len, TextStreamBase -bool UTF8ToWide(const char * utf8, TextStreamBase & res, bool clear, int mode) +template +bool UTF8ToWide(const char * utf8, StreamType & res, bool clear, int mode) { size_t utf8_len = 0; @@ -81,8 +81,8 @@ return UTF8ToWide(utf8, utf8_len, res, clear, mode); -template -bool UTF8ToWide(const std::string & utf8, TextStreamBase & res, bool clear, int mode) +template +bool UTF8ToWide(const std::string & utf8, StreamType & res, bool clear, int mode) { return UTF8ToWide(utf8.c_str(), utf8.size(), res, clear, mode); } @@ -90,8 +90,8 @@ bool UTF8ToWide(const std::string & utf8, TextStreamBase -bool UTF8ToWide(std::istream & utf8, TextStreamBase & res, bool clear, int mode) +template +bool UTF8ToWide(std::istream & utf8, StreamType & res, bool clear, int mode) { int z; bool correct, was_error = false; @@ -238,8 +238,8 @@ bool WideToUTF8(const std::wstring & wide_string, StreamType & utf8, int mode) -template -void WideToUTF8(TextStreamBase & buffer, std::string & utf8, bool clear, int mode) +template +void WideStreamToUTF8(StreamType & buffer, std::string & utf8, bool clear, int mode) { if( clear ) utf8.clear(); @@ -251,8 +251,8 @@ void WideToUTF8(TextStreamBase & buffer, s // not tested -template -void WideToUTF8(TextStreamBase & buffer, std::ostream & utf8, int mode) +template +void WideStreamToUTF8(StreamTypeIn & buffer, StreamTypeOut & utf8, int mode) { private_namespace::WideToUTF8Generic(buffer, mode, [&utf8](const char * utf8_buffer, std::size_t buffer_len){ utf8.write(utf8_buffer, buffer_len);