sys: fix games.yml hdd paths

This commit is contained in:
Megamouse 2024-01-01 23:59:27 +01:00
parent d6dde225bd
commit d03393ffe9
4 changed files with 24 additions and 8 deletions

View file

@ -612,7 +612,7 @@ std::vector<std::string> fmt::split(std::string_view source, std::initializer_li
std::string fmt::trim(const std::string& source, std::string_view values)
{
usz begin = source.find_first_not_of(values);
const usz begin = source.find_first_not_of(values);
if (begin == source.npos)
return {};
@ -620,6 +620,16 @@ std::string fmt::trim(const std::string& source, std::string_view values)
return source.substr(begin, source.find_last_not_of(values) + 1);
}
std::string fmt::trim_front(const std::string& source, std::string_view values)
{
const usz begin = source.find_first_not_of(values);
if (begin == source.npos)
return {};
return source.substr(begin);
}
void fmt::trim_back(std::string& source, std::string_view values)
{
const usz index = source.find_last_not_of(values);

View file

@ -125,6 +125,7 @@ namespace fmt
std::vector<std::string> split(std::string_view source, std::initializer_list<std::string_view> separators, bool is_skip_empty = true);
std::string trim(const std::string& source, std::string_view values = " \t");
std::string trim_front(const std::string& source, std::string_view values = " \t");
void trim_back(std::string& source, std::string_view values = " \t");
template <typename T>