Path: Unicode handling and tests for SanitizeFileName

This commit is contained in:
Connor McLaughlin
2022-07-30 21:46:14 +10:00
parent 12875cbcac
commit 89659db7ee
9 changed files with 131 additions and 51 deletions

View File

@ -22,8 +22,7 @@ std::string Canonicalize(const std::string_view& path);
void Canonicalize(std::string* path);
/// Sanitizes a filename for use in a filesystem.
void SanitizeFileName(char* Destination, u32 cbDestination, const char* FileName, bool StripSlashes /* = true */);
void SanitizeFileName(std::string& Destination, bool StripSlashes = true);
std::string SanitizeFileName(const std::string_view& str, bool strip_slashes = true);
/// Returns true if the specified path is an absolute path (C:\Path on Windows or /path on Unix).
bool IsAbsolute(const std::string_view& path);