Always storing MBID in lowercase to avoid silly duplicates

This commit is contained in:
emeric
2020-03-23 18:06:39 +01:00
parent 5ab16ee821
commit a40c05ec6b
4 changed files with 22 additions and 5 deletions
+13 -3
View File
@@ -98,15 +98,25 @@ stringTrimEnd(const std::string& str, const std::string& whitespace)
}
std::string
stringToLower(const std::string& str)
stringToLower(std::string_view str)
{
return boost::algorithm::to_lower_copy(str);
std::string res;
res.reserve(str.size());
std::transform(std::cbegin(str), std::cend(str), std::back_inserter(res), [](char c) { return std::tolower(c);});
return res;
}
std::string
stringToUpper(const std::string& str)
{
return boost::to_upper_copy<std::string>(str);
std::string res;
res.reserve(str.size());
std::transform(std::cbegin(str), std::cend(str), std::back_inserter(res), [](char c) { return std::toupper(c);});
return res;
}
std::string