Trying to fix bug again

This commit is contained in:
mathusummut
2019-04-05 00:59:05 +02:00
parent 6612918b0f
commit e8b52942f5
3 changed files with 16 additions and 2 deletions

View File

@@ -241,6 +241,7 @@ namespace Shared {
bool EndsWith(const string &str, const string& key);
string endPathWithSlash(string& path, bool requireOSSlash = false);
string endPathWithSlash(string&& path, bool requireOSSlash = false);
string trimPathWithStartingSlash(string &path);
string updatePathClimbingParts(string &path, bool processPreviousDirTokenCheck = true);
string formatPath(string path);

View File

@@ -552,6 +552,19 @@ namespace Shared {
return result;
}
string endPathWithSlash(string&& path, bool requireOSSlash) {
if (EndsWith(path, "/") == false && EndsWith(path, "\\") == false) {
string seperator = "/";
if (requireOSSlash == true) {
#if defined(WIN32)
seperator = "\\";
#endif
}
path += seperator;
}
return path;
}
string endPathWithSlash(string &path, bool requireOSSlash) {
if (EndsWith(path, "/") == false && EndsWith(path, "\\") == false) {
string seperator = "/";