mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 14:24:33 +01:00
Use varg template for Path::Combine
This commit is contained in:
@@ -42,15 +42,6 @@ namespace Path
|
||||
return std::string(buffer);
|
||||
}
|
||||
|
||||
std::string Combine(const std::string &a, const std::string &b, const std::string &c)
|
||||
{
|
||||
utf8 buffer[MAX_PATH];
|
||||
String::Set(buffer, sizeof(buffer), a.c_str());
|
||||
Path::Append(buffer, sizeof(buffer), b.c_str());
|
||||
Path::Append(buffer, sizeof(buffer), c.c_str());
|
||||
return std::string(buffer);
|
||||
}
|
||||
|
||||
std::string GetDirectory(const std::string &path)
|
||||
{
|
||||
const utf8* directory = GetDirectory(path.c_str());
|
||||
|
||||
@@ -23,7 +23,13 @@ namespace Path
|
||||
{
|
||||
utf8 * Append(utf8 * buffer, size_t bufferSize, const utf8 * src);
|
||||
std::string Combine(const std::string &a, const std::string &b);
|
||||
std::string Combine(const std::string &a, const std::string &b, const std::string &c);
|
||||
|
||||
template<typename... Args>
|
||||
std::string Combine(const std::string &a, const std::string &b, Args... args)
|
||||
{
|
||||
return Combine(a, Combine(b, args...));
|
||||
}
|
||||
|
||||
std::string GetDirectory(const std::string &path);
|
||||
utf8 * GetDirectory(const utf8 * path);
|
||||
utf8 * GetDirectory(utf8 * buffer, size_t bufferSize, const utf8 * path);
|
||||
|
||||
Reference in New Issue
Block a user