VFS fixes

- using /app_home/ as local link
Implemented fmt::merge & fmt::tolower
This commit is contained in:
DHrpcs3 2014-11-30 13:18:17 +02:00
parent ebae8dad0a
commit a58c5f5a4c
5 changed files with 94 additions and 40 deletions

View file

@ -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;
}