mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-21 03:35:40 -04:00
System: Improve screenshot naming
This commit is contained in:
@ -182,6 +182,25 @@ void Path::SanitizeFileName(std::string* str, bool strip_slashes /* = true */)
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string Path::RemoveLengthLimits(std::string_view str)
|
||||
{
|
||||
std::string ret;
|
||||
#ifdef _WIN32
|
||||
ret.reserve(str.length() + 4);
|
||||
#endif
|
||||
ret.append(str);
|
||||
RemoveLengthLimits(&ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void Path::RemoveLengthLimits(std::string* path)
|
||||
{
|
||||
DebugAssert(IsAbsolute(*path));
|
||||
#ifdef _WIN32
|
||||
path->insert(0, "\\\\?\\");
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Path::IsAbsolute(const std::string_view& path)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
|
@ -28,6 +28,10 @@ void Canonicalize(std::string* path);
|
||||
std::string SanitizeFileName(const std::string_view& str, bool strip_slashes = true);
|
||||
void SanitizeFileName(std::string* str, bool strip_slashes = true);
|
||||
|
||||
/// Mutates the path to remove any MAX_PATH limits (for Windows).
|
||||
std::string RemoveLengthLimits(std::string_view str);
|
||||
void RemoveLengthLimits(std::string* path);
|
||||
|
||||
/// 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);
|
||||
|
||||
|
Reference in New Issue
Block a user