Skip to content
Snippets Groups Projects
Commit d4e23dda authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

rm unused fcts

parent f6d947e2
No related branches found
No related tags found
1 merge request!380rm unused functions
......@@ -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)
{
......
......@@ -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.
......
......@@ -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)
{
......
......@@ -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);
......
......@@ -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.
......
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment