mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Add STL version of Appendslash
This commit is contained in:
parent
e45c0fde7d
commit
b7b42786ab
@ -33,6 +33,8 @@ string CreateTimedFileName();
|
||||
string CreateUUID();
|
||||
void CreateDirectories(string svInput, string* pszOutput = nullptr, bool bWindows = false);
|
||||
|
||||
void AppendSlash(string& svInput, const char separator = '\\');
|
||||
|
||||
string ConvertToWinPath(const string& svInput);
|
||||
string ConvertToUnixPath(const string& svInput);
|
||||
|
||||
|
@ -409,6 +409,17 @@ void CreateDirectories(string svInput, string* pszOutput, bool bWindows)
|
||||
fs::create_directories(fspPathOut);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// For appending a slash at the end of the string if not already present.
|
||||
void AppendSlash(string& svInput, const char separator)
|
||||
{
|
||||
char lchar = svInput[svInput.size() - 1];
|
||||
if (lchar != '\\' && lchar != '/')
|
||||
{
|
||||
svInput.push_back(separator);
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// For converting file paths to windows file paths.
|
||||
string ConvertToWinPath(const string& svInput)
|
||||
|
Loading…
x
Reference in New Issue
Block a user