From d4e23dda8d6d73d1ecc5265a81a3abb07ec887d6 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Thu, 30 Sep 2021 14:01:06 +0200 Subject: [PATCH] rm unused fcts --- Base/Utils/StringUtils.cpp | 29 ----------------------------- Base/Utils/StringUtils.h | 3 --- Fit/Tools/StringUtils.cpp | 29 ----------------------------- Fit/Tools/StringUtils.h | 3 --- auto/Wrap/doxygenBase.i | 5 ----- auto/Wrap/doxygenFit.i | 5 ----- 6 files changed, 74 deletions(-) diff --git a/Base/Utils/StringUtils.cpp b/Base/Utils/StringUtils.cpp index ad3a9ae4d99..c21d57792e6 100644 --- a/Base/Utils/StringUtils.cpp +++ b/Base/Utils/StringUtils.cpp @@ -17,35 +17,6 @@ #include <charconv> #include <regex> -//! Returns true if text matches pattern with wildcards '*' and '?'. -bool BaseUtils::String::matchesPattern(const std::string& text, const std::string& wildcardPattern) -{ - // escape all regex special characters, except '?' and '*' - std::string mywildcardPattern = wildcardPattern; - boost::replace_all(mywildcardPattern, "\\", "\\\\"); - boost::replace_all(mywildcardPattern, "^", "\\^"); - boost::replace_all(mywildcardPattern, ".", "\\."); - boost::replace_all(mywildcardPattern, "$", "\\$"); - boost::replace_all(mywildcardPattern, "|", "\\|"); - boost::replace_all(mywildcardPattern, "(", "\\("); - boost::replace_all(mywildcardPattern, ")", "\\)"); - boost::replace_all(mywildcardPattern, "[", "\\["); - boost::replace_all(mywildcardPattern, "]", "\\]"); - boost::replace_all(mywildcardPattern, "+", "\\+"); - boost::replace_all(mywildcardPattern, "/", "\\/"); - - // Convert chars '*?' to their regex equivalents - boost::replace_all(mywildcardPattern, "?", "."); - boost::replace_all(mywildcardPattern, "*", ".*"); - - // constructing regexp pattern - mywildcardPattern = "^" + mywildcardPattern + "$"; - std::regex pattern(mywildcardPattern); - - // applaying match - return std::regex_match(text, pattern); -} - //! Returns string right-padded with blanks. std::string BaseUtils::String::padRight(const std::string& name, size_t length) { diff --git a/Base/Utils/StringUtils.h b/Base/Utils/StringUtils.h index 1df5265e0a5..f1516fb8dca 100644 --- a/Base/Utils/StringUtils.h +++ b/Base/Utils/StringUtils.h @@ -29,9 +29,6 @@ namespace BaseUtils::String { -//! Returns true if text matches pattern with wildcards '*' and '?'. -bool matchesPattern(const std::string& text, const std::string& wildcardPattern); - std::string padRight(const std::string& name, size_t length); //! Split string into vector of string using delimiter. diff --git a/Fit/Tools/StringUtils.cpp b/Fit/Tools/StringUtils.cpp index 5ca7e366707..bc120812dfb 100644 --- a/Fit/Tools/StringUtils.cpp +++ b/Fit/Tools/StringUtils.cpp @@ -18,35 +18,6 @@ namespace mumufit { -//! Returns true if text matches pattern with wildcards '*' and '?'. -bool stringUtils::matchesPattern(const std::string& text, const std::string& wildcardPattern) -{ - // escape all regex special characters, except '?' and '*' - std::string mywildcardPattern = wildcardPattern; - boost::replace_all(mywildcardPattern, "\\", "\\\\"); - boost::replace_all(mywildcardPattern, "^", "\\^"); - boost::replace_all(mywildcardPattern, ".", "\\."); - boost::replace_all(mywildcardPattern, "$", "\\$"); - boost::replace_all(mywildcardPattern, "|", "\\|"); - boost::replace_all(mywildcardPattern, "(", "\\("); - boost::replace_all(mywildcardPattern, ")", "\\)"); - boost::replace_all(mywildcardPattern, "[", "\\["); - boost::replace_all(mywildcardPattern, "]", "\\]"); - boost::replace_all(mywildcardPattern, "+", "\\+"); - boost::replace_all(mywildcardPattern, "/", "\\/"); - - // Convert chars '*?' to their regex equivalents - boost::replace_all(mywildcardPattern, "?", "."); - boost::replace_all(mywildcardPattern, "*", ".*"); - - // constructing regexp pattern - mywildcardPattern = "^" + mywildcardPattern + "$"; - std::regex pattern(mywildcardPattern); - - // applaying match - return std::regex_match(text, pattern); -} - //! Returns token vector obtained by splitting string at delimiters. std::vector<std::string> stringUtils::split(const std::string& text, const std::string& delimiter) { diff --git a/Fit/Tools/StringUtils.h b/Fit/Tools/StringUtils.h index 80e6f9348c7..e66beee7cc1 100644 --- a/Fit/Tools/StringUtils.h +++ b/Fit/Tools/StringUtils.h @@ -29,9 +29,6 @@ namespace mumufit::stringUtils { -//! Returns true if text matches pattern with wildcards '*' and '?'. -bool matchesPattern(const std::string& text, const std::string& wildcardPattern); - //! Split string into vector of string using delimeter. std::vector<std::string> split(const std::string& text, const std::string& delimeter); diff --git a/auto/Wrap/doxygenBase.i b/auto/Wrap/doxygenBase.i index ad090e82e5a..12e9e4e218a 100644 --- a/auto/Wrap/doxygenBase.i +++ b/auto/Wrap/doxygenBase.i @@ -1413,11 +1413,6 @@ Returns string representing python stack trace. // File: namespaceBaseUtils_1_1String.xml -%feature("docstring") BaseUtils::String::matchesPattern "bool BaseUtils::String::matchesPattern(const std::string &text, const std::string &wildcardPattern) - -Returns true if text matches pattern with wildcards '*' and '?'. -"; - %feature("docstring") BaseUtils::String::padRight "std::string BaseUtils::String::padRight(const std::string &name, size_t length) Returns string right-padded with blanks. diff --git a/auto/Wrap/doxygenFit.i b/auto/Wrap/doxygenFit.i index 623be4302b7..630680290a5 100644 --- a/auto/Wrap/doxygenFit.i +++ b/auto/Wrap/doxygenFit.i @@ -12608,11 +12608,6 @@ Reports results of minimization in the form of multi-line string. // File: namespacemumufit_1_1stringUtils.xml -%feature("docstring") mumufit::stringUtils::matchesPattern "bool mumufit::stringUtils::matchesPattern(const std::string &text, const std::string &wildcardPattern) - -Returns true if text matches pattern with wildcards '*' and '?'. -"; - %feature("docstring") mumufit::stringUtils::split "std::vector< std::string > mumufit::stringUtils::split(const std::string &text, const std::string &delimeter) Split string into vector of string using delimeter. -- GitLab