1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 07:14:31 +01:00

finish conversion of RCT1 import to c++

This commit is contained in:
Ted John
2016-04-17 15:21:35 +01:00
parent cf7b81fd3a
commit 7754204a25
10 changed files with 2143 additions and 907 deletions

View File

@@ -33,6 +33,29 @@ namespace Path
return buffer;
}
const utf8 * GetFileName(const utf8 * path)
{
const utf8 * lastPathSeperator = nullptr;
for (const utf8 * ch = path; *ch != '\0'; ch++)
{
if (*ch == platform_get_path_separator())
{
lastPathSeperator = ch;
}
#ifdef _WINDOWS_
// Windows also allows forward slashes in paths
else if (*ch == '/')
{
lastPathSeperator = ch;
}
#endif
}
return lastPathSeperator == nullptr ?
path :
lastPathSeperator + 1;
}
utf8 * GetFileNameWithoutExtension(utf8 * buffer, size_t bufferSize, const utf8 * path)
{
const utf8 * lastDot = nullptr;