fix(CORE): another attempt to fix the dbimport command line warning (#13449)

This commit is contained in:
Yehonal
2022-10-22 00:21:16 +02:00
committed by GitHub
parent 53219310cf
commit 77a52b8001
10 changed files with 72 additions and 5 deletions

View File

@@ -64,5 +64,19 @@ std::string Acore::String::TrimRightInPlace(std::string& str)
return str;
}
/**
* @brief Util function to add a suffix char. Can be used to add a slash at the end of a path
*
* @param str String where to apply the suffix
* @param suffix Character to add at the end of the str
* @return std::string Suffixed string
*/
std::string Acore::String::AddSuffixIfNotExists(std::string str, const char suffix) {
if (str.empty() || (str.at(str.length() - 1) != suffix))
str.push_back(suffix);
return str;
}
// Template Trim
template AC_COMMON_API std::string Acore::String::Trim<std::string>(const std::string& s, const std::locale& loc /*= std::locale()*/);

View File

@@ -72,6 +72,8 @@ namespace Acore::String
AC_COMMON_API Str Trim(const Str& s, const std::locale& loc = std::locale());
AC_COMMON_API std::string TrimRightInPlace(std::string& str);
AC_COMMON_API std::string AddSuffixIfNotExists(std::string str, const char suffix);
}
#endif