2017-06-01 21:55:10 +02:00
|
|
|
#pragma region Copyright (c) 2014-2017 OpenRCT2 Developers
|
2016-05-04 19:24:41 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
|
|
|
*
|
|
|
|
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
|
|
|
|
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
|
|
|
|
*
|
|
|
|
* OpenRCT2 is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* A full copy of the GNU General Public License can be found in licence.txt
|
|
|
|
*****************************************************************************/
|
|
|
|
#pragma endregion
|
|
|
|
|
2016-01-12 20:08:41 +01:00
|
|
|
#pragma once
|
|
|
|
|
2017-01-05 18:51:31 +01:00
|
|
|
#include <string>
|
|
|
|
#include "../common.h"
|
2016-01-12 20:08:41 +01:00
|
|
|
|
|
|
|
namespace Path
|
|
|
|
{
|
|
|
|
utf8 * Append(utf8 * buffer, size_t bufferSize, const utf8 * src);
|
2017-01-05 18:51:31 +01:00
|
|
|
std::string Combine(const std::string &a, const std::string &b);
|
2017-06-05 18:46:17 +02:00
|
|
|
|
|
|
|
template<typename... Args>
|
2017-06-15 22:54:53 +02:00
|
|
|
static std::string Combine(const std::string &a, const std::string &b, Args... args)
|
2017-06-05 18:46:17 +02:00
|
|
|
{
|
|
|
|
return Combine(a, Combine(b, args...));
|
|
|
|
}
|
|
|
|
|
2017-01-05 18:51:31 +01:00
|
|
|
std::string GetDirectory(const std::string &path);
|
2016-11-13 14:15:01 +01:00
|
|
|
utf8 * GetDirectory(const utf8 * path);
|
2016-01-30 00:18:28 +01:00
|
|
|
utf8 * GetDirectory(utf8 * buffer, size_t bufferSize, const utf8 * path);
|
2017-11-28 21:57:34 +01:00
|
|
|
void CreateDirectory(const std::string &path);
|
2017-12-02 00:48:46 +01:00
|
|
|
bool DirectoryExists(const std::string &path);
|
2017-01-05 18:51:31 +01:00
|
|
|
std::string GetFileName(const std::string &path);
|
2016-04-17 16:21:35 +02:00
|
|
|
const utf8 * GetFileName(const utf8 * path);
|
2017-01-05 14:13:22 +01:00
|
|
|
std::string GetFileNameWithoutExtension(const std::string &path);
|
2016-11-12 16:52:03 +01:00
|
|
|
utf8 * GetFileNameWithoutExtension(const utf8 * path);
|
2016-01-29 01:06:02 +01:00
|
|
|
utf8 * GetFileNameWithoutExtension(utf8 * buffer, size_t bufferSize, const utf8 * path);
|
2017-01-05 18:51:31 +01:00
|
|
|
const std::string GetExtension(const std::string &path);
|
2016-04-19 23:09:42 +02:00
|
|
|
const utf8 * GetExtension(const utf8 * path);
|
2016-01-29 01:06:02 +01:00
|
|
|
utf8 * GetAbsolute(utf8 * buffer, size_t bufferSize, const utf8 * relativePath);
|
2017-12-02 00:48:46 +01:00
|
|
|
std::string GetAbsolute(const std::string &relative);
|
2017-01-05 18:51:31 +01:00
|
|
|
bool Equals(const std::string &a, const std::string &b);
|
2016-01-29 20:39:31 +01:00
|
|
|
bool Equals(const utf8 * a, const utf8 * b);
|
2017-06-30 21:38:51 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if the given path is a file. If not, checks to see if
|
|
|
|
* there are any files with different casing and selects the first
|
|
|
|
* one found based on a straight forward character sort.
|
|
|
|
* Note: This will not resolve the case for Windows.
|
|
|
|
*/
|
|
|
|
std::string ResolveCasing(const std::string &path);
|
2016-01-12 20:08:41 +01:00
|
|
|
}
|