Common/FileSystem: Add IsAbsolutePath() and tests

This commit is contained in:
Connor McLaughlin
2020-07-23 02:35:37 +10:00
parent d46c104d1b
commit 266d70c629
6 changed files with 41 additions and 0 deletions

View File

@@ -137,6 +137,9 @@ void SanitizeFileName(char* Destination, u32 cbDestination, const char* FileName
void SanitizeFileName(String& Destination, const char* FileName, bool StripSlashes = true);
void SanitizeFileName(String& Destination, bool StripSlashes = true);
/// Returns true if the specified path is an absolute path (C:\Path on Windows or /path on Unix).
bool IsAbsolutePath(const std::string_view& path);
/// Replaces the extension of a filename with another.
std::string ReplaceExtension(std::string_view path, std::string_view new_extension);