mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 16:31:28 +12:00
VFS fixes
- using /app_home/ as local link Implemented fmt::merge & fmt::tolower
This commit is contained in:
parent
ebae8dad0a
commit
a58c5f5a4c
5 changed files with 94 additions and 40 deletions
|
@ -57,7 +57,7 @@ int fmt::CmpNoCase(const std::string& a, const std::string& b)
|
|||
return std::equal(a.begin(),
|
||||
a.end(),
|
||||
b.begin(),
|
||||
[](const char& a, const char& b){return tolower(a) == tolower(b); })
|
||||
[](const char& a, const char& b){return ::tolower(a) == ::tolower(b); })
|
||||
? 0 : -1;
|
||||
}
|
||||
}
|
||||
|
@ -133,4 +133,35 @@ std::vector<std::string> fmt::split(const std::string& source, std::initializer_
|
|||
}
|
||||
|
||||
return std::move(result);
|
||||
}
|
||||
|
||||
std::string fmt::merge(std::vector<std::string> source, const std::string& separator)
|
||||
{
|
||||
std::string result;
|
||||
|
||||
for (auto &s : source)
|
||||
{
|
||||
result += s + separator;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string fmt::merge(std::initializer_list<std::vector<std::string>> sources, const std::string& separator)
|
||||
{
|
||||
std::string result;
|
||||
|
||||
for (auto &v : sources)
|
||||
{
|
||||
result += fmt::merge(v, separator);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string fmt::tolower(std::string source)
|
||||
{
|
||||
std::transform(source.begin(), source.end(), source.begin(), ::tolower);
|
||||
|
||||
return source;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue