From 6f6df9524ca7090e60c27855d5e3119a3f02b37f Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Fri, 21 May 2021 00:32:05 +0200 Subject: [PATCH] updated to the new pikotools api: changed utf8 functions PascalCase to snake_case --- src/functions.h | 2 +- src/generator.h | 8 ++++---- src/objects.h | 6 +++--- src/patternparser.cpp | 26 +++++++++++++------------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/functions.h b/src/functions.h index 6b9f6a7..451a3d2 100644 --- a/src/functions.h +++ b/src/functions.h @@ -88,7 +88,7 @@ private: template void Functions::Insert(const char * key, UserFunction ufunction) { - pt::UTF8ToWide(key, temp_key); + pt::utf8_to_wide(key, temp_key); functions_tab[temp_key] = ufunction; temp_key.clear(); } diff --git a/src/generator.h b/src/generator.h index e023af9..a6c7a4d 100644 --- a/src/generator.h +++ b/src/generator.h @@ -429,8 +429,8 @@ Generator::~Generator() template void Generator::SetCommentary(const char * com_start, const char * com_stop) { - pt::UTF8ToWide(com_start, commentary_start); - pt::UTF8ToWide(com_stop, commentary_stop); + pt::utf8_to_wide(com_start, commentary_start); + pt::utf8_to_wide(com_stop, commentary_stop); } @@ -438,8 +438,8 @@ void Generator::SetCommentary(const char * com_start, const char * c template void Generator::SetCommentary(const std::string & com_start, const std::string & com_stop) { - pt::UTF8ToWide(com_start, commentary_start); - pt::UTF8ToWide(com_stop, commentary_stop); + pt::utf8_to_wide(com_start, commentary_start); + pt::utf8_to_wide(com_stop, commentary_stop); } diff --git a/src/objects.h b/src/objects.h index 5ec14ee..d8e36ad 100644 --- a/src/objects.h +++ b/src/objects.h @@ -155,7 +155,7 @@ protected: \ { \ EzcTemplateMethod item; \ \ - PT::UTF8ToWide(name, item.fun_name); \ + pt::utf8_to_wide(name, item.fun_name); \ item.fun = fun; \ \ ezc_template_method_tab.push_back(item); \ @@ -165,7 +165,7 @@ protected: \ { \ EzcTemplateMethod item; \ \ - PT::UTF8ToWide(name, item.fun_name); \ + pt::utf8_to_wide(name, item.fun_name); \ item.fun = fun; \ \ ezc_template_method_tab.push_back(item); \ @@ -294,7 +294,7 @@ size_t Objects::Size() const template void Objects::Clear() { - return obj_tab.clear(); + obj_tab.clear(); } diff --git a/src/patternparser.cpp b/src/patternparser.cpp index bd6d682..b055bc6 100644 --- a/src/patternparser.cpp +++ b/src/patternparser.cpp @@ -64,17 +64,17 @@ void PatternParser::Directory(const char * dir, const char * dir2) directory2.clear(); if( dir ) - pt::UTF8ToWide(dir, directory); + pt::utf8_to_wide(dir, directory); if( dir2 ) - pt::UTF8ToWide(dir2, directory2); + pt::utf8_to_wide(dir2, directory2); } void PatternParser::Directory(const std::string & dir) { - pt::UTF8ToWide(dir, directory); + pt::utf8_to_wide(dir, directory); directory2.clear(); } @@ -82,8 +82,8 @@ void PatternParser::Directory(const std::string & dir) void PatternParser::Directory(const std::string & dir, const std::string & dir2) { - pt::UTF8ToWide(dir, directory); - pt::UTF8ToWide(dir2, directory2); + pt::utf8_to_wide(dir, directory); + pt::utf8_to_wide(dir2, directory2); } @@ -126,16 +126,16 @@ void PatternParser::SetBlocks(Blocks & blocks) void PatternParser::SetCommentary(const char * com_start, const char * com_stop) { - pt::UTF8ToWide(com_start, commentary_start); - pt::UTF8ToWide(com_stop, commentary_stop); + pt::utf8_to_wide(com_start, commentary_start); + pt::utf8_to_wide(com_stop, commentary_stop); } void PatternParser::SetCommentary(const std::string & com_start, const std::string & com_stop) { - pt::UTF8ToWide(com_start, commentary_start); - pt::UTF8ToWide(com_stop, commentary_stop); + pt::utf8_to_wide(com_start, commentary_start); + pt::utf8_to_wide(com_stop, commentary_stop); } @@ -195,7 +195,7 @@ void PatternParser::ParseFile(const std::string & file_name, Pattern & pattern) void PatternParser::ParseFile(const char * file_name, Pattern & pattern) { pat = &pattern; - pt::UTF8ToWide(file_name, pat->item_root.file_name); + pt::utf8_to_wide(file_name, pat->item_root.file_name); include_level = 0; CreateTreeReadIncludeSkipAllowFlag(pat->item_root); @@ -225,7 +225,7 @@ void PatternParser::ParseFile(const wchar_t * file_name, Pattern & pattern) void PatternParser::ParseString(const char * str, Pattern & pattern) { - pt::UTF8ToWide(str, string_content); + pt::utf8_to_wide(str, string_content); ParseString(string_content.c_str(), pattern); string_content.clear(); } @@ -372,7 +372,7 @@ bool PatternParser::ReadFileFromDir(const std::wstring & dir, const wchar_t * na file_name = dir; file_name += '/'; file_name += name; - pt::WideToUTF8(file_name, afile_name); + pt::wide_to_utf8(file_name, afile_name); std::ifstream file(afile_name.c_str()); @@ -403,7 +403,7 @@ return true; void PatternParser::ReadFile(std::ifstream & file, std::wstring & result) { - pt::UTF8ToWide(file, result); + pt::utf8_to_wide(file, result); }